htt.h 838 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. */
  226. #define HTT_CURRENT_VERSION_MAJOR 3
  227. #define HTT_CURRENT_VERSION_MINOR 104
  228. #define HTT_NUM_TX_FRAG_DESC 1024
  229. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  230. #define HTT_CHECK_SET_VAL(field, val) \
  231. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  232. /* macros to assist in sign-extending fields from HTT messages */
  233. #define HTT_SIGN_BIT_MASK(field) \
  234. ((field ## _M + (1 << field ## _S)) >> 1)
  235. #define HTT_SIGN_BIT(_val, field) \
  236. (_val & HTT_SIGN_BIT_MASK(field))
  237. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  238. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  239. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  240. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  241. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  242. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  243. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  244. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  245. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  246. /*
  247. * TEMPORARY:
  248. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  249. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  250. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  251. * updated.
  252. */
  253. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  254. /*
  255. * TEMPORARY:
  256. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  257. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  258. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  259. * updated.
  260. */
  261. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  262. /**
  263. * htt_dbg_stats_type -
  264. * bit positions for each stats type within a stats type bitmask
  265. * The bitmask contains 24 bits.
  266. */
  267. enum htt_dbg_stats_type {
  268. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  269. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  270. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  271. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  272. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  273. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  274. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  275. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  276. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  277. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  278. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  279. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  280. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  281. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  282. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  283. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  284. /* bits 16-23 currently reserved */
  285. /* keep this last */
  286. HTT_DBG_NUM_STATS
  287. };
  288. /*=== HTT option selection TLVs ===
  289. * Certain HTT messages have alternatives or options.
  290. * For such cases, the host and target need to agree on which option to use.
  291. * Option specification TLVs can be appended to the VERSION_REQ and
  292. * VERSION_CONF messages to select options other than the default.
  293. * These TLVs are entirely optional - if they are not provided, there is a
  294. * well-defined default for each option. If they are provided, they can be
  295. * provided in any order. Each TLV can be present or absent independent of
  296. * the presence / absence of other TLVs.
  297. *
  298. * The HTT option selection TLVs use the following format:
  299. * |31 16|15 8|7 0|
  300. * |---------------------------------+----------------+----------------|
  301. * | value (payload) | length | tag |
  302. * |-------------------------------------------------------------------|
  303. * The value portion need not be only 2 bytes; it can be extended by any
  304. * integer number of 4-byte units. The total length of the TLV, including
  305. * the tag and length fields, must be a multiple of 4 bytes. The length
  306. * field specifies the total TLV size in 4-byte units. Thus, the typical
  307. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  308. * field, would store 0x1 in its length field, to show that the TLV occupies
  309. * a single 4-byte unit.
  310. */
  311. /*--- TLV header format - applies to all HTT option TLVs ---*/
  312. enum HTT_OPTION_TLV_TAGS {
  313. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  314. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  315. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  316. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  317. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  318. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  319. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  320. };
  321. #define HTT_TCL_METADATA_VER_SZ 4
  322. PREPACK struct htt_option_tlv_header_t {
  323. A_UINT8 tag;
  324. A_UINT8 length;
  325. } POSTPACK;
  326. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  327. #define HTT_OPTION_TLV_TAG_S 0
  328. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  329. #define HTT_OPTION_TLV_LENGTH_S 8
  330. /*
  331. * value0 - 16 bit value field stored in word0
  332. * The TLV's value field may be longer than 2 bytes, in which case
  333. * the remainder of the value is stored in word1, word2, etc.
  334. */
  335. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  336. #define HTT_OPTION_TLV_VALUE0_S 16
  337. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_TAG_GET(word) \
  343. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  344. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  345. do { \
  346. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  347. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  348. } while (0)
  349. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  350. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  351. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  352. do { \
  353. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  354. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  355. } while (0)
  356. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  357. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  358. /*--- format of specific HTT option TLVs ---*/
  359. /*
  360. * HTT option TLV for specifying LL bus address size
  361. * Some chips require bus addresses used by the target to access buffers
  362. * within the host's memory to be 32 bits; others require bus addresses
  363. * used by the target to access buffers within the host's memory to be
  364. * 64 bits.
  365. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  366. * a suffix to the VERSION_CONF message to specify which bus address format
  367. * the target requires.
  368. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  369. * default to providing bus addresses to the target in 32-bit format.
  370. */
  371. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  372. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  373. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  374. };
  375. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  376. struct htt_option_tlv_header_t hdr;
  377. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  378. } POSTPACK;
  379. /*
  380. * HTT option TLV for specifying whether HL systems should indicate
  381. * over-the-air tx completion for individual frames, or should instead
  382. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  383. * requests an OTA tx completion for a particular tx frame.
  384. * This option does not apply to LL systems, where the TX_COMPL_IND
  385. * is mandatory.
  386. * This option is primarily intended for HL systems in which the tx frame
  387. * downloads over the host --> target bus are as slow as or slower than
  388. * the transmissions over the WLAN PHY. For cases where the bus is faster
  389. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  390. * and consquently will send one TX_COMPL_IND message that covers several
  391. * tx frames. For cases where the WLAN PHY is faster than the bus,
  392. * the target will end up transmitting very short A-MPDUs, and consequently
  393. * sending many TX_COMPL_IND messages, which each cover a very small number
  394. * of tx frames.
  395. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  396. * a suffix to the VERSION_REQ message to request whether the host desires to
  397. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  398. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  399. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  400. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  401. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  402. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  403. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  404. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  405. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  406. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  407. * TLV.
  408. */
  409. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  410. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  411. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  412. };
  413. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  414. struct htt_option_tlv_header_t hdr;
  415. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  416. } POSTPACK;
  417. /*
  418. * HTT option TLV for specifying how many tx queue groups the target
  419. * may establish.
  420. * This TLV specifies the maximum value the target may send in the
  421. * txq_group_id field of any TXQ_GROUP information elements sent by
  422. * the target to the host. This allows the host to pre-allocate an
  423. * appropriate number of tx queue group structs.
  424. *
  425. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  426. * a suffix to the VERSION_REQ message to specify whether the host supports
  427. * tx queue groups at all, and if so if there is any limit on the number of
  428. * tx queue groups that the host supports.
  429. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  430. * a suffix to the VERSION_CONF message. If the host has specified in the
  431. * VER_REQ message a limit on the number of tx queue groups the host can
  432. * supprt, the target shall limit its specification of the maximum tx groups
  433. * to be no larger than this host-specified limit.
  434. *
  435. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  436. * shall preallocate 4 tx queue group structs, and the target shall not
  437. * specify a txq_group_id larger than 3.
  438. */
  439. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  440. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  441. /*
  442. * values 1 through N specify the max number of tx queue groups
  443. * the sender supports
  444. */
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  446. };
  447. /* TEMPORARY backwards-compatibility alias for a typo fix -
  448. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  449. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  450. * to support the old name (with the typo) until all references to the
  451. * old name are replaced with the new name.
  452. */
  453. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  454. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  455. struct htt_option_tlv_header_t hdr;
  456. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  457. } POSTPACK;
  458. /*
  459. * HTT option TLV for specifying whether the target supports an extended
  460. * version of the HTT tx descriptor. If the target provides this TLV
  461. * and specifies in the TLV that the target supports an extended version
  462. * of the HTT tx descriptor, the target must check the "extension" bit in
  463. * the HTT tx descriptor, and if the extension bit is set, to expect a
  464. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  465. * descriptor. Furthermore, the target must provide room for the HTT
  466. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  467. * This option is intended for systems where the host needs to explicitly
  468. * control the transmission parameters such as tx power for individual
  469. * tx frames.
  470. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  471. * as a suffix to the VERSION_CONF message to explicitly specify whether
  472. * the target supports the HTT tx MSDU extension descriptor.
  473. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  474. * by the host as lack of target support for the HTT tx MSDU extension
  475. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  476. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  477. * the HTT tx MSDU extension descriptor.
  478. * The host is not required to provide the HTT tx MSDU extension descriptor
  479. * just because the target supports it; the target must check the
  480. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  481. * extension descriptor is present.
  482. */
  483. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  484. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  485. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  486. };
  487. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  488. struct htt_option_tlv_header_t hdr;
  489. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  490. } POSTPACK;
  491. /*
  492. * For the tcl data command V2 and higher support added a new
  493. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  494. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  495. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  496. * HTT option TLV for specifying which version of the TCL metadata struct
  497. * should be used:
  498. * V1 -> use htt_tx_tcl_metadata struct
  499. * V2 -> use htt_tx_tcl_metadata_v2 struct
  500. * Old FW will only support V1.
  501. * New FW will support V2. New FW will still support V1, at least during
  502. * a transition period.
  503. * Similarly, old host will only support V1, and new host will support V1 + V2.
  504. *
  505. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  506. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  507. * of TCL metadata the host supports. If the host doesn't provide a
  508. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  509. * is implicitly understood that the host only supports V1.
  510. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  511. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  512. * the host shall use. The target shall only select one of the versions
  513. * supported by the host. If the target doesn't provide a
  514. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  515. * is implicitly understood that the V1 TCL metadata shall be used.
  516. */
  517. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  518. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  519. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  520. };
  521. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  522. struct htt_option_tlv_header_t hdr;
  523. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  524. } POSTPACK;
  525. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  526. HTT_OPTION_TLV_VALUE0_SET(word, value)
  527. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  528. HTT_OPTION_TLV_VALUE0_GET(word)
  529. typedef struct {
  530. union {
  531. /* BIT [11 : 0] :- tag
  532. * BIT [23 : 12] :- length
  533. * BIT [31 : 24] :- reserved
  534. */
  535. A_UINT32 tag__length;
  536. /*
  537. * The following struct is not endian-portable.
  538. * It is suitable for use within the target, which is known to be
  539. * little-endian.
  540. * The host should use the above endian-portable macros to access
  541. * the tag and length bitfields in an endian-neutral manner.
  542. */
  543. struct {
  544. A_UINT32 tag : 12, /* BIT [11 : 0] */
  545. length : 12, /* BIT [23 : 12] */
  546. reserved : 8; /* BIT [31 : 24] */
  547. };
  548. };
  549. } htt_tlv_hdr_t;
  550. /** HTT stats TLV tag values */
  551. typedef enum {
  552. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  553. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  554. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  555. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  556. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  557. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  558. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  559. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  560. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  561. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  562. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  563. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  564. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  565. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  566. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  567. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  568. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  569. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  570. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  571. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  572. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  573. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  574. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  575. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  576. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  577. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  578. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  579. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  580. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  581. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  582. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  583. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  584. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  585. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  586. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  587. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  588. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  589. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  590. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  591. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  592. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  593. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  594. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  595. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  596. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  597. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  598. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  599. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  600. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  601. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  602. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  603. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  605. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  606. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  607. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  608. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  609. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  610. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  611. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  612. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  613. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  614. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  615. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  616. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  617. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  618. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  619. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  620. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  621. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  622. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  623. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  624. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  625. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  626. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  627. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  628. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  629. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  630. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  631. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  632. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  633. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  634. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  635. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  636. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  637. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  638. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  639. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  640. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  641. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  642. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  643. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  644. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  645. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  646. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  647. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  648. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  649. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  650. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  651. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  652. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  653. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  654. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  655. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  656. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  657. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  658. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  659. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  660. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  661. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  662. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  663. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  664. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  665. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  666. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  667. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  668. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  669. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  670. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  671. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  672. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  673. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  674. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  675. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  676. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  677. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  678. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  679. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  680. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  681. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  682. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  683. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  684. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  685. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  686. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  687. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  688. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  689. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  690. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  691. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  692. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  693. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  694. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  695. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  696. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  697. HTT_STATS_MAX_TAG,
  698. } htt_stats_tlv_tag_t;
  699. /* retain deprecated enum name as an alias for the current enum name */
  700. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  701. #define HTT_STATS_TLV_TAG_M 0x00000fff
  702. #define HTT_STATS_TLV_TAG_S 0
  703. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  704. #define HTT_STATS_TLV_LENGTH_S 12
  705. #define HTT_STATS_TLV_TAG_GET(_var) \
  706. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  707. HTT_STATS_TLV_TAG_S)
  708. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  709. do { \
  710. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  711. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  712. } while (0)
  713. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  714. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  715. HTT_STATS_TLV_LENGTH_S)
  716. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  717. do { \
  718. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  719. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  720. } while (0)
  721. /*=== host -> target messages ===============================================*/
  722. enum htt_h2t_msg_type {
  723. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  724. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  725. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  726. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  727. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  728. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  729. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  730. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  731. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  732. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  733. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  734. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  735. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  736. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  737. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  738. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  739. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  740. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  741. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  742. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  743. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  744. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  745. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  746. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  747. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  748. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  749. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  750. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  751. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  752. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  753. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  754. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  755. /* keep this last */
  756. HTT_H2T_NUM_MSGS
  757. };
  758. /*
  759. * HTT host to target message type -
  760. * stored in bits 7:0 of the first word of the message
  761. */
  762. #define HTT_H2T_MSG_TYPE_M 0xff
  763. #define HTT_H2T_MSG_TYPE_S 0
  764. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  765. do { \
  766. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  767. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  768. } while (0)
  769. #define HTT_H2T_MSG_TYPE_GET(word) \
  770. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  771. /**
  772. * @brief host -> target version number request message definition
  773. *
  774. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  775. *
  776. *
  777. * |31 24|23 16|15 8|7 0|
  778. * |----------------+----------------+----------------+----------------|
  779. * | reserved | msg type |
  780. * |-------------------------------------------------------------------|
  781. * : option request TLV (optional) |
  782. * :...................................................................:
  783. *
  784. * The VER_REQ message may consist of a single 4-byte word, or may be
  785. * extended with TLVs that specify which HTT options the host is requesting
  786. * from the target.
  787. * The following option TLVs may be appended to the VER_REQ message:
  788. * - HL_SUPPRESS_TX_COMPL_IND
  789. * - HL_MAX_TX_QUEUE_GROUPS
  790. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  791. * may be appended to the VER_REQ message (but only one TLV of each type).
  792. *
  793. * Header fields:
  794. * - MSG_TYPE
  795. * Bits 7:0
  796. * Purpose: identifies this as a version number request message
  797. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  798. */
  799. #define HTT_VER_REQ_BYTES 4
  800. /* TBDXXX: figure out a reasonable number */
  801. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  802. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  803. /**
  804. * @brief HTT tx MSDU descriptor
  805. *
  806. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  807. *
  808. * @details
  809. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  810. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  811. * the target firmware needs for the FW's tx processing, particularly
  812. * for creating the HW msdu descriptor.
  813. * The same HTT tx descriptor is used for HL and LL systems, though
  814. * a few fields within the tx descriptor are used only by LL or
  815. * only by HL.
  816. * The HTT tx descriptor is defined in two manners: by a struct with
  817. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  818. * definitions.
  819. * The target should use the struct def, for simplicitly and clarity,
  820. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  821. * neutral. Specifically, the host shall use the get/set macros built
  822. * around the mask + shift defs.
  823. */
  824. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  825. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  826. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  827. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  828. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  829. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  830. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  831. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  832. #define HTT_TX_VDEV_ID_WORD 0
  833. #define HTT_TX_VDEV_ID_MASK 0x3f
  834. #define HTT_TX_VDEV_ID_SHIFT 16
  835. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  836. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  837. #define HTT_TX_MSDU_LEN_DWORD 1
  838. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  839. /*
  840. * HTT_VAR_PADDR macros
  841. * Allow physical / bus addresses to be either a single 32-bit value,
  842. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  843. */
  844. #define HTT_VAR_PADDR32(var_name) \
  845. A_UINT32 var_name
  846. #define HTT_VAR_PADDR64_LE(var_name) \
  847. struct { \
  848. /* little-endian: lo precedes hi */ \
  849. A_UINT32 lo; \
  850. A_UINT32 hi; \
  851. } var_name
  852. /*
  853. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  854. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  855. * addresses are stored in a XXX-bit field.
  856. * This macro is used to define both htt_tx_msdu_desc32_t and
  857. * htt_tx_msdu_desc64_t structs.
  858. */
  859. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  860. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  861. { \
  862. /* DWORD 0: flags and meta-data */ \
  863. A_UINT32 \
  864. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  865. \
  866. /* pkt_subtype - \
  867. * Detailed specification of the tx frame contents, extending the \
  868. * general specification provided by pkt_type. \
  869. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  870. * pkt_type | pkt_subtype \
  871. * ============================================================== \
  872. * 802.3 | bit 0:3 - Reserved \
  873. * | bit 4: 0x0 - Copy-Engine Classification Results \
  874. * | not appended to the HTT message \
  875. * | 0x1 - Copy-Engine Classification Results \
  876. * | appended to the HTT message in the \
  877. * | format: \
  878. * | [HTT tx desc, frame header, \
  879. * | CE classification results] \
  880. * | The CE classification results begin \
  881. * | at the next 4-byte boundary after \
  882. * | the frame header. \
  883. * ------------+------------------------------------------------- \
  884. * Eth2 | bit 0:3 - Reserved \
  885. * | bit 4: 0x0 - Copy-Engine Classification Results \
  886. * | not appended to the HTT message \
  887. * | 0x1 - Copy-Engine Classification Results \
  888. * | appended to the HTT message. \
  889. * | See the above specification of the \
  890. * | CE classification results location. \
  891. * ------------+------------------------------------------------- \
  892. * native WiFi | bit 0:3 - Reserved \
  893. * | bit 4: 0x0 - Copy-Engine Classification Results \
  894. * | not appended to the HTT message \
  895. * | 0x1 - Copy-Engine Classification Results \
  896. * | appended to the HTT message. \
  897. * | See the above specification of the \
  898. * | CE classification results location. \
  899. * ------------+------------------------------------------------- \
  900. * mgmt | 0x0 - 802.11 MAC header absent \
  901. * | 0x1 - 802.11 MAC header present \
  902. * ------------+------------------------------------------------- \
  903. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  904. * | 0x1 - 802.11 MAC header present \
  905. * | bit 1: 0x0 - allow aggregation \
  906. * | 0x1 - don't allow aggregation \
  907. * | bit 2: 0x0 - perform encryption \
  908. * | 0x1 - don't perform encryption \
  909. * | bit 3: 0x0 - perform tx classification / queuing \
  910. * | 0x1 - don't perform tx classification; \
  911. * | insert the frame into the "misc" \
  912. * | tx queue \
  913. * | bit 4: 0x0 - Copy-Engine Classification Results \
  914. * | not appended to the HTT message \
  915. * | 0x1 - Copy-Engine Classification Results \
  916. * | appended to the HTT message. \
  917. * | See the above specification of the \
  918. * | CE classification results location. \
  919. */ \
  920. pkt_subtype: 5, \
  921. \
  922. /* pkt_type - \
  923. * General specification of the tx frame contents. \
  924. * The htt_pkt_type enum should be used to specify and check the \
  925. * value of this field. \
  926. */ \
  927. pkt_type: 3, \
  928. \
  929. /* vdev_id - \
  930. * ID for the vdev that is sending this tx frame. \
  931. * For certain non-standard packet types, e.g. pkt_type == raw \
  932. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  933. * This field is used primarily for determining where to queue \
  934. * broadcast and multicast frames. \
  935. */ \
  936. vdev_id: 6, \
  937. /* ext_tid - \
  938. * The extended traffic ID. \
  939. * If the TID is unknown, the extended TID is set to \
  940. * HTT_TX_EXT_TID_INVALID. \
  941. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  942. * value of the QoS TID. \
  943. * If the tx frame is non-QoS data, then the extended TID is set to \
  944. * HTT_TX_EXT_TID_NON_QOS. \
  945. * If the tx frame is multicast or broadcast, then the extended TID \
  946. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  947. */ \
  948. ext_tid: 5, \
  949. \
  950. /* postponed - \
  951. * This flag indicates whether the tx frame has been downloaded to \
  952. * the target before but discarded by the target, and now is being \
  953. * downloaded again; or if this is a new frame that is being \
  954. * downloaded for the first time. \
  955. * This flag allows the target to determine the correct order for \
  956. * transmitting new vs. old frames. \
  957. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  958. * This flag only applies to HL systems, since in LL systems, \
  959. * the tx flow control is handled entirely within the target. \
  960. */ \
  961. postponed: 1, \
  962. \
  963. /* extension - \
  964. * This flag indicates whether a HTT tx MSDU extension descriptor \
  965. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  966. * \
  967. * 0x0 - no extension MSDU descriptor is present \
  968. * 0x1 - an extension MSDU descriptor immediately follows the \
  969. * regular MSDU descriptor \
  970. */ \
  971. extension: 1, \
  972. \
  973. /* cksum_offload - \
  974. * This flag indicates whether checksum offload is enabled or not \
  975. * for this frame. Target FW use this flag to turn on HW checksumming \
  976. * 0x0 - No checksum offload \
  977. * 0x1 - L3 header checksum only \
  978. * 0x2 - L4 checksum only \
  979. * 0x3 - L3 header checksum + L4 checksum \
  980. */ \
  981. cksum_offload: 2, \
  982. \
  983. /* tx_comp_req - \
  984. * This flag indicates whether Tx Completion \
  985. * from fw is required or not. \
  986. * This flag is only relevant if tx completion is not \
  987. * universally enabled. \
  988. * For all LL systems, tx completion is mandatory, \
  989. * so this flag will be irrelevant. \
  990. * For HL systems tx completion is optional, but HL systems in which \
  991. * the bus throughput exceeds the WLAN throughput will \
  992. * probably want to always use tx completion, and thus \
  993. * would not check this flag. \
  994. * This flag is required when tx completions are not used universally, \
  995. * but are still required for certain tx frames for which \
  996. * an OTA delivery acknowledgment is needed by the host. \
  997. * In practice, this would be for HL systems in which the \
  998. * bus throughput is less than the WLAN throughput. \
  999. * \
  1000. * 0x0 - Tx Completion Indication from Fw not required \
  1001. * 0x1 - Tx Completion Indication from Fw is required \
  1002. */ \
  1003. tx_compl_req: 1; \
  1004. \
  1005. \
  1006. /* DWORD 1: MSDU length and ID */ \
  1007. A_UINT32 \
  1008. len: 16, /* MSDU length, in bytes */ \
  1009. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1010. * and this id is used to calculate fragmentation \
  1011. * descriptor pointer inside the target based on \
  1012. * the base address, configured inside the target. \
  1013. */ \
  1014. \
  1015. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1016. /* frags_desc_ptr - \
  1017. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1018. * where the tx frame's fragments reside in memory. \
  1019. * This field only applies to LL systems, since in HL systems the \
  1020. * (degenerate single-fragment) fragmentation descriptor is created \
  1021. * within the target. \
  1022. */ \
  1023. _paddr__frags_desc_ptr_; \
  1024. \
  1025. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1026. /* \
  1027. * Peer ID : Target can use this value to know which peer-id packet \
  1028. * destined to. \
  1029. * It's intended to be specified by host in case of NAWDS. \
  1030. */ \
  1031. A_UINT16 peerid; \
  1032. \
  1033. /* \
  1034. * Channel frequency: This identifies the desired channel \
  1035. * frequency (in mhz) for tx frames. This is used by FW to help \
  1036. * determine when it is safe to transmit or drop frames for \
  1037. * off-channel operation. \
  1038. * The default value of zero indicates to FW that the corresponding \
  1039. * VDEV's home channel (if there is one) is the desired channel \
  1040. * frequency. \
  1041. */ \
  1042. A_UINT16 chanfreq; \
  1043. \
  1044. /* Reason reserved is commented is increasing the htt structure size \
  1045. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1046. * A_UINT32 reserved_dword3_bits0_31; \
  1047. */ \
  1048. } POSTPACK
  1049. /* define a htt_tx_msdu_desc32_t type */
  1050. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1051. /* define a htt_tx_msdu_desc64_t type */
  1052. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1053. /*
  1054. * Make htt_tx_msdu_desc_t be an alias for either
  1055. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1056. */
  1057. #if HTT_PADDR64
  1058. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1059. #else
  1060. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1061. #endif
  1062. /* decriptor information for Management frame*/
  1063. /*
  1064. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1065. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1066. */
  1067. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1068. extern A_UINT32 mgmt_hdr_len;
  1069. PREPACK struct htt_mgmt_tx_desc_t {
  1070. A_UINT32 msg_type;
  1071. #if HTT_PADDR64
  1072. A_UINT64 frag_paddr; /* DMAble address of the data */
  1073. #else
  1074. A_UINT32 frag_paddr; /* DMAble address of the data */
  1075. #endif
  1076. A_UINT32 desc_id; /* returned to host during completion
  1077. * to free the meory*/
  1078. A_UINT32 len; /* Fragment length */
  1079. A_UINT32 vdev_id; /* virtual device ID*/
  1080. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1081. } POSTPACK;
  1082. PREPACK struct htt_mgmt_tx_compl_ind {
  1083. A_UINT32 desc_id;
  1084. A_UINT32 status;
  1085. } POSTPACK;
  1086. /*
  1087. * This SDU header size comes from the summation of the following:
  1088. * 1. Max of:
  1089. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1090. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1091. * b. 802.11 header, for raw frames: 36 bytes
  1092. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1093. * QoS header, HT header)
  1094. * c. 802.3 header, for ethernet frames: 14 bytes
  1095. * (destination address, source address, ethertype / length)
  1096. * 2. Max of:
  1097. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1098. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1099. * 3. 802.1Q VLAN header: 4 bytes
  1100. * 4. LLC/SNAP header: 8 bytes
  1101. */
  1102. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1103. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1104. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1105. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1106. A_COMPILE_TIME_ASSERT(
  1107. htt_encap_hdr_size_max_check_nwifi,
  1108. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1109. A_COMPILE_TIME_ASSERT(
  1110. htt_encap_hdr_size_max_check_enet,
  1111. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1112. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1113. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1114. #define HTT_TX_HDR_SIZE_802_1Q 4
  1115. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1116. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1117. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1118. HTT_TX_HDR_SIZE_802_1Q + \
  1119. HTT_TX_HDR_SIZE_LLC_SNAP)
  1120. #define HTT_HL_TX_FRM_HDR_LEN \
  1121. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1122. #define HTT_LL_TX_FRM_HDR_LEN \
  1123. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1124. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1125. /* dword 0 */
  1126. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1127. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1128. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1129. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1130. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1131. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1132. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1133. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1134. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1135. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1136. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1137. #define HTT_TX_DESC_PKT_TYPE_S 13
  1138. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1139. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1140. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1141. #define HTT_TX_DESC_VDEV_ID_S 16
  1142. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1143. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1144. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1145. #define HTT_TX_DESC_EXT_TID_S 22
  1146. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1147. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1148. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1149. #define HTT_TX_DESC_POSTPONED_S 27
  1150. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1151. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1152. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1153. #define HTT_TX_DESC_EXTENSION_S 28
  1154. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1155. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1156. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1157. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1158. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1159. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1160. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1161. #define HTT_TX_DESC_TX_COMP_S 31
  1162. /* dword 1 */
  1163. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1164. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1165. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1166. #define HTT_TX_DESC_FRM_LEN_S 0
  1167. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1168. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1169. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1170. #define HTT_TX_DESC_FRM_ID_S 16
  1171. /* dword 2 */
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1173. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1174. /* for systems using 64-bit format for bus addresses */
  1175. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1176. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1177. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1178. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1179. /* for systems using 32-bit format for bus addresses */
  1180. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1181. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1182. /* dword 3 */
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1184. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1185. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1186. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1187. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1188. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1189. #if HTT_PADDR64
  1190. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1191. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1192. #else
  1193. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1194. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1195. #endif
  1196. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1197. #define HTT_TX_DESC_PEER_ID_S 0
  1198. /*
  1199. * TEMPORARY:
  1200. * The original definitions for the PEER_ID fields contained typos
  1201. * (with _DESC_PADDR appended to this PEER_ID field name).
  1202. * Retain deprecated original names for PEER_ID fields until all code that
  1203. * refers to them has been updated.
  1204. */
  1205. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1206. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1207. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1208. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1209. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1210. HTT_TX_DESC_PEER_ID_M
  1211. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1212. HTT_TX_DESC_PEER_ID_S
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1214. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1215. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1216. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1217. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1218. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1219. #if HTT_PADDR64
  1220. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1221. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1222. #else
  1223. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1224. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1225. #endif
  1226. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1227. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1228. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1229. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1230. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1234. } while (0)
  1235. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1236. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1237. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1238. do { \
  1239. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1240. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1241. } while (0)
  1242. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1243. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1244. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1248. } while (0)
  1249. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1251. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1255. } while (0)
  1256. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1257. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1258. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1261. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1262. } while (0)
  1263. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1265. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1272. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1279. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1286. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1293. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1300. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1304. } while (0)
  1305. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1306. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1307. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1311. } while (0)
  1312. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1313. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1314. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1318. } while (0)
  1319. /* enums used in the HTT tx MSDU extension descriptor */
  1320. enum {
  1321. htt_tx_guard_interval_regular = 0,
  1322. htt_tx_guard_interval_short = 1,
  1323. };
  1324. enum {
  1325. htt_tx_preamble_type_ofdm = 0,
  1326. htt_tx_preamble_type_cck = 1,
  1327. htt_tx_preamble_type_ht = 2,
  1328. htt_tx_preamble_type_vht = 3,
  1329. };
  1330. enum {
  1331. htt_tx_bandwidth_5MHz = 0,
  1332. htt_tx_bandwidth_10MHz = 1,
  1333. htt_tx_bandwidth_20MHz = 2,
  1334. htt_tx_bandwidth_40MHz = 3,
  1335. htt_tx_bandwidth_80MHz = 4,
  1336. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1337. };
  1338. /**
  1339. * @brief HTT tx MSDU extension descriptor
  1340. * @details
  1341. * If the target supports HTT tx MSDU extension descriptors, the host has
  1342. * the option of appending the following struct following the regular
  1343. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1344. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1345. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1346. * tx specs for each frame.
  1347. */
  1348. PREPACK struct htt_tx_msdu_desc_ext_t {
  1349. /* DWORD 0: flags */
  1350. A_UINT32
  1351. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1352. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1353. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1354. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1355. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1356. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1357. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1358. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1359. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1360. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1361. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1362. /* DWORD 1: tx power, tx rate, tx BW */
  1363. A_UINT32
  1364. /* pwr -
  1365. * Specify what power the tx frame needs to be transmitted at.
  1366. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1367. * The value needs to be appropriately sign-extended when extracting
  1368. * the value from the message and storing it in a variable that is
  1369. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1370. * automatically handles this sign-extension.)
  1371. * If the transmission uses multiple tx chains, this power spec is
  1372. * the total transmit power, assuming incoherent combination of
  1373. * per-chain power to produce the total power.
  1374. */
  1375. pwr: 8,
  1376. /* mcs_mask -
  1377. * Specify the allowable values for MCS index (modulation and coding)
  1378. * to use for transmitting the frame.
  1379. *
  1380. * For HT / VHT preamble types, this mask directly corresponds to
  1381. * the HT or VHT MCS indices that are allowed. For each bit N set
  1382. * within the mask, MCS index N is allowed for transmitting the frame.
  1383. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1384. * rates versus OFDM rates, so the host has the option of specifying
  1385. * that the target must transmit the frame with CCK or OFDM rates
  1386. * (not HT or VHT), but leaving the decision to the target whether
  1387. * to use CCK or OFDM.
  1388. *
  1389. * For CCK and OFDM, the bits within this mask are interpreted as
  1390. * follows:
  1391. * bit 0 -> CCK 1 Mbps rate is allowed
  1392. * bit 1 -> CCK 2 Mbps rate is allowed
  1393. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1394. * bit 3 -> CCK 11 Mbps rate is allowed
  1395. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1396. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1397. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1398. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1399. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1400. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1401. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1402. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1403. *
  1404. * The MCS index specification needs to be compatible with the
  1405. * bandwidth mask specification. For example, a MCS index == 9
  1406. * specification is inconsistent with a preamble type == VHT,
  1407. * Nss == 1, and channel bandwidth == 20 MHz.
  1408. *
  1409. * Furthermore, the host has only a limited ability to specify to
  1410. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1411. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1412. */
  1413. mcs_mask: 12,
  1414. /* nss_mask -
  1415. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1416. * Each bit in this mask corresponds to a Nss value:
  1417. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1418. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1419. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1420. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1421. * The values in the Nss mask must be suitable for the recipient, e.g.
  1422. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1423. * recipient which only supports 2x2 MIMO.
  1424. */
  1425. nss_mask: 4,
  1426. /* guard_interval -
  1427. * Specify a htt_tx_guard_interval enum value to indicate whether
  1428. * the transmission should use a regular guard interval or a
  1429. * short guard interval.
  1430. */
  1431. guard_interval: 1,
  1432. /* preamble_type_mask -
  1433. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1434. * may choose from for transmitting this frame.
  1435. * The bits in this mask correspond to the values in the
  1436. * htt_tx_preamble_type enum. For example, to allow the target
  1437. * to transmit the frame as either CCK or OFDM, this field would
  1438. * be set to
  1439. * (1 << htt_tx_preamble_type_ofdm) |
  1440. * (1 << htt_tx_preamble_type_cck)
  1441. */
  1442. preamble_type_mask: 4,
  1443. reserved1_31_29: 3; /* unused, set to 0x0 */
  1444. /* DWORD 2: tx chain mask, tx retries */
  1445. A_UINT32
  1446. /* chain_mask - specify which chains to transmit from */
  1447. chain_mask: 4,
  1448. /* retry_limit -
  1449. * Specify the maximum number of transmissions, including the
  1450. * initial transmission, to attempt before giving up if no ack
  1451. * is received.
  1452. * If the tx rate is specified, then all retries shall use the
  1453. * same rate as the initial transmission.
  1454. * If no tx rate is specified, the target can choose whether to
  1455. * retain the original rate during the retransmissions, or to
  1456. * fall back to a more robust rate.
  1457. */
  1458. retry_limit: 4,
  1459. /* bandwidth_mask -
  1460. * Specify what channel widths may be used for the transmission.
  1461. * A value of zero indicates "don't care" - the target may choose
  1462. * the transmission bandwidth.
  1463. * The bits within this mask correspond to the htt_tx_bandwidth
  1464. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1465. * The bandwidth_mask must be consistent with the preamble_type_mask
  1466. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1467. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1468. */
  1469. bandwidth_mask: 6,
  1470. reserved2_31_14: 18; /* unused, set to 0x0 */
  1471. /* DWORD 3: tx expiry time (TSF) LSBs */
  1472. A_UINT32 expire_tsf_lo;
  1473. /* DWORD 4: tx expiry time (TSF) MSBs */
  1474. A_UINT32 expire_tsf_hi;
  1475. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1476. } POSTPACK;
  1477. /* DWORD 0 */
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1498. /* DWORD 1 */
  1499. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1500. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1501. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1502. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1503. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1504. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1505. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1506. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1507. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1508. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1509. /* DWORD 2 */
  1510. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1511. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1512. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1513. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1514. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1515. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1516. /* DWORD 0 */
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1518. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1519. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1521. do { \
  1522. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1523. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1524. } while (0)
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1526. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1527. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1529. do { \
  1530. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1531. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1532. } while (0)
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1534. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1535. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1537. do { \
  1538. HTT_CHECK_SET_VAL( \
  1539. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1540. ((_var) |= ((_val) \
  1541. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1542. } while (0)
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1544. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1545. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1547. do { \
  1548. HTT_CHECK_SET_VAL( \
  1549. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1550. ((_var) |= ((_val) \
  1551. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1552. } while (0)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1554. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1555. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1556. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1557. do { \
  1558. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1559. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1560. } while (0)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1563. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1567. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1592. } while (0)
  1593. /* DWORD 1 */
  1594. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1596. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1597. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1598. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1599. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1600. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1601. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1602. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1603. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1629. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1630. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1634. } while (0)
  1635. /* DWORD 2 */
  1636. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1655. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1659. } while (0)
  1660. typedef enum {
  1661. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1662. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1663. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1664. } htt_11ax_ltf_subtype_t;
  1665. typedef enum {
  1666. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1667. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1668. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1669. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1670. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1671. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1672. } htt_tx_ext2_preamble_type_t;
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1677. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1678. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1679. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1680. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1681. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1682. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1683. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1684. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1685. /**
  1686. * @brief HTT tx MSDU extension descriptor v2
  1687. * @details
  1688. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1689. * is received as tcl_exit_base->host_meta_info in firmware.
  1690. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1691. * are already part of tcl_exit_base.
  1692. */
  1693. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1694. /* DWORD 0: flags */
  1695. A_UINT32
  1696. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1697. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1698. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1699. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1700. valid_retries : 1, /* if set, tx retries spec is valid */
  1701. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1702. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1703. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1704. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1705. valid_key_flags : 1, /* if set, key flags is valid */
  1706. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1707. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1708. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1709. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1710. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1711. 1 = ENCRYPT,
  1712. 2 ~ 3 - Reserved */
  1713. /* retry_limit -
  1714. * Specify the maximum number of transmissions, including the
  1715. * initial transmission, to attempt before giving up if no ack
  1716. * is received.
  1717. * If the tx rate is specified, then all retries shall use the
  1718. * same rate as the initial transmission.
  1719. * If no tx rate is specified, the target can choose whether to
  1720. * retain the original rate during the retransmissions, or to
  1721. * fall back to a more robust rate.
  1722. */
  1723. retry_limit : 4,
  1724. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1725. * Valid only for 11ax preamble types HE_SU
  1726. * and HE_EXT_SU
  1727. */
  1728. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1729. * Valid only for 11ax preamble types HE_SU
  1730. * and HE_EXT_SU
  1731. */
  1732. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1733. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1734. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1735. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1736. */
  1737. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1738. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1739. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1740. * Use cases:
  1741. * Any time firmware uses TQM-BYPASS for Data
  1742. * TID, firmware expect host to set this bit.
  1743. */
  1744. /* DWORD 1: tx power, tx rate */
  1745. A_UINT32
  1746. power : 8, /* unit of the power field is 0.5 dbm
  1747. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1748. * signed value ranging from -64dbm to 63.5 dbm
  1749. */
  1750. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1751. * Setting more than one MCS isn't currently
  1752. * supported by the target (but is supported
  1753. * in the interface in case in the future
  1754. * the target supports specifications of
  1755. * a limited set of MCS values.
  1756. */
  1757. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1758. * Setting more than one Nss isn't currently
  1759. * supported by the target (but is supported
  1760. * in the interface in case in the future
  1761. * the target supports specifications of
  1762. * a limited set of Nss values.
  1763. */
  1764. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1765. update_peer_cache : 1; /* When set these custom values will be
  1766. * used for all packets, until the next
  1767. * update via this ext header.
  1768. * This is to make sure not all packets
  1769. * need to include this header.
  1770. */
  1771. /* DWORD 2: tx chain mask, tx retries */
  1772. A_UINT32
  1773. /* chain_mask - specify which chains to transmit from */
  1774. chain_mask : 8,
  1775. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1776. * TODO: Update Enum values for key_flags
  1777. */
  1778. /*
  1779. * Channel frequency: This identifies the desired channel
  1780. * frequency (in MHz) for tx frames. This is used by FW to help
  1781. * determine when it is safe to transmit or drop frames for
  1782. * off-channel operation.
  1783. * The default value of zero indicates to FW that the corresponding
  1784. * VDEV's home channel (if there is one) is the desired channel
  1785. * frequency.
  1786. */
  1787. chanfreq : 16;
  1788. /* DWORD 3: tx expiry time (TSF) LSBs */
  1789. A_UINT32 expire_tsf_lo;
  1790. /* DWORD 4: tx expiry time (TSF) MSBs */
  1791. A_UINT32 expire_tsf_hi;
  1792. /* DWORD 5: flags to control routing / processing of the MSDU */
  1793. A_UINT32
  1794. /* learning_frame
  1795. * When this flag is set, this frame will be dropped by FW
  1796. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1797. */
  1798. learning_frame : 1,
  1799. /* send_as_standalone
  1800. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1801. * i.e. with no A-MSDU or A-MPDU aggregation.
  1802. * The scope is extended to other use-cases.
  1803. */
  1804. send_as_standalone : 1,
  1805. /* is_host_opaque_valid
  1806. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1807. * with valid information.
  1808. */
  1809. is_host_opaque_valid : 1,
  1810. rsvd0 : 29;
  1811. /* DWORD 6 : Host opaque cookie for special frames */
  1812. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1813. rsvd1 : 16;
  1814. /*
  1815. * This structure can be expanded further up to 40 bytes
  1816. * by adding further DWORDs as needed.
  1817. */
  1818. } POSTPACK;
  1819. /* DWORD 0 */
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1846. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1847. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1848. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1849. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1850. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1851. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1852. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1853. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1854. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1855. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1856. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1857. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1858. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1859. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1860. /* DWORD 1 */
  1861. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1862. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1863. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1864. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1865. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1866. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1867. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1868. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1869. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1870. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1871. /* DWORD 2 */
  1872. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1873. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1874. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1875. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1876. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1877. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1878. /* DWORD 5 */
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1885. /* DWORD 6 */
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1887. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1888. /* DWORD 0 */
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1896. } while (0)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1898. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1899. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1904. } while (0)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1906. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1907. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1911. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1912. } while (0)
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1914. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1915. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1917. do { \
  1918. HTT_CHECK_SET_VAL( \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1920. ((_var) |= ((_val) \
  1921. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1922. } while (0)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1924. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1925. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1930. } while (0)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1937. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1938. } while (0)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1940. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1941. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1943. do { \
  1944. HTT_CHECK_SET_VAL( \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1946. ((_var) |= ((_val) \
  1947. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1988. } while (0)
  1989. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1990. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1991. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1996. } while (0)
  1997. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1998. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1999. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2000. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2052. } while (0)
  2053. /* DWORD 1 */
  2054. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2058. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2059. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2060. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2061. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2062. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2063. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2070. } while (0)
  2071. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2078. } while (0)
  2079. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2086. } while (0)
  2087. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2088. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2089. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2090. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2094. } while (0)
  2095. /* DWORD 2 */
  2096. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2103. } while (0)
  2104. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2105. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2106. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2107. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2111. } while (0)
  2112. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2113. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2114. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2115. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2118. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2119. } while (0)
  2120. /* DWORD 5 */
  2121. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2122. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2123. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2124. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2128. } while (0)
  2129. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2130. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2131. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2132. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2133. do { \
  2134. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2135. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2136. } while (0)
  2137. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2138. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2139. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2140. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2141. do { \
  2142. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2143. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2144. } while (0)
  2145. /* DWORD 6 */
  2146. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2147. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2148. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2149. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2150. do { \
  2151. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2152. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2153. } while (0)
  2154. typedef enum {
  2155. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2156. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2157. } htt_tcl_metadata_type;
  2158. /**
  2159. * @brief HTT TCL command number format
  2160. * @details
  2161. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2162. * available to firmware as tcl_exit_base->tcl_status_number.
  2163. * For regular / multicast packets host will send vdev and mac id and for
  2164. * NAWDS packets, host will send peer id.
  2165. * A_UINT32 is used to avoid endianness conversion problems.
  2166. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2167. */
  2168. typedef struct {
  2169. A_UINT32
  2170. type: 1, /* vdev_id based or peer_id based */
  2171. rsvd: 31;
  2172. } htt_tx_tcl_vdev_or_peer_t;
  2173. typedef struct {
  2174. A_UINT32
  2175. type: 1, /* vdev_id based or peer_id based */
  2176. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2177. vdev_id: 8,
  2178. pdev_id: 2,
  2179. host_inspected:1,
  2180. rsvd: 19;
  2181. } htt_tx_tcl_vdev_metadata;
  2182. typedef struct {
  2183. A_UINT32
  2184. type: 1, /* vdev_id based or peer_id based */
  2185. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2186. peer_id: 14,
  2187. rsvd: 16;
  2188. } htt_tx_tcl_peer_metadata;
  2189. PREPACK struct htt_tx_tcl_metadata {
  2190. union {
  2191. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2192. htt_tx_tcl_vdev_metadata vdev_meta;
  2193. htt_tx_tcl_peer_metadata peer_meta;
  2194. };
  2195. } POSTPACK;
  2196. /* DWORD 0 */
  2197. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2198. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2199. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2200. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2201. /* VDEV metadata */
  2202. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2203. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2204. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2205. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2206. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2207. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2208. /* PEER metadata */
  2209. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2210. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2211. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2212. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2213. HTT_TX_TCL_METADATA_TYPE_S)
  2214. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2215. do { \
  2216. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2217. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2218. } while (0)
  2219. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2220. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2221. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2222. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2223. do { \
  2224. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2225. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2226. } while (0)
  2227. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2228. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2229. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2230. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2231. do { \
  2232. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2233. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2234. } while (0)
  2235. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2236. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2237. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2238. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2242. } while (0)
  2243. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2244. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2245. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2246. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2250. } while (0)
  2251. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2252. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2253. HTT_TX_TCL_METADATA_PEER_ID_S)
  2254. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2258. } while (0)
  2259. /*------------------------------------------------------------------
  2260. * V2 Version of TCL Data Command
  2261. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2262. * MLO global_seq all flavours of TCL Data Cmd.
  2263. *-----------------------------------------------------------------*/
  2264. typedef enum {
  2265. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2266. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2267. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2268. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2269. } htt_tcl_metadata_type_v2;
  2270. /**
  2271. * @brief HTT TCL command number format
  2272. * @details
  2273. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2274. * available to firmware as tcl_exit_base->tcl_status_number.
  2275. * A_UINT32 is used to avoid endianness conversion problems.
  2276. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2277. */
  2278. typedef struct {
  2279. A_UINT32
  2280. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2281. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2282. vdev_id: 8,
  2283. pdev_id: 2,
  2284. host_inspected:1,
  2285. rsvd: 2,
  2286. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2287. } htt_tx_tcl_vdev_metadata_v2;
  2288. typedef struct {
  2289. A_UINT32
  2290. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2291. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2292. peer_id: 13,
  2293. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2294. } htt_tx_tcl_peer_metadata_v2;
  2295. typedef struct {
  2296. A_UINT32
  2297. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2298. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2299. svc_class_id: 8,
  2300. rsvd: 5,
  2301. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2302. } htt_tx_tcl_svc_class_id_metadata;
  2303. typedef struct {
  2304. A_UINT32
  2305. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2306. host_inspected: 1,
  2307. global_seq_no: 12,
  2308. rsvd: 1,
  2309. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2310. } htt_tx_tcl_global_seq_metadata;
  2311. PREPACK struct htt_tx_tcl_metadata_v2 {
  2312. union {
  2313. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2314. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2315. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2316. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2317. };
  2318. } POSTPACK;
  2319. /* DWORD 0 */
  2320. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2321. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2322. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2323. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2324. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2325. /* VDEV V2 metadata */
  2326. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2327. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2328. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2329. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2330. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2331. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2332. /* PEER V2 metadata */
  2333. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2334. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2335. /* SVC_CLASS_ID metadata */
  2336. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2337. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2338. /* Global Seq no metadata */
  2339. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2340. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2341. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2342. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2343. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2344. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2345. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2346. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2347. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2351. } while (0)
  2352. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2353. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2354. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2355. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2359. } while (0)
  2360. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2361. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2362. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2363. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2364. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2368. } while (0)
  2369. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2370. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2371. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2372. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2373. do { \
  2374. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2375. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2376. } while (0)
  2377. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2378. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2379. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2380. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2381. do { \
  2382. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2383. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2384. } while (0)
  2385. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2386. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2387. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2388. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2389. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2390. do { \
  2391. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2392. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2393. } while (0)
  2394. /*----- Get and Set V2 type field in Service Class fields ----*/
  2395. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2396. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2397. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2398. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2399. do { \
  2400. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2401. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2402. } while (0)
  2403. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2404. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2406. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2407. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2411. } while (0)
  2412. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2413. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2414. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2415. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2419. } while (0)
  2420. /*------------------------------------------------------------------
  2421. * End V2 Version of TCL Data Command
  2422. *-----------------------------------------------------------------*/
  2423. typedef enum {
  2424. HTT_TX_FW2WBM_TX_STATUS_OK,
  2425. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2426. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2427. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2428. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2429. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2430. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2431. HTT_TX_FW2WBM_TX_STATUS_MAX
  2432. } htt_tx_fw2wbm_tx_status_t;
  2433. typedef enum {
  2434. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2435. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2436. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2437. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2438. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2439. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2440. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2441. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2442. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2443. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2444. } htt_tx_fw2wbm_reinject_reason_t;
  2445. /**
  2446. * @brief HTT TX WBM Completion from firmware to host
  2447. * @details
  2448. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2449. * DWORD 3 and 4 for software based completions (Exception frames and
  2450. * TQM bypass frames)
  2451. * For software based completions, wbm_release_ring->release_source_module will
  2452. * be set to release_source_fw
  2453. */
  2454. PREPACK struct htt_tx_wbm_completion {
  2455. A_UINT32
  2456. sch_cmd_id: 24,
  2457. exception_frame: 1, /* If set, this packet was queued via exception path */
  2458. rsvd0_31_25: 7;
  2459. A_UINT32
  2460. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2461. * reception of an ACK or BA, this field indicates
  2462. * the RSSI of the received ACK or BA frame.
  2463. * When the frame is removed as result of a direct
  2464. * remove command from the SW, this field is set
  2465. * to 0x0 (which is never a valid value when real
  2466. * RSSI is available).
  2467. * Units: dB w.r.t noise floor
  2468. */
  2469. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2470. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2471. rsvd1_31_16: 16;
  2472. } POSTPACK;
  2473. /* DWORD 0 */
  2474. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2475. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2476. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2477. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2478. /* DWORD 1 */
  2479. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2480. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2481. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2482. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2483. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2484. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2485. /* DWORD 0 */
  2486. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2487. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2488. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2489. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2492. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2493. } while (0)
  2494. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2495. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2496. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2497. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2498. do { \
  2499. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2500. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2501. } while (0)
  2502. /* DWORD 1 */
  2503. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2504. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2505. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2506. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2507. do { \
  2508. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2509. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2510. } while (0)
  2511. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2512. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2513. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2514. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2515. do { \
  2516. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2517. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2518. } while (0)
  2519. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2520. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2521. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2522. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2523. do { \
  2524. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2525. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2526. } while (0)
  2527. /**
  2528. * @brief HTT TX WBM Completion from firmware to host
  2529. * @details
  2530. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2531. * (WBM) offload HW.
  2532. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2533. * For software based completions, release_source_module will
  2534. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2535. * struct wbm_release_ring and then switch to this after looking at
  2536. * release_source_module.
  2537. */
  2538. PREPACK struct htt_tx_wbm_completion_v2 {
  2539. A_UINT32
  2540. used_by_hw0; /* Refer to struct wbm_release_ring */
  2541. A_UINT32
  2542. used_by_hw1; /* Refer to struct wbm_release_ring */
  2543. A_UINT32
  2544. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2545. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2546. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2547. exception_frame: 1,
  2548. rsvd0: 12, /* For future use */
  2549. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2550. rsvd1: 1; /* For future use */
  2551. A_UINT32
  2552. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2553. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2554. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2555. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2556. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2557. */
  2558. A_UINT32
  2559. data1: 32;
  2560. A_UINT32
  2561. data2: 32;
  2562. A_UINT32
  2563. used_by_hw3; /* Refer to struct wbm_release_ring */
  2564. } POSTPACK;
  2565. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2566. /* DWORD 3 */
  2567. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2568. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2569. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2570. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2571. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2572. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2573. /* DWORD 3 */
  2574. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2575. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2576. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2577. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2580. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2581. } while (0)
  2582. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2583. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2584. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2585. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2586. do { \
  2587. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2588. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2589. } while (0)
  2590. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2591. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2592. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2593. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2594. do { \
  2595. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2596. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2597. } while (0)
  2598. /**
  2599. * @brief HTT TX WBM Completion from firmware to host (V3)
  2600. * @details
  2601. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2602. * (WBM) offload HW.
  2603. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2604. * For software based completions, release_source_module will
  2605. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2606. * struct wbm_release_ring and then switch to this after looking at
  2607. * release_source_module.
  2608. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2609. * by new generations of targets.
  2610. */
  2611. PREPACK struct htt_tx_wbm_completion_v3 {
  2612. A_UINT32
  2613. used_by_hw0; /* Refer to struct wbm_release_ring */
  2614. A_UINT32
  2615. used_by_hw1; /* Refer to struct wbm_release_ring */
  2616. A_UINT32
  2617. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2618. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2619. used_by_hw3: 15;
  2620. A_UINT32
  2621. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2622. exception_frame: 1,
  2623. rsvd0: 27; /* For future use */
  2624. A_UINT32
  2625. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2626. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2627. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2628. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2629. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2630. */
  2631. A_UINT32
  2632. data1: 32;
  2633. A_UINT32
  2634. data2: 32;
  2635. A_UINT32
  2636. rsvd1: 20,
  2637. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2638. } POSTPACK;
  2639. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2640. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2641. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2642. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2643. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2644. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2645. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2646. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2647. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2648. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2652. } while (0)
  2653. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2654. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2655. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2656. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2659. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2660. } while (0)
  2661. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2662. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2663. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2664. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2665. do { \
  2666. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2667. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2668. } while (0)
  2669. typedef enum {
  2670. TX_FRAME_TYPE_UNDEFINED = 0,
  2671. TX_FRAME_TYPE_EAPOL = 1,
  2672. } htt_tx_wbm_status_frame_type;
  2673. /**
  2674. * @brief HTT TX WBM transmit status from firmware to host
  2675. * @details
  2676. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2677. * (WBM) offload HW.
  2678. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2679. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2680. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2681. */
  2682. PREPACK struct htt_tx_wbm_transmit_status {
  2683. A_UINT32
  2684. sch_cmd_id: 24,
  2685. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2686. * reception of an ACK or BA, this field indicates
  2687. * the RSSI of the received ACK or BA frame.
  2688. * When the frame is removed as result of a direct
  2689. * remove command from the SW, this field is set
  2690. * to 0x0 (which is never a valid value when real
  2691. * RSSI is available).
  2692. * Units: dB w.r.t noise floor
  2693. */
  2694. A_UINT32
  2695. sw_peer_id: 16,
  2696. tid_num: 5,
  2697. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2698. * and tid_num fields contain valid data.
  2699. * If this "valid" flag is not set, the
  2700. * sw_peer_id and tid_num fields must be ignored.
  2701. */
  2702. mcast: 1,
  2703. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2704. * contains valid data.
  2705. */
  2706. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2707. reserved: 4;
  2708. A_UINT32
  2709. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2710. * packets in the wbm completion path
  2711. */
  2712. } POSTPACK;
  2713. /* DWORD 4 */
  2714. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2715. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2716. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2717. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2718. /* DWORD 5 */
  2719. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2720. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2721. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2722. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2723. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2724. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2725. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2726. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2727. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2728. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2729. /* DWORD 4 */
  2730. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2731. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2732. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2733. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2734. do { \
  2735. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2736. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2737. } while (0)
  2738. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2739. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2740. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2741. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2742. do { \
  2743. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2744. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2745. } while (0)
  2746. /* DWORD 5 */
  2747. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2748. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2749. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2750. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2753. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2754. } while (0)
  2755. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2756. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2757. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2758. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2761. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2762. } while (0)
  2763. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2770. } while (0)
  2771. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2772. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2773. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2774. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2777. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2778. } while (0)
  2779. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2780. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2781. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2782. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2785. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2786. } while (0)
  2787. /**
  2788. * @brief HTT TX WBM reinject status from firmware to host
  2789. * @details
  2790. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2791. * (WBM) offload HW.
  2792. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2793. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2794. */
  2795. PREPACK struct htt_tx_wbm_reinject_status {
  2796. A_UINT32
  2797. reserved0: 32;
  2798. A_UINT32
  2799. reserved1: 32;
  2800. A_UINT32
  2801. reserved2: 32;
  2802. } POSTPACK;
  2803. /**
  2804. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2805. * @details
  2806. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2807. * (WBM) offload HW.
  2808. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2809. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2810. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2811. * STA side.
  2812. */
  2813. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2814. A_UINT32
  2815. mec_sa_addr_31_0;
  2816. A_UINT32
  2817. mec_sa_addr_47_32: 16,
  2818. sa_ast_index: 16;
  2819. A_UINT32
  2820. vdev_id: 8,
  2821. reserved0: 24;
  2822. } POSTPACK;
  2823. /* DWORD 4 - mec_sa_addr_31_0 */
  2824. /* DWORD 5 */
  2825. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2826. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2827. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2828. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2829. /* DWORD 6 */
  2830. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2831. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2832. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2833. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2834. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2835. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2838. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2839. } while (0)
  2840. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2841. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2842. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2843. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2846. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2847. } while (0)
  2848. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2849. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2850. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2851. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2854. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2855. } while (0)
  2856. typedef enum {
  2857. TX_FLOW_PRIORITY_BE,
  2858. TX_FLOW_PRIORITY_HIGH,
  2859. TX_FLOW_PRIORITY_LOW,
  2860. } htt_tx_flow_priority_t;
  2861. typedef enum {
  2862. TX_FLOW_LATENCY_SENSITIVE,
  2863. TX_FLOW_LATENCY_INSENSITIVE,
  2864. } htt_tx_flow_latency_t;
  2865. typedef enum {
  2866. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2867. TX_FLOW_INTERACTIVE_TRAFFIC,
  2868. TX_FLOW_PERIODIC_TRAFFIC,
  2869. TX_FLOW_BURSTY_TRAFFIC,
  2870. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2871. } htt_tx_flow_traffic_pattern_t;
  2872. /**
  2873. * @brief HTT TX Flow search metadata format
  2874. * @details
  2875. * Host will set this metadata in flow table's flow search entry along with
  2876. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2877. * firmware and TQM ring if the flow search entry wins.
  2878. * This metadata is available to firmware in that first MSDU's
  2879. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2880. * to one of the available flows for specific tid and returns the tqm flow
  2881. * pointer as part of htt_tx_map_flow_info message.
  2882. */
  2883. PREPACK struct htt_tx_flow_metadata {
  2884. A_UINT32
  2885. rsvd0_1_0: 2,
  2886. tid: 4,
  2887. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2888. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2889. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2890. * Else choose final tid based on latency, priority.
  2891. */
  2892. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2893. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2894. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2895. } POSTPACK;
  2896. /* DWORD 0 */
  2897. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2898. #define HTT_TX_FLOW_METADATA_TID_S 2
  2899. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2900. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2901. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2902. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2903. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2904. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2905. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2906. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2907. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2908. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2909. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2910. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2911. /* DWORD 0 */
  2912. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2913. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2914. HTT_TX_FLOW_METADATA_TID_S)
  2915. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2918. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2919. } while (0)
  2920. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2921. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2922. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2923. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2926. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2927. } while (0)
  2928. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2929. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2930. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2931. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2934. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2935. } while (0)
  2936. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2937. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2938. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2939. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2942. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2943. } while (0)
  2944. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2945. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2946. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2947. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2950. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2951. } while (0)
  2952. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2953. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2954. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2955. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2958. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2959. } while (0)
  2960. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2961. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2962. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2963. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2966. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2967. } while (0)
  2968. /**
  2969. * @brief host -> target ADD WDS Entry
  2970. *
  2971. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2972. *
  2973. * @brief host -> target DELETE WDS Entry
  2974. *
  2975. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2976. *
  2977. * @details
  2978. * HTT wds entry from source port learning
  2979. * Host will learn wds entries from rx and send this message to firmware
  2980. * to enable firmware to configure/delete AST entries for wds clients.
  2981. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2982. * and when SA's entry is deleted, firmware removes this AST entry
  2983. *
  2984. * The message would appear as follows:
  2985. *
  2986. * |31 30|29 |17 16|15 8|7 0|
  2987. * |----------------+----------------+----------------+----------------|
  2988. * | rsvd0 |PDVID| vdev_id | msg_type |
  2989. * |-------------------------------------------------------------------|
  2990. * | sa_addr_31_0 |
  2991. * |-------------------------------------------------------------------|
  2992. * | | ta_peer_id | sa_addr_47_32 |
  2993. * |-------------------------------------------------------------------|
  2994. * Where PDVID = pdev_id
  2995. *
  2996. * The message is interpreted as follows:
  2997. *
  2998. * dword0 - b'0:7 - msg_type: This will be set to
  2999. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3000. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3001. *
  3002. * dword0 - b'8:15 - vdev_id
  3003. *
  3004. * dword0 - b'16:17 - pdev_id
  3005. *
  3006. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3007. *
  3008. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3009. *
  3010. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3011. *
  3012. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3013. */
  3014. PREPACK struct htt_wds_entry {
  3015. A_UINT32
  3016. msg_type: 8,
  3017. vdev_id: 8,
  3018. pdev_id: 2,
  3019. rsvd0: 14;
  3020. A_UINT32 sa_addr_31_0;
  3021. A_UINT32
  3022. sa_addr_47_32: 16,
  3023. ta_peer_id: 14,
  3024. rsvd2: 2;
  3025. } POSTPACK;
  3026. /* DWORD 0 */
  3027. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3028. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3029. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3030. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3031. /* DWORD 2 */
  3032. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3033. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3034. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3035. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3036. /* DWORD 0 */
  3037. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3038. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3039. HTT_WDS_ENTRY_VDEV_ID_S)
  3040. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3043. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3044. } while (0)
  3045. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3046. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3047. HTT_WDS_ENTRY_PDEV_ID_S)
  3048. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3049. do { \
  3050. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3051. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3052. } while (0)
  3053. /* DWORD 2 */
  3054. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3055. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3056. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3057. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3060. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3061. } while (0)
  3062. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3063. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3064. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3065. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3066. do { \
  3067. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3068. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3069. } while (0)
  3070. /**
  3071. * @brief MAC DMA rx ring setup specification
  3072. *
  3073. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3074. *
  3075. * @details
  3076. * To allow for dynamic rx ring reconfiguration and to avoid race
  3077. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3078. * it uses. Instead, it sends this message to the target, indicating how
  3079. * the rx ring used by the host should be set up and maintained.
  3080. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3081. * specifications.
  3082. *
  3083. * |31 16|15 8|7 0|
  3084. * |---------------------------------------------------------------|
  3085. * header: | reserved | num rings | msg type |
  3086. * |---------------------------------------------------------------|
  3087. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3088. #if HTT_PADDR64
  3089. * | FW_IDX shadow register physical address (bits 63:32) |
  3090. #endif
  3091. * |---------------------------------------------------------------|
  3092. * | rx ring base physical address (bits 31:0) |
  3093. #if HTT_PADDR64
  3094. * | rx ring base physical address (bits 63:32) |
  3095. #endif
  3096. * |---------------------------------------------------------------|
  3097. * | rx ring buffer size | rx ring length |
  3098. * |---------------------------------------------------------------|
  3099. * | FW_IDX initial value | enabled flags |
  3100. * |---------------------------------------------------------------|
  3101. * | MSDU payload offset | 802.11 header offset |
  3102. * |---------------------------------------------------------------|
  3103. * | PPDU end offset | PPDU start offset |
  3104. * |---------------------------------------------------------------|
  3105. * | MPDU end offset | MPDU start offset |
  3106. * |---------------------------------------------------------------|
  3107. * | MSDU end offset | MSDU start offset |
  3108. * |---------------------------------------------------------------|
  3109. * | frag info offset | rx attention offset |
  3110. * |---------------------------------------------------------------|
  3111. * payload 2, if present, has the same format as payload 1
  3112. * Header fields:
  3113. * - MSG_TYPE
  3114. * Bits 7:0
  3115. * Purpose: identifies this as an rx ring configuration message
  3116. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3117. * - NUM_RINGS
  3118. * Bits 15:8
  3119. * Purpose: indicates whether the host is setting up one rx ring or two
  3120. * Value: 1 or 2
  3121. * Payload:
  3122. * for systems using 64-bit format for bus addresses:
  3123. * - IDX_SHADOW_REG_PADDR_LO
  3124. * Bits 31:0
  3125. * Value: lower 4 bytes of physical address of the host's
  3126. * FW_IDX shadow register
  3127. * - IDX_SHADOW_REG_PADDR_HI
  3128. * Bits 31:0
  3129. * Value: upper 4 bytes of physical address of the host's
  3130. * FW_IDX shadow register
  3131. * - RING_BASE_PADDR_LO
  3132. * Bits 31:0
  3133. * Value: lower 4 bytes of physical address of the host's rx ring
  3134. * - RING_BASE_PADDR_HI
  3135. * Bits 31:0
  3136. * Value: uppper 4 bytes of physical address of the host's rx ring
  3137. * for systems using 32-bit format for bus addresses:
  3138. * - IDX_SHADOW_REG_PADDR
  3139. * Bits 31:0
  3140. * Value: physical address of the host's FW_IDX shadow register
  3141. * - RING_BASE_PADDR
  3142. * Bits 31:0
  3143. * Value: physical address of the host's rx ring
  3144. * - RING_LEN
  3145. * Bits 15:0
  3146. * Value: number of elements in the rx ring
  3147. * - RING_BUF_SZ
  3148. * Bits 31:16
  3149. * Value: size of the buffers referenced by the rx ring, in byte units
  3150. * - ENABLED_FLAGS
  3151. * Bits 15:0
  3152. * Value: 1-bit flags to show whether different rx fields are enabled
  3153. * bit 0: 802.11 header enabled (1) or disabled (0)
  3154. * bit 1: MSDU payload enabled (1) or disabled (0)
  3155. * bit 2: PPDU start enabled (1) or disabled (0)
  3156. * bit 3: PPDU end enabled (1) or disabled (0)
  3157. * bit 4: MPDU start enabled (1) or disabled (0)
  3158. * bit 5: MPDU end enabled (1) or disabled (0)
  3159. * bit 6: MSDU start enabled (1) or disabled (0)
  3160. * bit 7: MSDU end enabled (1) or disabled (0)
  3161. * bit 8: rx attention enabled (1) or disabled (0)
  3162. * bit 9: frag info enabled (1) or disabled (0)
  3163. * bit 10: unicast rx enabled (1) or disabled (0)
  3164. * bit 11: multicast rx enabled (1) or disabled (0)
  3165. * bit 12: ctrl rx enabled (1) or disabled (0)
  3166. * bit 13: mgmt rx enabled (1) or disabled (0)
  3167. * bit 14: null rx enabled (1) or disabled (0)
  3168. * bit 15: phy data rx enabled (1) or disabled (0)
  3169. * - IDX_INIT_VAL
  3170. * Bits 31:16
  3171. * Purpose: Specify the initial value for the FW_IDX.
  3172. * Value: the number of buffers initially present in the host's rx ring
  3173. * - OFFSET_802_11_HDR
  3174. * Bits 15:0
  3175. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3176. * - OFFSET_MSDU_PAYLOAD
  3177. * Bits 31:16
  3178. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3179. * - OFFSET_PPDU_START
  3180. * Bits 15:0
  3181. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3182. * - OFFSET_PPDU_END
  3183. * Bits 31:16
  3184. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3185. * - OFFSET_MPDU_START
  3186. * Bits 15:0
  3187. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3188. * - OFFSET_MPDU_END
  3189. * Bits 31:16
  3190. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3191. * - OFFSET_MSDU_START
  3192. * Bits 15:0
  3193. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3194. * - OFFSET_MSDU_END
  3195. * Bits 31:16
  3196. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3197. * - OFFSET_RX_ATTN
  3198. * Bits 15:0
  3199. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3200. * - OFFSET_FRAG_INFO
  3201. * Bits 31:16
  3202. * Value: offset in QUAD-bytes of frag info table
  3203. */
  3204. /* header fields */
  3205. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3206. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3207. /* payload fields */
  3208. /* for systems using a 64-bit format for bus addresses */
  3209. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3212. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3214. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3215. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3216. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3217. /* for systems using a 32-bit format for bus addresses */
  3218. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3219. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3220. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3221. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3222. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3223. #define HTT_RX_RING_CFG_LEN_S 0
  3224. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3225. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3226. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3227. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3228. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3229. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3230. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3231. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3232. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3233. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3234. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3235. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3236. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3237. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3238. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3239. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3240. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3241. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3242. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3243. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3244. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3245. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3246. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3247. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3248. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3249. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3250. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3251. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3252. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3253. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3254. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3255. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3256. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3257. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3258. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3259. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3260. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3261. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3262. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3263. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3264. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3265. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3266. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3267. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3268. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3269. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3270. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3271. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3272. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3273. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3274. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3275. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3276. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3277. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3278. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3279. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3280. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3281. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3282. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3283. #if HTT_PADDR64
  3284. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3285. #else
  3286. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3287. #endif
  3288. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3289. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3290. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3291. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3292. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3293. do { \
  3294. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3295. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3296. } while (0)
  3297. /* degenerate case for 32-bit fields */
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3299. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3300. ((_var) = (_val))
  3301. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3302. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3303. ((_var) = (_val))
  3304. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3305. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3306. ((_var) = (_val))
  3307. /* degenerate case for 32-bit fields */
  3308. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3309. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3310. ((_var) = (_val))
  3311. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3312. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3313. ((_var) = (_val))
  3314. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3315. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3316. ((_var) = (_val))
  3317. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3318. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3319. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3320. do { \
  3321. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3322. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3323. } while (0)
  3324. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3325. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3326. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3329. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3330. } while (0)
  3331. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3332. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3333. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3334. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3337. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3338. } while (0)
  3339. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3340. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3341. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3342. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3343. do { \
  3344. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3345. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3346. } while (0)
  3347. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3348. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3349. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3350. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3351. do { \
  3352. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3353. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3354. } while (0)
  3355. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3357. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3358. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3359. do { \
  3360. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3361. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3362. } while (0)
  3363. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3365. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3366. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3367. do { \
  3368. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3369. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3370. } while (0)
  3371. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3372. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3373. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3374. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3381. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3382. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3389. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3390. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3461. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3462. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3469. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3470. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3477. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3478. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3485. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3486. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3493. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3494. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3501. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3502. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3509. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3510. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3517. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3518. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3538. } while (0)
  3539. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3540. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3541. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3542. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3545. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3546. } while (0)
  3547. /**
  3548. * @brief host -> target FW statistics retrieve
  3549. *
  3550. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3551. *
  3552. * @details
  3553. * The following field definitions describe the format of the HTT host
  3554. * to target FW stats retrieve message. The message specifies the type of
  3555. * stats host wants to retrieve.
  3556. *
  3557. * |31 24|23 16|15 8|7 0|
  3558. * |-----------------------------------------------------------|
  3559. * | stats types request bitmask | msg type |
  3560. * |-----------------------------------------------------------|
  3561. * | stats types reset bitmask | reserved |
  3562. * |-----------------------------------------------------------|
  3563. * | stats type | config value |
  3564. * |-----------------------------------------------------------|
  3565. * | cookie LSBs |
  3566. * |-----------------------------------------------------------|
  3567. * | cookie MSBs |
  3568. * |-----------------------------------------------------------|
  3569. * Header fields:
  3570. * - MSG_TYPE
  3571. * Bits 7:0
  3572. * Purpose: identifies this is a stats upload request message
  3573. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3574. * - UPLOAD_TYPES
  3575. * Bits 31:8
  3576. * Purpose: identifies which types of FW statistics to upload
  3577. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3578. * - RESET_TYPES
  3579. * Bits 31:8
  3580. * Purpose: identifies which types of FW statistics to reset
  3581. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3582. * - CFG_VAL
  3583. * Bits 23:0
  3584. * Purpose: give an opaque configuration value to the specified stats type
  3585. * Value: stats-type specific configuration value
  3586. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3587. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3588. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3589. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3590. * - CFG_STAT_TYPE
  3591. * Bits 31:24
  3592. * Purpose: specify which stats type (if any) the config value applies to
  3593. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3594. * a valid configuration specification
  3595. * - COOKIE_LSBS
  3596. * Bits 31:0
  3597. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3598. * message with its preceding host->target stats request message.
  3599. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3600. * - COOKIE_MSBS
  3601. * Bits 31:0
  3602. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3603. * message with its preceding host->target stats request message.
  3604. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3605. */
  3606. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3607. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3608. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3609. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3610. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3611. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3612. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3613. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3614. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3615. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3616. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3617. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3618. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3619. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3622. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3623. } while (0)
  3624. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3625. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3626. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3627. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3630. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3631. } while (0)
  3632. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3633. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3634. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3635. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3638. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3639. } while (0)
  3640. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3641. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3642. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3643. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3646. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3647. } while (0)
  3648. /**
  3649. * @brief host -> target HTT out-of-band sync request
  3650. *
  3651. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3652. *
  3653. * @details
  3654. * The HTT SYNC tells the target to suspend processing of subsequent
  3655. * HTT host-to-target messages until some other target agent locally
  3656. * informs the target HTT FW that the current sync counter is equal to
  3657. * or greater than (in a modulo sense) the sync counter specified in
  3658. * the SYNC message.
  3659. * This allows other host-target components to synchronize their operation
  3660. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3661. * security key has been downloaded to and activated by the target.
  3662. * In the absence of any explicit synchronization counter value
  3663. * specification, the target HTT FW will use zero as the default current
  3664. * sync value.
  3665. *
  3666. * |31 24|23 16|15 8|7 0|
  3667. * |-----------------------------------------------------------|
  3668. * | reserved | sync count | msg type |
  3669. * |-----------------------------------------------------------|
  3670. * Header fields:
  3671. * - MSG_TYPE
  3672. * Bits 7:0
  3673. * Purpose: identifies this as a sync message
  3674. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3675. * - SYNC_COUNT
  3676. * Bits 15:8
  3677. * Purpose: specifies what sync value the HTT FW will wait for from
  3678. * an out-of-band specification to resume its operation
  3679. * Value: in-band sync counter value to compare against the out-of-band
  3680. * counter spec.
  3681. * The HTT target FW will suspend its host->target message processing
  3682. * as long as
  3683. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3684. */
  3685. #define HTT_H2T_SYNC_MSG_SZ 4
  3686. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3687. #define HTT_H2T_SYNC_COUNT_S 8
  3688. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3689. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3690. HTT_H2T_SYNC_COUNT_S)
  3691. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3694. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3695. } while (0)
  3696. /**
  3697. * @brief host -> target HTT aggregation configuration
  3698. *
  3699. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3700. */
  3701. #define HTT_AGGR_CFG_MSG_SZ 4
  3702. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3703. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3704. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3705. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3706. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3707. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3708. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3709. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3712. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3713. } while (0)
  3714. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3715. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3716. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3717. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3720. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3721. } while (0)
  3722. /**
  3723. * @brief host -> target HTT configure max amsdu info per vdev
  3724. *
  3725. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3726. *
  3727. * @details
  3728. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3729. *
  3730. * |31 21|20 16|15 8|7 0|
  3731. * |-----------------------------------------------------------|
  3732. * | reserved | vdev id | max amsdu | msg type |
  3733. * |-----------------------------------------------------------|
  3734. * Header fields:
  3735. * - MSG_TYPE
  3736. * Bits 7:0
  3737. * Purpose: identifies this as a aggr cfg ex message
  3738. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3739. * - MAX_NUM_AMSDU_SUBFRM
  3740. * Bits 15:8
  3741. * Purpose: max MSDUs per A-MSDU
  3742. * - VDEV_ID
  3743. * Bits 20:16
  3744. * Purpose: ID of the vdev to which this limit is applied
  3745. */
  3746. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3747. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3748. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3749. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3750. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3751. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3752. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3753. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3754. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3757. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3758. } while (0)
  3759. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3760. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3761. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3762. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3765. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3766. } while (0)
  3767. /**
  3768. * @brief HTT WDI_IPA Config Message
  3769. *
  3770. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3771. *
  3772. * @details
  3773. * The HTT WDI_IPA config message is created/sent by host at driver
  3774. * init time. It contains information about data structures used on
  3775. * WDI_IPA TX and RX path.
  3776. * TX CE ring is used for pushing packet metadata from IPA uC
  3777. * to WLAN FW
  3778. * TX Completion ring is used for generating TX completions from
  3779. * WLAN FW to IPA uC
  3780. * RX Indication ring is used for indicating RX packets from FW
  3781. * to IPA uC
  3782. * RX Ring2 is used as either completion ring or as second
  3783. * indication ring. when Ring2 is used as completion ring, IPA uC
  3784. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3785. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3786. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3787. * indicated in RX Indication ring. Please see WDI_IPA specification
  3788. * for more details.
  3789. * |31 24|23 16|15 8|7 0|
  3790. * |----------------+----------------+----------------+----------------|
  3791. * | tx pkt pool size | Rsvd | msg_type |
  3792. * |-------------------------------------------------------------------|
  3793. * | tx comp ring base (bits 31:0) |
  3794. #if HTT_PADDR64
  3795. * | tx comp ring base (bits 63:32) |
  3796. #endif
  3797. * |-------------------------------------------------------------------|
  3798. * | tx comp ring size |
  3799. * |-------------------------------------------------------------------|
  3800. * | tx comp WR_IDX physical address (bits 31:0) |
  3801. #if HTT_PADDR64
  3802. * | tx comp WR_IDX physical address (bits 63:32) |
  3803. #endif
  3804. * |-------------------------------------------------------------------|
  3805. * | tx CE WR_IDX physical address (bits 31:0) |
  3806. #if HTT_PADDR64
  3807. * | tx CE WR_IDX physical address (bits 63:32) |
  3808. #endif
  3809. * |-------------------------------------------------------------------|
  3810. * | rx indication ring base (bits 31:0) |
  3811. #if HTT_PADDR64
  3812. * | rx indication ring base (bits 63:32) |
  3813. #endif
  3814. * |-------------------------------------------------------------------|
  3815. * | rx indication ring size |
  3816. * |-------------------------------------------------------------------|
  3817. * | rx ind RD_IDX physical address (bits 31:0) |
  3818. #if HTT_PADDR64
  3819. * | rx ind RD_IDX physical address (bits 63:32) |
  3820. #endif
  3821. * |-------------------------------------------------------------------|
  3822. * | rx ind WR_IDX physical address (bits 31:0) |
  3823. #if HTT_PADDR64
  3824. * | rx ind WR_IDX physical address (bits 63:32) |
  3825. #endif
  3826. * |-------------------------------------------------------------------|
  3827. * |-------------------------------------------------------------------|
  3828. * | rx ring2 base (bits 31:0) |
  3829. #if HTT_PADDR64
  3830. * | rx ring2 base (bits 63:32) |
  3831. #endif
  3832. * |-------------------------------------------------------------------|
  3833. * | rx ring2 size |
  3834. * |-------------------------------------------------------------------|
  3835. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3836. #if HTT_PADDR64
  3837. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3838. #endif
  3839. * |-------------------------------------------------------------------|
  3840. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3841. #if HTT_PADDR64
  3842. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3843. #endif
  3844. * |-------------------------------------------------------------------|
  3845. *
  3846. * Header fields:
  3847. * Header fields:
  3848. * - MSG_TYPE
  3849. * Bits 7:0
  3850. * Purpose: Identifies this as WDI_IPA config message
  3851. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3852. * - TX_PKT_POOL_SIZE
  3853. * Bits 15:0
  3854. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3855. * WDI_IPA TX path
  3856. * For systems using 32-bit format for bus addresses:
  3857. * - TX_COMP_RING_BASE_ADDR
  3858. * Bits 31:0
  3859. * Purpose: TX Completion Ring base address in DDR
  3860. * - TX_COMP_RING_SIZE
  3861. * Bits 31:0
  3862. * Purpose: TX Completion Ring size (must be power of 2)
  3863. * - TX_COMP_WR_IDX_ADDR
  3864. * Bits 31:0
  3865. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3866. * updates the Write Index for WDI_IPA TX completion ring
  3867. * - TX_CE_WR_IDX_ADDR
  3868. * Bits 31:0
  3869. * Purpose: DDR address where IPA uC
  3870. * updates the WR Index for TX CE ring
  3871. * (needed for fusion platforms)
  3872. * - RX_IND_RING_BASE_ADDR
  3873. * Bits 31:0
  3874. * Purpose: RX Indication Ring base address in DDR
  3875. * - RX_IND_RING_SIZE
  3876. * Bits 31:0
  3877. * Purpose: RX Indication Ring size
  3878. * - RX_IND_RD_IDX_ADDR
  3879. * Bits 31:0
  3880. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3881. * RX indication ring
  3882. * - RX_IND_WR_IDX_ADDR
  3883. * Bits 31:0
  3884. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3885. * updates the Write Index for WDI_IPA RX indication ring
  3886. * - RX_RING2_BASE_ADDR
  3887. * Bits 31:0
  3888. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3889. * - RX_RING2_SIZE
  3890. * Bits 31:0
  3891. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3892. * - RX_RING2_RD_IDX_ADDR
  3893. * Bits 31:0
  3894. * Purpose: If Second RX ring is Indication ring, DDR address where
  3895. * IPA uC updates the Read Index for Ring2.
  3896. * If Second RX ring is completion ring, this is NOT used
  3897. * - RX_RING2_WR_IDX_ADDR
  3898. * Bits 31:0
  3899. * Purpose: If Second RX ring is Indication ring, DDR address where
  3900. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3901. * If second RX ring is completion ring, DDR address where
  3902. * IPA uC updates the Write Index for Ring 2.
  3903. * For systems using 64-bit format for bus addresses:
  3904. * - TX_COMP_RING_BASE_ADDR_LO
  3905. * Bits 31:0
  3906. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3907. * - TX_COMP_RING_BASE_ADDR_HI
  3908. * Bits 31:0
  3909. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3910. * - TX_COMP_RING_SIZE
  3911. * Bits 31:0
  3912. * Purpose: TX Completion Ring size (must be power of 2)
  3913. * - TX_COMP_WR_IDX_ADDR_LO
  3914. * Bits 31:0
  3915. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3916. * Lower 4 bytes of DDR address where WIFI FW
  3917. * updates the Write Index for WDI_IPA TX completion ring
  3918. * - TX_COMP_WR_IDX_ADDR_HI
  3919. * Bits 31:0
  3920. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3921. * Higher 4 bytes of DDR address where WIFI FW
  3922. * updates the Write Index for WDI_IPA TX completion ring
  3923. * - TX_CE_WR_IDX_ADDR_LO
  3924. * Bits 31:0
  3925. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3926. * updates the WR Index for TX CE ring
  3927. * (needed for fusion platforms)
  3928. * - TX_CE_WR_IDX_ADDR_HI
  3929. * Bits 31:0
  3930. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3931. * updates the WR Index for TX CE ring
  3932. * (needed for fusion platforms)
  3933. * - RX_IND_RING_BASE_ADDR_LO
  3934. * Bits 31:0
  3935. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3936. * - RX_IND_RING_BASE_ADDR_HI
  3937. * Bits 31:0
  3938. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3939. * - RX_IND_RING_SIZE
  3940. * Bits 31:0
  3941. * Purpose: RX Indication Ring size
  3942. * - RX_IND_RD_IDX_ADDR_LO
  3943. * Bits 31:0
  3944. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3945. * for WDI_IPA RX indication ring
  3946. * - RX_IND_RD_IDX_ADDR_HI
  3947. * Bits 31:0
  3948. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3949. * for WDI_IPA RX indication ring
  3950. * - RX_IND_WR_IDX_ADDR_LO
  3951. * Bits 31:0
  3952. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3953. * Lower 4 bytes of DDR address where WIFI FW
  3954. * updates the Write Index for WDI_IPA RX indication ring
  3955. * - RX_IND_WR_IDX_ADDR_HI
  3956. * Bits 31:0
  3957. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3958. * Higher 4 bytes of DDR address where WIFI FW
  3959. * updates the Write Index for WDI_IPA RX indication ring
  3960. * - RX_RING2_BASE_ADDR_LO
  3961. * Bits 31:0
  3962. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3963. * - RX_RING2_BASE_ADDR_HI
  3964. * Bits 31:0
  3965. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3966. * - RX_RING2_SIZE
  3967. * Bits 31:0
  3968. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3969. * - RX_RING2_RD_IDX_ADDR_LO
  3970. * Bits 31:0
  3971. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3972. * DDR address where IPA uC updates the Read Index for Ring2.
  3973. * If Second RX ring is completion ring, this is NOT used
  3974. * - RX_RING2_RD_IDX_ADDR_HI
  3975. * Bits 31:0
  3976. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3977. * DDR address where IPA uC updates the Read Index for Ring2.
  3978. * If Second RX ring is completion ring, this is NOT used
  3979. * - RX_RING2_WR_IDX_ADDR_LO
  3980. * Bits 31:0
  3981. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3982. * DDR address where WIFI FW updates the Write Index
  3983. * for WDI_IPA RX ring2
  3984. * If second RX ring is completion ring, lower 4 bytes of
  3985. * DDR address where IPA uC updates the Write Index for Ring 2.
  3986. * - RX_RING2_WR_IDX_ADDR_HI
  3987. * Bits 31:0
  3988. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3989. * DDR address where WIFI FW updates the Write Index
  3990. * for WDI_IPA RX ring2
  3991. * If second RX ring is completion ring, higher 4 bytes of
  3992. * DDR address where IPA uC updates the Write Index for Ring 2.
  3993. */
  3994. #if HTT_PADDR64
  3995. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3996. #else
  3997. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3998. #endif
  3999. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4000. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4008. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4009. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4010. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4011. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4012. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4013. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4014. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4015. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4016. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4017. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4019. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4027. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4029. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4031. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4033. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4035. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4062. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4063. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4064. do { \
  4065. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4066. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4067. } while (0)
  4068. /* for systems using 32-bit format for bus addr */
  4069. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4070. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4071. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4072. do { \
  4073. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4074. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4075. } while (0)
  4076. /* for systems using 64-bit format for bus addr */
  4077. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4078. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4080. do { \
  4081. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4082. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4083. } while (0)
  4084. /* for systems using 64-bit format for bus addr */
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4086. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4090. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4091. } while (0)
  4092. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4093. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4094. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4097. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4098. } while (0)
  4099. /* for systems using 32-bit format for bus addr */
  4100. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4106. } while (0)
  4107. /* for systems using 64-bit format for bus addr */
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4114. } while (0)
  4115. /* for systems using 64-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4122. } while (0)
  4123. /* for systems using 32-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4126. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4130. } while (0)
  4131. /* for systems using 64-bit format for bus addr */
  4132. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4133. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4134. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4137. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4138. } while (0)
  4139. /* for systems using 64-bit format for bus addr */
  4140. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4142. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4146. } while (0)
  4147. /* for systems using 32-bit format for bus addr */
  4148. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4150. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4154. } while (0)
  4155. /* for systems using 64-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4158. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4162. } while (0)
  4163. /* for systems using 64-bit format for bus addr */
  4164. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4166. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4170. } while (0)
  4171. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4173. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4177. } while (0)
  4178. /* for systems using 32-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4185. } while (0)
  4186. /* for systems using 64-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4193. } while (0)
  4194. /* for systems using 64-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4201. } while (0)
  4202. /* for systems using 32-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4209. } while (0)
  4210. /* for systems using 64-bit format for bus addr */
  4211. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4212. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4216. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4217. } while (0)
  4218. /* for systems using 64-bit format for bus addr */
  4219. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4221. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4225. } while (0)
  4226. /* for systems using 32-bit format for bus addr */
  4227. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4229. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4233. } while (0)
  4234. /* for systems using 64-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4237. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4241. } while (0)
  4242. /* for systems using 64-bit format for bus addr */
  4243. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4244. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4245. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4249. } while (0)
  4250. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4252. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4256. } while (0)
  4257. /* for systems using 32-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4264. } while (0)
  4265. /* for systems using 64-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4272. } while (0)
  4273. /* for systems using 64-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4280. } while (0)
  4281. /* for systems using 32-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4288. } while (0)
  4289. /* for systems using 64-bit format for bus addr */
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4291. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4295. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4296. } while (0)
  4297. /* for systems using 64-bit format for bus addr */
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4299. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4303. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4304. } while (0)
  4305. /*
  4306. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4307. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4308. * addresses are stored in a XXX-bit field.
  4309. * This macro is used to define both htt_wdi_ipa_config32_t and
  4310. * htt_wdi_ipa_config64_t structs.
  4311. */
  4312. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4313. _paddr__tx_comp_ring_base_addr_, \
  4314. _paddr__tx_comp_wr_idx_addr_, \
  4315. _paddr__tx_ce_wr_idx_addr_, \
  4316. _paddr__rx_ind_ring_base_addr_, \
  4317. _paddr__rx_ind_rd_idx_addr_, \
  4318. _paddr__rx_ind_wr_idx_addr_, \
  4319. _paddr__rx_ring2_base_addr_,\
  4320. _paddr__rx_ring2_rd_idx_addr_,\
  4321. _paddr__rx_ring2_wr_idx_addr_) \
  4322. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4323. { \
  4324. /* DWORD 0: flags and meta-data */ \
  4325. A_UINT32 \
  4326. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4327. reserved: 8, \
  4328. tx_pkt_pool_size: 16;\
  4329. /* DWORD 1 */\
  4330. _paddr__tx_comp_ring_base_addr_;\
  4331. /* DWORD 2 (or 3)*/\
  4332. A_UINT32 tx_comp_ring_size;\
  4333. /* DWORD 3 (or 4)*/\
  4334. _paddr__tx_comp_wr_idx_addr_;\
  4335. /* DWORD 4 (or 6)*/\
  4336. _paddr__tx_ce_wr_idx_addr_;\
  4337. /* DWORD 5 (or 8)*/\
  4338. _paddr__rx_ind_ring_base_addr_;\
  4339. /* DWORD 6 (or 10)*/\
  4340. A_UINT32 rx_ind_ring_size;\
  4341. /* DWORD 7 (or 11)*/\
  4342. _paddr__rx_ind_rd_idx_addr_;\
  4343. /* DWORD 8 (or 13)*/\
  4344. _paddr__rx_ind_wr_idx_addr_;\
  4345. /* DWORD 9 (or 15)*/\
  4346. _paddr__rx_ring2_base_addr_;\
  4347. /* DWORD 10 (or 17) */\
  4348. A_UINT32 rx_ring2_size;\
  4349. /* DWORD 11 (or 18) */\
  4350. _paddr__rx_ring2_rd_idx_addr_;\
  4351. /* DWORD 12 (or 20) */\
  4352. _paddr__rx_ring2_wr_idx_addr_;\
  4353. } POSTPACK
  4354. /* define a htt_wdi_ipa_config32_t type */
  4355. 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));
  4356. /* define a htt_wdi_ipa_config64_t type */
  4357. 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));
  4358. #if HTT_PADDR64
  4359. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4360. #else
  4361. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4362. #endif
  4363. enum htt_wdi_ipa_op_code {
  4364. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4365. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4366. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4367. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4368. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4369. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4370. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4371. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4372. /* keep this last */
  4373. HTT_WDI_IPA_OPCODE_MAX
  4374. };
  4375. /**
  4376. * @brief HTT WDI_IPA Operation Request Message
  4377. *
  4378. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4379. *
  4380. * @details
  4381. * HTT WDI_IPA Operation Request message is sent by host
  4382. * to either suspend or resume WDI_IPA TX or RX path.
  4383. * |31 24|23 16|15 8|7 0|
  4384. * |----------------+----------------+----------------+----------------|
  4385. * | op_code | Rsvd | msg_type |
  4386. * |-------------------------------------------------------------------|
  4387. *
  4388. * Header fields:
  4389. * - MSG_TYPE
  4390. * Bits 7:0
  4391. * Purpose: Identifies this as WDI_IPA Operation Request message
  4392. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4393. * - OP_CODE
  4394. * Bits 31:16
  4395. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4396. * value: = enum htt_wdi_ipa_op_code
  4397. */
  4398. PREPACK struct htt_wdi_ipa_op_request_t
  4399. {
  4400. /* DWORD 0: flags and meta-data */
  4401. A_UINT32
  4402. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4403. reserved: 8,
  4404. op_code: 16;
  4405. } POSTPACK;
  4406. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4407. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4408. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4409. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4410. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4411. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4412. do { \
  4413. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4414. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4415. } while (0)
  4416. /*
  4417. * @brief host -> target HTT_MSI_SETUP message
  4418. *
  4419. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4420. *
  4421. * @details
  4422. * After target is booted up, host can send MSI setup message so that
  4423. * target sets up HW registers based on setup message.
  4424. *
  4425. * The message would appear as follows:
  4426. * |31 24|23 16|15|14 8|7 0|
  4427. * |---------------+-----------------+-----------------+-----------------|
  4428. * | reserved | msi_type | pdev_id | msg_type |
  4429. * |---------------------------------------------------------------------|
  4430. * | msi_addr_lo |
  4431. * |---------------------------------------------------------------------|
  4432. * | msi_addr_hi |
  4433. * |---------------------------------------------------------------------|
  4434. * | msi_data |
  4435. * |---------------------------------------------------------------------|
  4436. *
  4437. * The message is interpreted as follows:
  4438. * dword0 - b'0:7 - msg_type: This will be set to
  4439. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4440. * b'8:15 - pdev_id:
  4441. * 0 (for rings at SOC/UMAC level),
  4442. * 1/2/3 mac id (for rings at LMAC level)
  4443. * b'16:23 - msi_type: identify which msi registers need to be setup
  4444. * more details can be got from enum htt_msi_setup_type
  4445. * b'24:31 - reserved
  4446. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4447. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4448. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4449. */
  4450. PREPACK struct htt_msi_setup_t {
  4451. A_UINT32 msg_type: 8,
  4452. pdev_id: 8,
  4453. msi_type: 8,
  4454. reserved: 8;
  4455. A_UINT32 msi_addr_lo;
  4456. A_UINT32 msi_addr_hi;
  4457. A_UINT32 msi_data;
  4458. } POSTPACK;
  4459. enum htt_msi_setup_type {
  4460. HTT_PPDU_END_MSI_SETUP_TYPE,
  4461. /* Insert new types here*/
  4462. };
  4463. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4464. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4465. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4466. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4467. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4468. HTT_MSI_SETUP_PDEV_ID_S)
  4469. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4470. do { \
  4471. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4472. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4473. } while (0)
  4474. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4475. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4476. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4477. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4478. HTT_MSI_SETUP_MSI_TYPE_S)
  4479. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4480. do { \
  4481. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4482. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4483. } while (0)
  4484. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4485. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4486. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4487. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4488. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4489. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4490. do { \
  4491. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4492. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4493. } while (0)
  4494. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4495. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4496. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4497. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4498. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4499. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4500. do { \
  4501. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4502. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4503. } while (0)
  4504. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4505. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4506. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4507. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4508. HTT_MSI_SETUP_MSI_DATA_S)
  4509. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4510. do { \
  4511. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4512. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4513. } while (0)
  4514. /*
  4515. * @brief host -> target HTT_SRING_SETUP message
  4516. *
  4517. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4518. *
  4519. * @details
  4520. * After target is booted up, Host can send SRING setup message for
  4521. * each host facing LMAC SRING. Target setups up HW registers based
  4522. * on setup message and confirms back to Host if response_required is set.
  4523. * Host should wait for confirmation message before sending new SRING
  4524. * setup message
  4525. *
  4526. * The message would appear as follows:
  4527. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4528. * |--------------- +-----------------+-----------------+-----------------|
  4529. * | ring_type | ring_id | pdev_id | msg_type |
  4530. * |----------------------------------------------------------------------|
  4531. * | ring_base_addr_lo |
  4532. * |----------------------------------------------------------------------|
  4533. * | ring_base_addr_hi |
  4534. * |----------------------------------------------------------------------|
  4535. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4536. * |----------------------------------------------------------------------|
  4537. * | ring_head_offset32_remote_addr_lo |
  4538. * |----------------------------------------------------------------------|
  4539. * | ring_head_offset32_remote_addr_hi |
  4540. * |----------------------------------------------------------------------|
  4541. * | ring_tail_offset32_remote_addr_lo |
  4542. * |----------------------------------------------------------------------|
  4543. * | ring_tail_offset32_remote_addr_hi |
  4544. * |----------------------------------------------------------------------|
  4545. * | ring_msi_addr_lo |
  4546. * |----------------------------------------------------------------------|
  4547. * | ring_msi_addr_hi |
  4548. * |----------------------------------------------------------------------|
  4549. * | ring_msi_data |
  4550. * |----------------------------------------------------------------------|
  4551. * | intr_timer_th |IM| intr_batch_counter_th |
  4552. * |----------------------------------------------------------------------|
  4553. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4554. * |----------------------------------------------------------------------|
  4555. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4556. * |----------------------------------------------------------------------|
  4557. * Where
  4558. * IM = sw_intr_mode
  4559. * RR = response_required
  4560. * PTCF = prefetch_timer_cfg
  4561. * IP = IPA drop flag
  4562. *
  4563. * The message is interpreted as follows:
  4564. * dword0 - b'0:7 - msg_type: This will be set to
  4565. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4566. * b'8:15 - pdev_id:
  4567. * 0 (for rings at SOC/UMAC level),
  4568. * 1/2/3 mac id (for rings at LMAC level)
  4569. * b'16:23 - ring_id: identify which ring is to setup,
  4570. * more details can be got from enum htt_srng_ring_id
  4571. * b'24:31 - ring_type: identify type of host rings,
  4572. * more details can be got from enum htt_srng_ring_type
  4573. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4574. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4575. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4576. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4577. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4578. * SW_TO_HW_RING.
  4579. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4580. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4581. * Lower 32 bits of memory address of the remote variable
  4582. * storing the 4-byte word offset that identifies the head
  4583. * element within the ring.
  4584. * (The head offset variable has type A_UINT32.)
  4585. * Valid for HW_TO_SW and SW_TO_SW rings.
  4586. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4587. * Upper 32 bits of memory address of the remote variable
  4588. * storing the 4-byte word offset that identifies the head
  4589. * element within the ring.
  4590. * (The head offset variable has type A_UINT32.)
  4591. * Valid for HW_TO_SW and SW_TO_SW rings.
  4592. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4593. * Lower 32 bits of memory address of the remote variable
  4594. * storing the 4-byte word offset that identifies the tail
  4595. * element within the ring.
  4596. * (The tail offset variable has type A_UINT32.)
  4597. * Valid for HW_TO_SW and SW_TO_SW rings.
  4598. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4599. * Upper 32 bits of memory address of the remote variable
  4600. * storing the 4-byte word offset that identifies the tail
  4601. * element within the ring.
  4602. * (The tail offset variable has type A_UINT32.)
  4603. * Valid for HW_TO_SW and SW_TO_SW rings.
  4604. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4605. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4606. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4607. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4608. * dword10 - b'0:31 - ring_msi_data: MSI data
  4609. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4610. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4611. * dword11 - b'0:14 - intr_batch_counter_th:
  4612. * batch counter threshold is in units of 4-byte words.
  4613. * HW internally maintains and increments batch count.
  4614. * (see SRING spec for detail description).
  4615. * When batch count reaches threshold value, an interrupt
  4616. * is generated by HW.
  4617. * b'15 - sw_intr_mode:
  4618. * This configuration shall be static.
  4619. * Only programmed at power up.
  4620. * 0: generate pulse style sw interrupts
  4621. * 1: generate level style sw interrupts
  4622. * b'16:31 - intr_timer_th:
  4623. * The timer init value when timer is idle or is
  4624. * initialized to start downcounting.
  4625. * In 8us units (to cover a range of 0 to 524 ms)
  4626. * dword12 - b'0:15 - intr_low_threshold:
  4627. * Used only by Consumer ring to generate ring_sw_int_p.
  4628. * Ring entries low threshold water mark, that is used
  4629. * in combination with the interrupt timer as well as
  4630. * the the clearing of the level interrupt.
  4631. * b'16:18 - prefetch_timer_cfg:
  4632. * Used only by Consumer ring to set timer mode to
  4633. * support Application prefetch handling.
  4634. * The external tail offset/pointer will be updated
  4635. * at following intervals:
  4636. * 3'b000: (Prefetch feature disabled; used only for debug)
  4637. * 3'b001: 1 usec
  4638. * 3'b010: 4 usec
  4639. * 3'b011: 8 usec (default)
  4640. * 3'b100: 16 usec
  4641. * Others: Reserverd
  4642. * b'19 - response_required:
  4643. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4644. * b'20 - ipa_drop_flag:
  4645. Indicates that host will config ipa drop threshold percentage
  4646. * b'21:31 - reserved: reserved for future use
  4647. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4648. * b'8:15 - ipa drop high threshold percentage:
  4649. * b'16:31 - Reserved
  4650. */
  4651. PREPACK struct htt_sring_setup_t {
  4652. A_UINT32 msg_type: 8,
  4653. pdev_id: 8,
  4654. ring_id: 8,
  4655. ring_type: 8;
  4656. A_UINT32 ring_base_addr_lo;
  4657. A_UINT32 ring_base_addr_hi;
  4658. A_UINT32 ring_size: 16,
  4659. ring_entry_size: 8,
  4660. ring_misc_cfg_flag: 8;
  4661. A_UINT32 ring_head_offset32_remote_addr_lo;
  4662. A_UINT32 ring_head_offset32_remote_addr_hi;
  4663. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4664. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4665. A_UINT32 ring_msi_addr_lo;
  4666. A_UINT32 ring_msi_addr_hi;
  4667. A_UINT32 ring_msi_data;
  4668. A_UINT32 intr_batch_counter_th: 15,
  4669. sw_intr_mode: 1,
  4670. intr_timer_th: 16;
  4671. A_UINT32 intr_low_threshold: 16,
  4672. prefetch_timer_cfg: 3,
  4673. response_required: 1,
  4674. ipa_drop_flag: 1,
  4675. reserved1: 11;
  4676. A_UINT32 ipa_drop_low_threshold: 8,
  4677. ipa_drop_high_threshold: 8,
  4678. reserved: 16;
  4679. } POSTPACK;
  4680. enum htt_srng_ring_type {
  4681. HTT_HW_TO_SW_RING = 0,
  4682. HTT_SW_TO_HW_RING,
  4683. HTT_SW_TO_SW_RING,
  4684. /* Insert new ring types above this line */
  4685. };
  4686. enum htt_srng_ring_id {
  4687. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4688. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4689. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4690. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4691. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4692. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4693. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4694. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4695. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4696. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4697. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4698. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4699. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4700. /* Add Other SRING which can't be directly configured by host software above this line */
  4701. };
  4702. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4703. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4704. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4705. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4706. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4707. HTT_SRING_SETUP_PDEV_ID_S)
  4708. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4711. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4712. } while (0)
  4713. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4714. #define HTT_SRING_SETUP_RING_ID_S 16
  4715. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4716. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4717. HTT_SRING_SETUP_RING_ID_S)
  4718. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4721. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4722. } while (0)
  4723. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4724. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4725. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4726. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4727. HTT_SRING_SETUP_RING_TYPE_S)
  4728. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4731. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4732. } while (0)
  4733. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4734. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4735. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4736. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4737. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4738. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4741. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4742. } while (0)
  4743. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4744. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4745. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4746. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4747. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4748. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4749. do { \
  4750. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4751. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4752. } while (0)
  4753. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4754. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4755. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4756. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4757. HTT_SRING_SETUP_RING_SIZE_S)
  4758. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4761. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4762. } while (0)
  4763. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4764. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4765. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4766. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4767. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4768. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4771. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4772. } while (0)
  4773. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4774. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4775. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4776. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4777. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4778. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4781. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4782. } while (0)
  4783. /* This control bit is applicable to only Producer, which updates Ring ID field
  4784. * of each descriptor before pushing into the ring.
  4785. * 0: updates ring_id(default)
  4786. * 1: ring_id updating disabled */
  4787. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4788. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4789. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4790. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4791. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4792. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4795. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4796. } while (0)
  4797. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4798. * of each descriptor before pushing into the ring.
  4799. * 0: updates Loopcnt(default)
  4800. * 1: Loopcnt updating disabled */
  4801. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4802. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4803. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4804. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4805. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4809. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4810. } while (0)
  4811. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4812. * into security_id port of GXI/AXI. */
  4813. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4814. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4815. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4816. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4817. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4819. do { \
  4820. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4821. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4822. } while (0)
  4823. /* During MSI write operation, SRNG drives value of this register bit into
  4824. * swap bit of GXI/AXI. */
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4827. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4828. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4829. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4833. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4834. } while (0)
  4835. /* During Pointer write operation, SRNG drives value of this register bit into
  4836. * swap bit of GXI/AXI. */
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4840. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4841. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4843. do { \
  4844. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4845. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4846. } while (0)
  4847. /* During any data or TLV write operation, SRNG drives value of this register
  4848. * bit into swap bit of GXI/AXI. */
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4852. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4853. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4855. do { \
  4856. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4857. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4858. } while (0)
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4861. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4862. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4863. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4864. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4865. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4866. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4867. do { \
  4868. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4869. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4870. } while (0)
  4871. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4872. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4873. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4874. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4875. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4876. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4877. do { \
  4878. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4879. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4880. } while (0)
  4881. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4882. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4883. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4884. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4885. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4886. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4887. do { \
  4888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4889. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4890. } while (0)
  4891. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4892. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4893. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4894. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4895. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4896. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4897. do { \
  4898. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4899. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4900. } while (0)
  4901. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4902. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4903. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4904. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4905. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4906. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4909. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4910. } while (0)
  4911. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4912. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4913. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4914. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4915. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4916. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4919. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4920. } while (0)
  4921. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4922. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4923. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4924. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4925. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4926. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4927. do { \
  4928. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4929. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4930. } while (0)
  4931. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4932. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4933. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4934. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4935. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4936. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4939. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4940. } while (0)
  4941. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4942. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4943. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4944. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4945. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4946. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4949. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4950. } while (0)
  4951. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4952. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4953. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4954. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4955. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4956. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4957. do { \
  4958. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4959. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4960. } while (0)
  4961. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4962. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4963. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4964. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4965. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4966. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4969. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4970. } while (0)
  4971. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4972. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4973. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4974. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4975. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4976. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4979. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4980. } while (0)
  4981. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4982. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4983. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4984. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4985. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4986. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4987. do { \
  4988. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4989. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4990. } while (0)
  4991. /**
  4992. * @brief host -> target RX ring selection config message
  4993. *
  4994. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4995. *
  4996. * @details
  4997. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4998. * configure RXDMA rings.
  4999. * The configuration is per ring based and includes both packet subtypes
  5000. * and PPDU/MPDU TLVs.
  5001. *
  5002. * The message would appear as follows:
  5003. *
  5004. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5005. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5006. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5007. * |-------------------------------------------------------------------|
  5008. * | rsvd2 | ring_buffer_size |
  5009. * |-------------------------------------------------------------------|
  5010. * | packet_type_enable_flags_0 |
  5011. * |-------------------------------------------------------------------|
  5012. * | packet_type_enable_flags_1 |
  5013. * |-------------------------------------------------------------------|
  5014. * | packet_type_enable_flags_2 |
  5015. * |-------------------------------------------------------------------|
  5016. * | packet_type_enable_flags_3 |
  5017. * |-------------------------------------------------------------------|
  5018. * | tlv_filter_in_flags |
  5019. * |-------------------------------------------------------------------|
  5020. * | rx_header_offset | rx_packet_offset |
  5021. * |-------------------------------------------------------------------|
  5022. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5023. * |-------------------------------------------------------------------|
  5024. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5025. * |-------------------------------------------------------------------|
  5026. * | rsvd3 | rx_attention_offset |
  5027. * |-------------------------------------------------------------------|
  5028. * | rsvd4 | mo| fp| rx_drop_threshold |
  5029. * | |ndp|ndp| |
  5030. * |-------------------------------------------------------------------|
  5031. * Where:
  5032. * PS = pkt_swap
  5033. * SS = status_swap
  5034. * OV = rx_offsets_valid
  5035. * DT = drop_thresh_valid
  5036. * The message is interpreted as follows:
  5037. * dword0 - b'0:7 - msg_type: This will be set to
  5038. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5039. * b'8:15 - pdev_id:
  5040. * 0 (for rings at SOC/UMAC level),
  5041. * 1/2/3 mac id (for rings at LMAC level)
  5042. * b'16:23 - ring_id : Identify the ring to configure.
  5043. * More details can be got from enum htt_srng_ring_id
  5044. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5045. * BUF_RING_CFG_0 defs within HW .h files,
  5046. * e.g. wmac_top_reg_seq_hwioreg.h
  5047. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5048. * BUF_RING_CFG_0 defs within HW .h files,
  5049. * e.g. wmac_top_reg_seq_hwioreg.h
  5050. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5051. * configuration fields are valid
  5052. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5053. * rx_drop_threshold field is valid
  5054. * b'28 - rx_mon_global_en: Enable/Disable global register
  5055. 8 configuration in Rx monitor module.
  5056. * b'29:31 - rsvd1: reserved for future use
  5057. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5058. * in byte units.
  5059. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5060. * b'16:18 - config_length_mgmt (MGMT):
  5061. * Represents the length of mpdu bytes for mgmt pkt.
  5062. * valid values:
  5063. * 001 - 64bytes
  5064. * 010 - 128bytes
  5065. * 100 - 256bytes
  5066. * 111 - Full mpdu bytes
  5067. * b'19:21 - config_length_ctrl (CTRL):
  5068. * Represents the length of mpdu bytes for ctrl pkt.
  5069. * valid values:
  5070. * 001 - 64bytes
  5071. * 010 - 128bytes
  5072. * 100 - 256bytes
  5073. * 111 - Full mpdu bytes
  5074. * b'22:24 - config_length_data (DATA):
  5075. * Represents the length of mpdu bytes for data pkt.
  5076. * valid values:
  5077. * 001 - 64bytes
  5078. * 010 - 128bytes
  5079. * 100 - 256bytes
  5080. * 111 - Full mpdu bytes
  5081. * b'25:31 - rsvd2: Reserved for future use
  5082. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5083. * Enable MGMT packet from 0b0000 to 0b1001
  5084. * bits from low to high: FP, MD, MO - 3 bits
  5085. * FP: Filter_Pass
  5086. * MD: Monitor_Direct
  5087. * MO: Monitor_Other
  5088. * 10 mgmt subtypes * 3 bits -> 30 bits
  5089. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5090. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5091. * Enable MGMT packet from 0b1010 to 0b1111
  5092. * bits from low to high: FP, MD, MO - 3 bits
  5093. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5094. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5095. * Enable CTRL packet from 0b0000 to 0b1001
  5096. * bits from low to high: FP, MD, MO - 3 bits
  5097. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5098. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5099. * Enable CTRL packet from 0b1010 to 0b1111,
  5100. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5101. * bits from low to high: FP, MD, MO - 3 bits
  5102. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5103. * dword6 - b'0:31 - tlv_filter_in_flags:
  5104. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5105. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5106. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5107. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5108. * A value of 0 will be considered as ignore this config.
  5109. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5110. * e.g. wmac_top_reg_seq_hwioreg.h
  5111. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5112. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5113. * A value of 0 will be considered as ignore this config.
  5114. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5115. * e.g. wmac_top_reg_seq_hwioreg.h
  5116. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5117. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5118. * A value of 0 will be considered as ignore this config.
  5119. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5120. * e.g. wmac_top_reg_seq_hwioreg.h
  5121. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5122. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5123. * A value of 0 will be considered as ignore this config.
  5124. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5125. * e.g. wmac_top_reg_seq_hwioreg.h
  5126. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5127. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5128. * A value of 0 will be considered as ignore this config.
  5129. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5130. * e.g. wmac_top_reg_seq_hwioreg.h
  5131. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5132. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5133. * A value of 0 will be considered as ignore this config.
  5134. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5135. * e.g. wmac_top_reg_seq_hwioreg.h
  5136. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5137. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5138. * A value of 0 will be considered as ignore this config.
  5139. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5140. * e.g. wmac_top_reg_seq_hwioreg.h
  5141. * - b'16:31 - rsvd3 for future use
  5142. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5143. * to source rings. Consumer drops packets if the available
  5144. * words in the ring falls below the configured threshold
  5145. * value.
  5146. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5147. * by host. 1 -> subscribed
  5148. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5149. * by host. 1 -> subscribed
  5150. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5151. * subscribed by host. 1 -> subscribed
  5152. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5153. * selection for the FP PHY ERR status tlv.
  5154. * 0 - wbm2rxdma_buf_source_ring
  5155. * 1 - fw2rxdma_buf_source_ring
  5156. * 2 - sw2rxdma_buf_source_ring
  5157. * 3 - no_buffer_ring
  5158. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5159. * selection for the FP PHY ERR status tlv.
  5160. * 0 - rxdma_release_ring
  5161. * 1 - rxdma2fw_ring
  5162. * 2 - rxdma2sw_ring
  5163. * 3 - rxdma2reo_ring
  5164. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5165. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5166. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5167. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5168. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5169. * 0: MSDU level logging
  5170. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5171. * 0: MSDU level logging
  5172. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5173. * 0: MSDU level logging
  5174. * - b'23 - word_mask_compaction: enable/disable word mask for
  5175. * mpdu/msdu start/end tlvs
  5176. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5177. * manager override
  5178. * - b'25:28 - rbm_override_val: return buffer manager override value
  5179. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5180. * which have to be posted to host from phy.
  5181. * Corresponding to errors defined in
  5182. * phyrx_abort_request_reason enums 0 to 31.
  5183. * Refer to RXPCU register definition header files for the
  5184. * phyrx_abort_request_reason enum definition.
  5185. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5186. * errors which have to be posted to host from phy.
  5187. * Corresponding to errors defined in
  5188. * phyrx_abort_request_reason enums 32 to 63.
  5189. * Refer to RXPCU register definition header files for the
  5190. * phyrx_abort_request_reason enum definition.
  5191. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5192. * applicable if word mask enabled
  5193. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5194. * applicable if word mask enabled
  5195. * - b'19:31 - rsvd7
  5196. * dword15- b'0:16 - rx_msdu_end_word_mask
  5197. * - b'17:31 - rsvd5
  5198. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5199. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5200. * buffer
  5201. * 1: RX_PKT TLV logging at specified offset for the
  5202. * subsequent buffer
  5203. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5204. */
  5205. PREPACK struct htt_rx_ring_selection_cfg_t {
  5206. A_UINT32 msg_type: 8,
  5207. pdev_id: 8,
  5208. ring_id: 8,
  5209. status_swap: 1,
  5210. pkt_swap: 1,
  5211. rx_offsets_valid: 1,
  5212. drop_thresh_valid: 1,
  5213. rx_mon_global_en: 1,
  5214. rsvd1: 3;
  5215. A_UINT32 ring_buffer_size: 16,
  5216. config_length_mgmt:3,
  5217. config_length_ctrl:3,
  5218. config_length_data:3,
  5219. rsvd2: 7;
  5220. A_UINT32 packet_type_enable_flags_0;
  5221. A_UINT32 packet_type_enable_flags_1;
  5222. A_UINT32 packet_type_enable_flags_2;
  5223. A_UINT32 packet_type_enable_flags_3;
  5224. A_UINT32 tlv_filter_in_flags;
  5225. A_UINT32 rx_packet_offset: 16,
  5226. rx_header_offset: 16;
  5227. A_UINT32 rx_mpdu_end_offset: 16,
  5228. rx_mpdu_start_offset: 16;
  5229. A_UINT32 rx_msdu_end_offset: 16,
  5230. rx_msdu_start_offset: 16;
  5231. A_UINT32 rx_attn_offset: 16,
  5232. rsvd3: 16;
  5233. A_UINT32 rx_drop_threshold: 10,
  5234. fp_ndp: 1,
  5235. mo_ndp: 1,
  5236. fp_phy_err: 1,
  5237. fp_phy_err_buf_src: 2,
  5238. fp_phy_err_buf_dest: 2,
  5239. pkt_type_enable_msdu_or_mpdu_logging:3,
  5240. dma_mpdu_mgmt: 1,
  5241. dma_mpdu_ctrl: 1,
  5242. dma_mpdu_data: 1,
  5243. word_mask_compaction_enable:1,
  5244. rbm_override_enable: 1,
  5245. rbm_override_val: 4,
  5246. rsvd4: 3;
  5247. A_UINT32 phy_err_mask;
  5248. A_UINT32 phy_err_mask_cont;
  5249. A_UINT32 rx_mpdu_start_word_mask:16,
  5250. rx_mpdu_end_word_mask: 3,
  5251. rsvd7: 13;
  5252. A_UINT32 rx_msdu_end_word_mask: 17,
  5253. rsvd5: 15;
  5254. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5255. rx_pkt_tlv_offset: 15,
  5256. rsvd6: 16;
  5257. } POSTPACK;
  5258. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5259. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5260. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5261. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5262. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5263. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5264. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5265. do { \
  5266. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5267. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5268. } while (0)
  5269. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5270. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5271. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5272. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5273. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5274. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5275. do { \
  5276. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5277. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5278. } while (0)
  5279. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5280. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5281. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5282. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5283. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5284. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5285. do { \
  5286. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5287. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5288. } while (0)
  5289. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5290. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5291. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5292. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5293. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5294. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5295. do { \
  5296. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5297. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5298. } while (0)
  5299. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5300. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5301. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5302. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5303. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5304. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5305. do { \
  5306. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5307. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5308. } while (0)
  5309. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5310. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5311. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5312. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5313. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5314. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5315. do { \
  5316. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5317. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5318. } while (0)
  5319. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5320. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5321. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5322. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5323. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5324. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5325. do { \
  5326. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5327. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5328. } while (0)
  5329. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5330. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5331. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5332. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5333. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5334. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5335. do { \
  5336. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5337. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5338. } while (0)
  5339. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5340. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5341. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5342. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5343. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5344. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5345. do { \
  5346. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5347. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5348. } while (0)
  5349. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5350. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5351. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5352. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5353. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5354. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5355. do { \
  5356. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5357. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5358. } while (0)
  5359. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5360. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5361. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5362. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5363. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5364. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5365. do { \
  5366. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5367. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5368. } while (0)
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5372. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5373. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5375. do { \
  5376. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5377. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5378. } while (0)
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5382. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5383. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5385. do { \
  5386. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5387. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5388. } while (0)
  5389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5392. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5393. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5395. do { \
  5396. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5397. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5398. } while (0)
  5399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5402. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5403. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5405. do { \
  5406. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5407. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5408. } while (0)
  5409. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5410. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5411. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5412. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5413. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5414. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5417. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5418. } while (0)
  5419. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5420. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5421. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5422. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5423. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5424. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5425. do { \
  5426. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5427. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5428. } while (0)
  5429. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5430. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5431. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5432. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5433. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5434. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5437. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5438. } while (0)
  5439. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5440. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5441. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5442. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5443. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5444. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5445. do { \
  5446. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5447. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5448. } while (0)
  5449. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5450. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5451. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5452. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5453. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5455. do { \
  5456. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5457. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5458. } while (0)
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5462. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5463. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5464. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5467. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5468. } while (0)
  5469. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5470. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5471. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5472. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5473. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5477. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5478. } while (0)
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5480. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5482. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5483. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5487. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5488. } while (0)
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5490. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5492. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5493. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5494. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5495. do { \
  5496. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5497. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5498. } while (0)
  5499. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5500. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5501. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5502. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5503. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5504. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5505. do { \
  5506. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5507. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5508. } while (0)
  5509. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5510. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5511. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5512. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5513. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5514. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5517. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5518. } while (0)
  5519. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5520. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5521. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5522. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5523. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5524. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5528. } while (0)
  5529. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5530. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5531. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5532. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5533. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5534. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5538. } while (0)
  5539. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5540. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5541. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5542. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5543. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5544. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5548. } while (0)
  5549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5552. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5553. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5558. } while (0)
  5559. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5560. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5561. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5562. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5563. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5564. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5568. } while (0)
  5569. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5570. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5571. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5572. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5573. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5574. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5578. } while (0)
  5579. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5580. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5581. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5582. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5583. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5584. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5588. } while (0)
  5589. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5590. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5591. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5592. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5593. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5594. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5598. } while (0)
  5599. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5600. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5601. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5602. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5603. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5604. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5605. do { \
  5606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5608. } while (0)
  5609. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5610. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5611. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5612. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5613. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5614. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5615. do { \
  5616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5618. } while (0)
  5619. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5620. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5621. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5622. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5623. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5624. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5628. } while (0)
  5629. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5630. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5631. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5632. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5633. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5634. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5638. } while (0)
  5639. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5640. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5641. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5642. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5643. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5644. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5645. do { \
  5646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5648. } while (0)
  5649. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5650. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5651. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5652. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5653. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5654. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5655. do { \
  5656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5658. } while (0)
  5659. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5660. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5661. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5662. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5663. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5664. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5665. do { \
  5666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5668. } while (0)
  5669. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5670. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5671. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5672. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5673. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5674. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5675. do { \
  5676. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5677. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5678. } while (0)
  5679. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5680. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5681. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5682. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5683. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5684. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5687. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5688. } while (0)
  5689. /*
  5690. * Subtype based MGMT frames enable bits.
  5691. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5692. */
  5693. /* association request */
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5700. /* association response */
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5707. /* Reassociation request */
  5708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5714. /* Reassociation response */
  5715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5721. /* Probe request */
  5722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5728. /* Probe response */
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5735. /* Timing Advertisement */
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5742. /* Reserved */
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5749. /* Beacon */
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5756. /* ATIM */
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5763. /* Disassociation */
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5770. /* Authentication */
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5777. /* Deauthentication */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5784. /* Action */
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5791. /* Action No Ack */
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5798. /* Reserved */
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5805. /*
  5806. * Subtype based CTRL frames enable bits.
  5807. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5808. */
  5809. /* Reserved */
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5816. /* Reserved */
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5823. /* Reserved */
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5830. /* Reserved */
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5837. /* Reserved */
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5844. /* Reserved */
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5851. /* Reserved */
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5858. /* Control Wrapper */
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5865. /* Block Ack Request */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5872. /* Block Ack*/
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5879. /* PS-POLL */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5886. /* RTS */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5893. /* CTS */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5900. /* ACK */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5907. /* CF-END */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5914. /* CF-END + CF-ACK */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5921. /* Multicast data */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5928. /* Unicast data */
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5935. /* NULL data */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5943. do { \
  5944. HTT_CHECK_SET_VAL(httsym, value); \
  5945. (word) |= (value) << httsym##_S; \
  5946. } while (0)
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5948. (((word) & httsym##_M) >> httsym##_S)
  5949. #define htt_rx_ring_pkt_enable_subtype_set( \
  5950. word, flag, mode, type, subtype, val) \
  5951. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5952. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5953. #define htt_rx_ring_pkt_enable_subtype_get( \
  5954. word, flag, mode, type, subtype) \
  5955. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5956. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5957. /* Definition to filter in TLVs */
  5958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5963. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5964. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5965. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5966. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5967. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5968. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5969. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5970. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5971. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5972. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5973. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5974. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5975. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5976. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5977. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5978. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5979. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5980. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5981. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5982. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5983. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5984. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(httsym, enable); \
  5987. (word) |= (enable) << httsym##_S; \
  5988. } while (0)
  5989. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5990. (((word) & httsym##_M) >> httsym##_S)
  5991. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5992. HTT_RX_RING_TLV_ENABLE_SET( \
  5993. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5994. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5995. HTT_RX_RING_TLV_ENABLE_GET( \
  5996. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5997. /**
  5998. * @brief host -> target TX monitor config message
  5999. *
  6000. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6001. *
  6002. * @details
  6003. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6004. * configure RXDMA rings.
  6005. * The configuration is per ring based and includes both packet types
  6006. * and PPDU/MPDU TLVs.
  6007. *
  6008. * The message would appear as follows:
  6009. *
  6010. * |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|
  6011. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6012. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6013. * |-----------+--------+--------+-----+------------------------------------|
  6014. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6015. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6016. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6017. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6018. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6019. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6020. * |------------------------------------------------------------------------|
  6021. * | tlv_filter_mask_in0 |
  6022. * |------------------------------------------------------------------------|
  6023. * | tlv_filter_mask_in1 |
  6024. * |------------------------------------------------------------------------|
  6025. * | tlv_filter_mask_in2 |
  6026. * |------------------------------------------------------------------------|
  6027. * | tlv_filter_mask_in3 |
  6028. * |-----------------+-----------------+---------------------+--------------|
  6029. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6030. * |------------------------------------------------------------------------|
  6031. * | pcu_ppdu_setup_word_mask |
  6032. * |--------------------+--+--+--+-----+---------------------+--------------|
  6033. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6034. * |------------------------------------------------------------------------|
  6035. *
  6036. * Where:
  6037. * PS = pkt_swap
  6038. * SS = status_swap
  6039. * The message is interpreted as follows:
  6040. * dword0 - b'0:7 - msg_type: This will be set to
  6041. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6042. * b'8:15 - pdev_id:
  6043. * 0 (for rings at SOC level),
  6044. * 1/2/3 mac id (for rings at LMAC level)
  6045. * b'16:23 - ring_id : Identify the ring to configure.
  6046. * More details can be got from enum htt_srng_ring_id
  6047. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6048. * BUF_RING_CFG_0 defs within HW .h files,
  6049. * e.g. wmac_top_reg_seq_hwioreg.h
  6050. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6051. * BUF_RING_CFG_0 defs within HW .h files,
  6052. * e.g. wmac_top_reg_seq_hwioreg.h
  6053. * b'26 - tx_mon_global_en: Enable/Disable global register
  6054. * configuration in Tx monitor module.
  6055. * b'27:31 - rsvd1: reserved for future use
  6056. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6057. * in byte units.
  6058. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6059. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6060. * 64, 128, 256.
  6061. * If all 3 bits are set config length is > 256.
  6062. * if val is '0', then ignore this field.
  6063. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6064. * 64, 128, 256.
  6065. * If all 3 bits are set config length is > 256.
  6066. * if val is '0', then ignore this field.
  6067. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6068. * 64, 128, 256.
  6069. * If all 3 bits are set config length is > 256.
  6070. * If val is '0', then ignore this field.
  6071. * - b'25:31 - rsvd2: Reserved for future use
  6072. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6073. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6074. * If packet_type_enable_flags is '1' for MGMT type,
  6075. * monitor will ignore this bit and allow this TLV.
  6076. * If packet_type_enable_flags is '0' for MGMT type,
  6077. * monitor will use this bit to enable/disable logging
  6078. * of this TLV.
  6079. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6080. * If packet_type_enable_flags is '1' for CTRL type,
  6081. * monitor will ignore this bit and allow this TLV.
  6082. * If packet_type_enable_flags is '0' for CTRL type,
  6083. * monitor will use this bit to enable/disable logging
  6084. * of this TLV.
  6085. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6086. * If packet_type_enable_flags is '1' for DATA type,
  6087. * monitor will ignore this bit and allow this TLV.
  6088. * If packet_type_enable_flags is '0' for DATA type,
  6089. * monitor will use this bit to enable/disable logging
  6090. * of this TLV.
  6091. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6092. * If packet_type_enable_flags is '1' for MGMT type,
  6093. * monitor will ignore this bit and allow this TLV.
  6094. * If packet_type_enable_flags is '0' for MGMT type,
  6095. * monitor will use this bit to enable/disable logging
  6096. * of this TLV.
  6097. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6098. * If packet_type_enable_flags is '1' for CTRL type,
  6099. * monitor will ignore this bit and allow this TLV.
  6100. * If packet_type_enable_flags is '0' for CTRL type,
  6101. * monitor will use this bit to enable/disable logging
  6102. * of this TLV.
  6103. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6104. * If packet_type_enable_flags is '1' for DATA type,
  6105. * monitor will ignore this bit and allow this TLV.
  6106. * If packet_type_enable_flags is '0' for DATA type,
  6107. * monitor will use this bit to enable/disable logging
  6108. * of this TLV.
  6109. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6110. * If packet_type_enable_flags is '1' for MGMT type,
  6111. * monitor will ignore this bit and allow this TLV.
  6112. * If packet_type_enable_flags is '0' for MGMT type,
  6113. * monitor will use this bit to enable/disable logging
  6114. * of this TLV.
  6115. * If filter_in_TX_MPDU_START = 1 it is recommended
  6116. * to set this bit.
  6117. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6118. * If packet_type_enable_flags is '1' for CTRL type,
  6119. * monitor will ignore this bit and allow this TLV.
  6120. * If packet_type_enable_flags is '0' for CTRL type,
  6121. * monitor will use this bit to enable/disable logging
  6122. * of this TLV.
  6123. * If filter_in_TX_MPDU_START = 1 it is recommended
  6124. * to set this bit.
  6125. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6126. * If packet_type_enable_flags is '1' for DATA type,
  6127. * monitor will ignore this bit and allow this TLV.
  6128. * If packet_type_enable_flags is '0' for DATA type,
  6129. * monitor will use this bit to enable/disable logging
  6130. * of this TLV.
  6131. * If filter_in_TX_MPDU_START = 1 it is recommended
  6132. * to set this bit.
  6133. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6134. * If packet_type_enable_flags is '1' for MGMT type,
  6135. * monitor will ignore this bit and allow this TLV.
  6136. * If packet_type_enable_flags is '0' for MGMT type,
  6137. * monitor will use this bit to enable/disable logging
  6138. * of this TLV.
  6139. * If filter_in_TX_MSDU_START = 1 it is recommended
  6140. * to set this bit.
  6141. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6142. * If packet_type_enable_flags is '1' for CTRL type,
  6143. * monitor will ignore this bit and allow this TLV.
  6144. * If packet_type_enable_flags is '0' for CTRL type,
  6145. * monitor will use this bit to enable/disable logging
  6146. * of this TLV.
  6147. * If filter_in_TX_MSDU_START = 1 it is recommended
  6148. * to set this bit.
  6149. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6150. * If packet_type_enable_flags is '1' for DATA type,
  6151. * monitor will ignore this bit and allow this TLV.
  6152. * If packet_type_enable_flags is '0' for DATA type,
  6153. * monitor will use this bit to enable/disable logging
  6154. * of this TLV.
  6155. * If filter_in_TX_MSDU_START = 1 it is recommended
  6156. * to set this bit.
  6157. * b'15:31 - rsvd3: Reserved for future use
  6158. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6159. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6160. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6161. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6162. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6163. * - b'8:15 - tx_peer_entry_word_mask:
  6164. * - b'16:23 - tx_queue_ext_word_mask:
  6165. * - b'24:31 - tx_msdu_start_word_mask:
  6166. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6167. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6168. * - b'8:15 - rxpcu_user_setup_word_mask:
  6169. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6170. * MGMT, CTRL, DATA
  6171. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6172. * 0 -> MSDU level logging is enabled
  6173. * (valid only if bit is set in
  6174. * pkt_type_enable_msdu_or_mpdu_logging)
  6175. * 1 -> MPDU level logging is enabled
  6176. * (valid only if bit is set in
  6177. * pkt_type_enable_msdu_or_mpdu_logging)
  6178. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6179. * 0 -> MSDU level logging is enabled
  6180. * (valid only if bit is set in
  6181. * pkt_type_enable_msdu_or_mpdu_logging)
  6182. * 1 -> MPDU level logging is enabled
  6183. * (valid only if bit is set in
  6184. * pkt_type_enable_msdu_or_mpdu_logging)
  6185. * - b'21 - dma_mpdu_data(D) : For DATA
  6186. * 0 -> MSDU level logging is enabled
  6187. * (valid only if bit is set in
  6188. * pkt_type_enable_msdu_or_mpdu_logging)
  6189. * 1 -> MPDU level logging is enabled
  6190. * (valid only if bit is set in
  6191. * pkt_type_enable_msdu_or_mpdu_logging)
  6192. * - b'22:31 - rsvd4 for future use
  6193. */
  6194. PREPACK struct htt_tx_monitor_cfg_t {
  6195. A_UINT32 msg_type: 8,
  6196. pdev_id: 8,
  6197. ring_id: 8,
  6198. status_swap: 1,
  6199. pkt_swap: 1,
  6200. tx_mon_global_en: 1,
  6201. rsvd1: 5;
  6202. A_UINT32 ring_buffer_size: 16,
  6203. config_length_mgmt: 3,
  6204. config_length_ctrl: 3,
  6205. config_length_data: 3,
  6206. rsvd2: 7;
  6207. A_UINT32 pkt_type_enable_flags: 3,
  6208. filter_in_tx_mpdu_start_mgmt: 1,
  6209. filter_in_tx_mpdu_start_ctrl: 1,
  6210. filter_in_tx_mpdu_start_data: 1,
  6211. filter_in_tx_msdu_start_mgmt: 1,
  6212. filter_in_tx_msdu_start_ctrl: 1,
  6213. filter_in_tx_msdu_start_data: 1,
  6214. filter_in_tx_mpdu_end_mgmt: 1,
  6215. filter_in_tx_mpdu_end_ctrl: 1,
  6216. filter_in_tx_mpdu_end_data: 1,
  6217. filter_in_tx_msdu_end_mgmt: 1,
  6218. filter_in_tx_msdu_end_ctrl: 1,
  6219. filter_in_tx_msdu_end_data: 1,
  6220. rsvd3: 17;
  6221. A_UINT32 tlv_filter_mask_in0;
  6222. A_UINT32 tlv_filter_mask_in1;
  6223. A_UINT32 tlv_filter_mask_in2;
  6224. A_UINT32 tlv_filter_mask_in3;
  6225. A_UINT32 tx_fes_setup_word_mask: 8,
  6226. tx_peer_entry_word_mask: 8,
  6227. tx_queue_ext_word_mask: 8,
  6228. tx_msdu_start_word_mask: 8;
  6229. A_UINT32 pcu_ppdu_setup_word_mask;
  6230. A_UINT32 tx_mpdu_start_word_mask: 8,
  6231. rxpcu_user_setup_word_mask: 8,
  6232. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6233. dma_mpdu_mgmt: 1,
  6234. dma_mpdu_ctrl: 1,
  6235. dma_mpdu_data: 1,
  6236. rsvd4: 10;
  6237. } POSTPACK;
  6238. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6239. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6240. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6241. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6242. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6243. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6244. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6245. do { \
  6246. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6247. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6248. } while (0)
  6249. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6250. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6251. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6252. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6253. HTT_TX_MONITOR_CFG_RING_ID_S)
  6254. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6257. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6258. } while (0)
  6259. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6260. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6261. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6262. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6263. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6264. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6265. do { \
  6266. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6267. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6268. } while (0)
  6269. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6270. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6271. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6272. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6273. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6274. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6275. do { \
  6276. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6277. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6278. } while (0)
  6279. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6280. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6281. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6282. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6283. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6284. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6285. do { \
  6286. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6287. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6288. } while (0)
  6289. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6290. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6291. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6292. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6293. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6294. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6297. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6298. } while (0)
  6299. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6300. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6301. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6302. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6303. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6304. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6307. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6308. } while (0)
  6309. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6310. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6311. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6312. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6313. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6314. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6317. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6318. } while (0)
  6319. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6320. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6321. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6322. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6323. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6324. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6327. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6328. } while (0)
  6329. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6330. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6331. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6332. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6333. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6334. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6337. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6338. } while (0)
  6339. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6340. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6341. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6342. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6343. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6344. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6347. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6348. } while (0)
  6349. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6350. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6351. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6352. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6353. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6354. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6355. do { \
  6356. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6357. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6358. } while (0)
  6359. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6360. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6361. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6362. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6363. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6364. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6365. do { \
  6366. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6367. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6368. } while (0)
  6369. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6370. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6371. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6372. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6373. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6374. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6375. do { \
  6376. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6377. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6378. } while (0)
  6379. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6380. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6381. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6382. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6383. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6384. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6385. do { \
  6386. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6387. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6388. } while (0)
  6389. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6392. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6393. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6394. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6397. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6398. } while (0)
  6399. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6402. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6403. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6404. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6405. do { \
  6406. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6407. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6408. } while (0)
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6412. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6413. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6414. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6415. do { \
  6416. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6417. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6418. } while (0)
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6422. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6423. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6424. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6427. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6428. } while (0)
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6432. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6433. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6437. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6438. } while (0)
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6442. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6443. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6445. do { \
  6446. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6447. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6448. } while (0)
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6452. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6453. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6457. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6458. } while (0)
  6459. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6460. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6461. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6462. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6463. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6464. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6465. do { \
  6466. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6467. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6468. } while (0)
  6469. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6470. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6471. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6472. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6473. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6474. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6475. do { \
  6476. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6477. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6478. } while (0)
  6479. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6480. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6481. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6482. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6483. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6484. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6485. do { \
  6486. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6487. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6488. } while (0)
  6489. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6490. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6491. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6492. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6493. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6494. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6497. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6498. } while (0)
  6499. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6500. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6501. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6502. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6503. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6504. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6505. do { \
  6506. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6507. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6508. } while (0)
  6509. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6510. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6511. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6512. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6513. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6514. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6515. do { \
  6516. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6517. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6518. } while (0)
  6519. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6520. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6521. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6522. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6523. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6524. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6525. do { \
  6526. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6527. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6528. } while (0)
  6529. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6530. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6531. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6532. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6533. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6534. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6535. do { \
  6536. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6537. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6538. } while (0)
  6539. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6540. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6541. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6542. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6543. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6544. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6547. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6548. } while (0)
  6549. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6550. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6551. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6552. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6553. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6554. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6557. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6558. } while (0)
  6559. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6560. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6561. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6562. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6563. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6564. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6565. do { \
  6566. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6567. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6568. } while (0)
  6569. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6570. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6571. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6572. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6573. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6574. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6575. do { \
  6576. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6577. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6578. } while (0)
  6579. /*
  6580. * pkt_type_enable_flags
  6581. */
  6582. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6587. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6588. /*
  6589. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6590. */
  6591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6592. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6593. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6595. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6596. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6597. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6598. do { \
  6599. HTT_CHECK_SET_VAL(httsym, value); \
  6600. (word) |= (value) << httsym##_S; \
  6601. } while (0)
  6602. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6603. (((word) & httsym##_M) >> httsym##_S)
  6604. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6605. * type -> MGMT, CTRL, DATA*/
  6606. #define htt_tx_ring_pkt_type_set( \
  6607. word, mode, type, val) \
  6608. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6609. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6610. #define htt_tx_ring_pkt_type_get( \
  6611. word, mode, type) \
  6612. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6613. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6614. /* Definition to filter in TLVs */
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6639. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6640. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6641. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6642. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6643. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6644. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6645. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6646. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6647. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6648. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6649. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6650. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6651. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6679. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6680. do { \
  6681. HTT_CHECK_SET_VAL(httsym, enable); \
  6682. (word) |= (enable) << httsym##_S; \
  6683. } while (0)
  6684. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6685. (((word) & httsym##_M) >> httsym##_S)
  6686. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6687. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6688. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6689. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6690. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6691. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6756. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(httsym, enable); \
  6759. (word) |= (enable) << httsym##_S; \
  6760. } while (0)
  6761. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6762. (((word) & httsym##_M) >> httsym##_S)
  6763. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6764. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6765. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6766. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6767. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6768. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6833. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6834. do { \
  6835. HTT_CHECK_SET_VAL(httsym, enable); \
  6836. (word) |= (enable) << httsym##_S; \
  6837. } while (0)
  6838. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6839. (((word) & httsym##_M) >> httsym##_S)
  6840. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6841. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6842. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6843. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6844. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6845. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6890. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(httsym, enable); \
  6893. (word) |= (enable) << httsym##_S; \
  6894. } while (0)
  6895. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6896. (((word) & httsym##_M) >> httsym##_S)
  6897. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6898. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6899. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6900. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6901. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6902. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6903. /**
  6904. * @brief host --> target Receive Flow Steering configuration message definition
  6905. *
  6906. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6907. *
  6908. * host --> target Receive Flow Steering configuration message definition.
  6909. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6910. * The reason for this is we want RFS to be configured and ready before MAC
  6911. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6912. *
  6913. * |31 24|23 16|15 9|8|7 0|
  6914. * |----------------+----------------+----------------+----------------|
  6915. * | reserved |E| msg type |
  6916. * |-------------------------------------------------------------------|
  6917. * Where E = RFS enable flag
  6918. *
  6919. * The RFS_CONFIG message consists of a single 4-byte word.
  6920. *
  6921. * Header fields:
  6922. * - MSG_TYPE
  6923. * Bits 7:0
  6924. * Purpose: identifies this as a RFS config msg
  6925. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6926. * - RFS_CONFIG
  6927. * Bit 8
  6928. * Purpose: Tells target whether to enable (1) or disable (0)
  6929. * flow steering feature when sending rx indication messages to host
  6930. */
  6931. #define HTT_H2T_RFS_CONFIG_M 0x100
  6932. #define HTT_H2T_RFS_CONFIG_S 8
  6933. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6934. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6935. HTT_H2T_RFS_CONFIG_S)
  6936. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6937. do { \
  6938. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6939. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6940. } while (0)
  6941. #define HTT_RFS_CFG_REQ_BYTES 4
  6942. /**
  6943. * @brief host -> target FW extended statistics retrieve
  6944. *
  6945. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6946. *
  6947. * @details
  6948. * The following field definitions describe the format of the HTT host
  6949. * to target FW extended stats retrieve message.
  6950. * The message specifies the type of stats the host wants to retrieve.
  6951. *
  6952. * |31 24|23 16|15 8|7 0|
  6953. * |-----------------------------------------------------------|
  6954. * | reserved | stats type | pdev_mask | msg type |
  6955. * |-----------------------------------------------------------|
  6956. * | config param [0] |
  6957. * |-----------------------------------------------------------|
  6958. * | config param [1] |
  6959. * |-----------------------------------------------------------|
  6960. * | config param [2] |
  6961. * |-----------------------------------------------------------|
  6962. * | config param [3] |
  6963. * |-----------------------------------------------------------|
  6964. * | reserved |
  6965. * |-----------------------------------------------------------|
  6966. * | cookie LSBs |
  6967. * |-----------------------------------------------------------|
  6968. * | cookie MSBs |
  6969. * |-----------------------------------------------------------|
  6970. * Header fields:
  6971. * - MSG_TYPE
  6972. * Bits 7:0
  6973. * Purpose: identifies this is a extended stats upload request message
  6974. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6975. * - PDEV_MASK
  6976. * Bits 8:15
  6977. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6978. * Value: This is a overloaded field, refer to usage and interpretation of
  6979. * PDEV in interface document.
  6980. * Bit 8 : Reserved for SOC stats
  6981. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6982. * Indicates MACID_MASK in DBS
  6983. * - STATS_TYPE
  6984. * Bits 23:16
  6985. * Purpose: identifies which FW statistics to upload
  6986. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6987. * - Reserved
  6988. * Bits 31:24
  6989. * - CONFIG_PARAM [0]
  6990. * Bits 31:0
  6991. * Purpose: give an opaque configuration value to the specified stats type
  6992. * Value: stats-type specific configuration value
  6993. * Refer to htt_stats.h for interpretation for each stats sub_type
  6994. * - CONFIG_PARAM [1]
  6995. * Bits 31:0
  6996. * Purpose: give an opaque configuration value to the specified stats type
  6997. * Value: stats-type specific configuration value
  6998. * Refer to htt_stats.h for interpretation for each stats sub_type
  6999. * - CONFIG_PARAM [2]
  7000. * Bits 31:0
  7001. * Purpose: give an opaque configuration value to the specified stats type
  7002. * Value: stats-type specific configuration value
  7003. * Refer to htt_stats.h for interpretation for each stats sub_type
  7004. * - CONFIG_PARAM [3]
  7005. * Bits 31:0
  7006. * Purpose: give an opaque configuration value to the specified stats type
  7007. * Value: stats-type specific configuration value
  7008. * Refer to htt_stats.h for interpretation for each stats sub_type
  7009. * - Reserved [31:0] for future use.
  7010. * - COOKIE_LSBS
  7011. * Bits 31:0
  7012. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7013. * message with its preceding host->target stats request message.
  7014. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7015. * - COOKIE_MSBS
  7016. * Bits 31:0
  7017. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7018. * message with its preceding host->target stats request message.
  7019. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7020. */
  7021. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7022. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7023. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7024. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7025. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7026. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7027. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7028. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7029. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7030. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7031. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7032. do { \
  7033. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7034. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7035. } while (0)
  7036. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7037. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7038. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7039. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7040. do { \
  7041. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7042. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7043. } while (0)
  7044. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7045. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7046. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7047. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7048. do { \
  7049. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7050. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7051. } while (0)
  7052. /**
  7053. * @brief host -> target FW PPDU_STATS request message
  7054. *
  7055. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7056. *
  7057. * @details
  7058. * The following field definitions describe the format of the HTT host
  7059. * to target FW for PPDU_STATS_CFG msg.
  7060. * The message allows the host to configure the PPDU_STATS_IND messages
  7061. * produced by the target.
  7062. *
  7063. * |31 24|23 16|15 8|7 0|
  7064. * |-----------------------------------------------------------|
  7065. * | REQ bit mask | pdev_mask | msg type |
  7066. * |-----------------------------------------------------------|
  7067. * Header fields:
  7068. * - MSG_TYPE
  7069. * Bits 7:0
  7070. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7071. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7072. * - PDEV_MASK
  7073. * Bits 8:15
  7074. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7075. * Value: This is a overloaded field, refer to usage and interpretation of
  7076. * PDEV in interface document.
  7077. * Bit 8 : Reserved for SOC stats
  7078. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7079. * Indicates MACID_MASK in DBS
  7080. * - REQ_TLV_BIT_MASK
  7081. * Bits 16:31
  7082. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7083. * needs to be included in the target's PPDU_STATS_IND messages.
  7084. * Value: refer htt_ppdu_stats_tlv_tag_t
  7085. *
  7086. */
  7087. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7088. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7089. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7090. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7091. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7092. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7093. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7094. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7095. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7096. do { \
  7097. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7098. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7099. } while (0)
  7100. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7101. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7102. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7103. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7104. do { \
  7105. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7106. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7107. } while (0)
  7108. /**
  7109. * @brief Host-->target HTT RX FSE setup message
  7110. *
  7111. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7112. *
  7113. * @details
  7114. * Through this message, the host will provide details of the flow tables
  7115. * in host DDR along with hash keys.
  7116. * This message can be sent per SOC or per PDEV, which is differentiated
  7117. * by pdev id values.
  7118. * The host will allocate flow search table and sends table size,
  7119. * physical DMA address of flow table, and hash keys to firmware to
  7120. * program into the RXOLE FSE HW block.
  7121. *
  7122. * The following field definitions describe the format of the RX FSE setup
  7123. * message sent from the host to target
  7124. *
  7125. * Header fields:
  7126. * dword0 - b'7:0 - msg_type: This will be set to
  7127. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7128. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7129. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7130. * pdev's LMAC ring.
  7131. * b'31:16 - reserved : Reserved for future use
  7132. * dword1 - b'19:0 - number of records: This field indicates the number of
  7133. * entries in the flow table. For example: 8k number of
  7134. * records is equivalent to
  7135. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7136. * b'27:20 - max search: This field specifies the skid length to FSE
  7137. * parser HW module whenever match is not found at the
  7138. * exact index pointed by hash.
  7139. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7140. * Refer htt_ip_da_sa_prefix below for more details.
  7141. * b'31:30 - reserved: Reserved for future use
  7142. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7143. * table allocated by host in DDR
  7144. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7145. * table allocated by host in DDR
  7146. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7147. * entry hashing
  7148. *
  7149. *
  7150. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7151. * |---------------------------------------------------------------|
  7152. * | reserved | pdev_id | MSG_TYPE |
  7153. * |---------------------------------------------------------------|
  7154. * |resvd|IPDSA| max_search | Number of records |
  7155. * |---------------------------------------------------------------|
  7156. * | base address lo |
  7157. * |---------------------------------------------------------------|
  7158. * | base address high |
  7159. * |---------------------------------------------------------------|
  7160. * | toeplitz key 31_0 |
  7161. * |---------------------------------------------------------------|
  7162. * | toeplitz key 63_32 |
  7163. * |---------------------------------------------------------------|
  7164. * | toeplitz key 95_64 |
  7165. * |---------------------------------------------------------------|
  7166. * | toeplitz key 127_96 |
  7167. * |---------------------------------------------------------------|
  7168. * | toeplitz key 159_128 |
  7169. * |---------------------------------------------------------------|
  7170. * | toeplitz key 191_160 |
  7171. * |---------------------------------------------------------------|
  7172. * | toeplitz key 223_192 |
  7173. * |---------------------------------------------------------------|
  7174. * | toeplitz key 255_224 |
  7175. * |---------------------------------------------------------------|
  7176. * | toeplitz key 287_256 |
  7177. * |---------------------------------------------------------------|
  7178. * | reserved | toeplitz key 314_288(26:0 bits) |
  7179. * |---------------------------------------------------------------|
  7180. * where:
  7181. * IPDSA = ip_da_sa
  7182. */
  7183. /**
  7184. * @brief: htt_ip_da_sa_prefix
  7185. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7186. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7187. * documentation per RFC3849
  7188. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7189. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7190. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7191. */
  7192. enum htt_ip_da_sa_prefix {
  7193. HTT_RX_IPV6_20010db8,
  7194. HTT_RX_IPV4_MAPPED_IPV6,
  7195. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7196. HTT_RX_IPV6_64FF9B,
  7197. };
  7198. /**
  7199. * @brief Host-->target HTT RX FISA configure and enable
  7200. *
  7201. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7202. *
  7203. * @details
  7204. * The host will send this command down to configure and enable the FISA
  7205. * operational params.
  7206. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7207. * register.
  7208. * Should configure both the MACs.
  7209. *
  7210. * dword0 - b'7:0 - msg_type:
  7211. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7212. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7213. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7214. * pdev's LMAC ring.
  7215. * b'31:16 - reserved : Reserved for future use
  7216. *
  7217. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7218. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7219. * packets. 1 flow search will be skipped
  7220. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7221. * tcp,udp packets
  7222. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7223. * calculation
  7224. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7225. * calculation
  7226. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7227. * calculation
  7228. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7229. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7230. * length
  7231. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7232. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7233. * length
  7234. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7235. * num jump
  7236. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7237. * num jump
  7238. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7239. * data type switch has happend for MPDU Sequence num jump
  7240. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7241. * for MPDU Sequence num jump
  7242. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7243. * for decrypt errors
  7244. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7245. * while aggregating a msdu
  7246. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7247. * The aggregation is done until (number of MSDUs aggregated
  7248. * < LIMIT + 1)
  7249. * b'31:18 - Reserved
  7250. *
  7251. * fisa_control_value - 32bit value FW can write to register
  7252. *
  7253. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7254. * Threshold value for FISA timeout (units are microseconds).
  7255. * When the global timestamp exceeds this threshold, FISA
  7256. * aggregation will be restarted.
  7257. * A value of 0 means timeout is disabled.
  7258. * Compare the threshold register with timestamp field in
  7259. * flow entry to generate timeout for the flow.
  7260. *
  7261. * |31 18 |17 16|15 8|7 0|
  7262. * |-------------------------------------------------------------|
  7263. * | reserved | pdev_mask | msg type |
  7264. * |-------------------------------------------------------------|
  7265. * | reserved | FISA_CTRL |
  7266. * |-------------------------------------------------------------|
  7267. * | FISA_TIMEOUT_THRESH |
  7268. * |-------------------------------------------------------------|
  7269. */
  7270. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7271. A_UINT32 msg_type:8,
  7272. pdev_id:8,
  7273. reserved0:16;
  7274. /**
  7275. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7276. * [17:0]
  7277. */
  7278. union {
  7279. /*
  7280. * fisa_control_bits structure is deprecated.
  7281. * Please use fisa_control_bits_v2 going forward.
  7282. */
  7283. struct {
  7284. A_UINT32 fisa_enable: 1,
  7285. ipsec_skip_search: 1,
  7286. nontcp_skip_search: 1,
  7287. add_ipv4_fixed_hdr_len: 1,
  7288. add_ipv6_fixed_hdr_len: 1,
  7289. add_tcp_fixed_hdr_len: 1,
  7290. add_udp_hdr_len: 1,
  7291. chksum_cum_ip_len_en: 1,
  7292. disable_tid_check: 1,
  7293. disable_ta_check: 1,
  7294. disable_qos_check: 1,
  7295. disable_raw_check: 1,
  7296. disable_decrypt_err_check: 1,
  7297. disable_msdu_drop_check: 1,
  7298. fisa_aggr_limit: 4,
  7299. reserved: 14;
  7300. } fisa_control_bits;
  7301. struct {
  7302. A_UINT32 fisa_enable: 1,
  7303. fisa_aggr_limit: 4,
  7304. reserved: 27;
  7305. } fisa_control_bits_v2;
  7306. A_UINT32 fisa_control_value;
  7307. } u_fisa_control;
  7308. /**
  7309. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7310. * timeout threshold for aggregation. Unit in usec.
  7311. * [31:0]
  7312. */
  7313. A_UINT32 fisa_timeout_threshold;
  7314. } POSTPACK;
  7315. /* DWord 0: pdev-ID */
  7316. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7317. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7318. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7319. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7320. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7321. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7322. do { \
  7323. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7324. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7325. } while (0)
  7326. /* Dword 1: fisa_control_value fisa config */
  7327. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7328. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7329. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7330. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7331. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7332. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7333. do { \
  7334. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7335. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7336. } while (0)
  7337. /* Dword 1: fisa_control_value ipsec_skip_search */
  7338. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7339. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7340. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7341. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7342. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7343. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7346. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7347. } while (0)
  7348. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7349. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7350. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7351. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7352. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7353. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7354. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7357. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7358. } while (0)
  7359. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7360. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7361. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7362. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7363. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7364. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7365. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7368. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7369. } while (0)
  7370. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7371. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7372. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7373. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7374. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7375. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7376. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7377. do { \
  7378. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7379. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7380. } while (0)
  7381. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7382. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7383. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7384. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7385. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7386. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7387. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7388. do { \
  7389. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7390. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7391. } while (0)
  7392. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7393. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7394. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7395. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7396. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7397. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7398. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7399. do { \
  7400. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7401. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7402. } while (0)
  7403. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7404. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7405. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7406. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7407. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7408. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7409. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7410. do { \
  7411. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7412. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7413. } while (0)
  7414. /* Dword 1: fisa_control_value disable_tid_check */
  7415. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7416. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7417. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7418. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7419. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7420. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7421. do { \
  7422. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7423. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7424. } while (0)
  7425. /* Dword 1: fisa_control_value disable_ta_check */
  7426. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7427. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7428. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7429. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7430. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7431. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7432. do { \
  7433. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7434. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7435. } while (0)
  7436. /* Dword 1: fisa_control_value disable_qos_check */
  7437. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7438. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7439. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7440. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7441. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7442. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7443. do { \
  7444. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7445. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7446. } while (0)
  7447. /* Dword 1: fisa_control_value disable_raw_check */
  7448. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7449. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7450. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7451. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7452. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7453. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7454. do { \
  7455. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7456. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7457. } while (0)
  7458. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7459. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7460. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7461. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7462. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7463. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7464. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7465. do { \
  7466. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7467. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7468. } while (0)
  7469. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7470. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7471. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7472. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7473. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7474. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7475. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7476. do { \
  7477. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7478. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7479. } while (0)
  7480. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7481. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7482. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7483. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7484. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7485. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7486. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7487. do { \
  7488. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7489. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7490. } while (0)
  7491. /* Dword 1: fisa_control_value fisa config */
  7492. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7493. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7494. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7495. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7496. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7497. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7498. do { \
  7499. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7500. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7501. } while (0)
  7502. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7503. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7504. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7505. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7506. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7507. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7508. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7509. do { \
  7510. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7511. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7512. } while (0)
  7513. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7514. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7515. pdev_id:8,
  7516. reserved0:16;
  7517. A_UINT32 num_records:20,
  7518. max_search:8,
  7519. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7520. reserved1:2;
  7521. A_UINT32 base_addr_lo;
  7522. A_UINT32 base_addr_hi;
  7523. A_UINT32 toeplitz31_0;
  7524. A_UINT32 toeplitz63_32;
  7525. A_UINT32 toeplitz95_64;
  7526. A_UINT32 toeplitz127_96;
  7527. A_UINT32 toeplitz159_128;
  7528. A_UINT32 toeplitz191_160;
  7529. A_UINT32 toeplitz223_192;
  7530. A_UINT32 toeplitz255_224;
  7531. A_UINT32 toeplitz287_256;
  7532. A_UINT32 toeplitz314_288:27,
  7533. reserved2:5;
  7534. } POSTPACK;
  7535. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7536. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7537. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7538. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7539. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7540. /* DWORD 0: Pdev ID */
  7541. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7542. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7543. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7544. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7545. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7546. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7547. do { \
  7548. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7549. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7550. } while (0)
  7551. /* DWORD 1:num of records */
  7552. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7553. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7554. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7555. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7556. HTT_RX_FSE_SETUP_NUM_REC_S)
  7557. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7558. do { \
  7559. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7560. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7561. } while (0)
  7562. /* DWORD 1:max_search */
  7563. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7564. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7565. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7566. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7567. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7568. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7569. do { \
  7570. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7571. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7572. } while (0)
  7573. /* DWORD 1:ip_da_sa prefix */
  7574. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7575. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7576. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7577. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7578. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7579. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7580. do { \
  7581. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7582. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7583. } while (0)
  7584. /* DWORD 2: Base Address LO */
  7585. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7586. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7587. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7588. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7589. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7590. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7591. do { \
  7592. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7593. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7594. } while (0)
  7595. /* DWORD 3: Base Address High */
  7596. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7597. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7598. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7599. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7600. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7601. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7602. do { \
  7603. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7604. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7605. } while (0)
  7606. /* DWORD 4-12: Hash Value */
  7607. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7608. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7609. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7610. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7611. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7612. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7613. do { \
  7614. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7615. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7616. } while (0)
  7617. /* DWORD 13: Hash Value 314:288 bits */
  7618. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7619. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7620. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7621. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7622. do { \
  7623. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7624. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7625. } while (0)
  7626. /**
  7627. * @brief Host-->target HTT RX FSE operation message
  7628. *
  7629. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7630. *
  7631. * @details
  7632. * The host will send this Flow Search Engine (FSE) operation message for
  7633. * every flow add/delete operation.
  7634. * The FSE operation includes FSE full cache invalidation or individual entry
  7635. * invalidation.
  7636. * This message can be sent per SOC or per PDEV which is differentiated
  7637. * by pdev id values.
  7638. *
  7639. * |31 16|15 8|7 1|0|
  7640. * |-------------------------------------------------------------|
  7641. * | reserved | pdev_id | MSG_TYPE |
  7642. * |-------------------------------------------------------------|
  7643. * | reserved | operation |I|
  7644. * |-------------------------------------------------------------|
  7645. * | ip_src_addr_31_0 |
  7646. * |-------------------------------------------------------------|
  7647. * | ip_src_addr_63_32 |
  7648. * |-------------------------------------------------------------|
  7649. * | ip_src_addr_95_64 |
  7650. * |-------------------------------------------------------------|
  7651. * | ip_src_addr_127_96 |
  7652. * |-------------------------------------------------------------|
  7653. * | ip_dst_addr_31_0 |
  7654. * |-------------------------------------------------------------|
  7655. * | ip_dst_addr_63_32 |
  7656. * |-------------------------------------------------------------|
  7657. * | ip_dst_addr_95_64 |
  7658. * |-------------------------------------------------------------|
  7659. * | ip_dst_addr_127_96 |
  7660. * |-------------------------------------------------------------|
  7661. * | l4_dst_port | l4_src_port |
  7662. * | (32-bit SPI incase of IPsec) |
  7663. * |-------------------------------------------------------------|
  7664. * | reserved | l4_proto |
  7665. * |-------------------------------------------------------------|
  7666. *
  7667. * where I is 1-bit ipsec_valid.
  7668. *
  7669. * The following field definitions describe the format of the RX FSE operation
  7670. * message sent from the host to target for every add/delete flow entry to flow
  7671. * table.
  7672. *
  7673. * Header fields:
  7674. * dword0 - b'7:0 - msg_type: This will be set to
  7675. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7676. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7677. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7678. * specified pdev's LMAC ring.
  7679. * b'31:16 - reserved : Reserved for future use
  7680. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7681. * (Internet Protocol Security).
  7682. * IPsec describes the framework for providing security at
  7683. * IP layer. IPsec is defined for both versions of IP:
  7684. * IPV4 and IPV6.
  7685. * Please refer to htt_rx_flow_proto enumeration below for
  7686. * more info.
  7687. * ipsec_valid = 1 for IPSEC packets
  7688. * ipsec_valid = 0 for IP Packets
  7689. * b'7:1 - operation: This indicates types of FSE operation.
  7690. * Refer to htt_rx_fse_operation enumeration:
  7691. * 0 - No Cache Invalidation required
  7692. * 1 - Cache invalidate only one entry given by IP
  7693. * src/dest address at DWORD[2:9]
  7694. * 2 - Complete FSE Cache Invalidation
  7695. * 3 - FSE Disable
  7696. * 4 - FSE Enable
  7697. * b'31:8 - reserved: Reserved for future use
  7698. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7699. * for per flow addition/deletion
  7700. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7701. * and the subsequent 3 A_UINT32 will be padding bytes.
  7702. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7703. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7704. * from 0 to 65535 but only 0 to 1023 are designated as
  7705. * well-known ports. Refer to [RFC1700] for more details.
  7706. * This field is valid only if
  7707. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7708. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7709. * range from 0 to 65535 but only 0 to 1023 are designated
  7710. * as well-known ports. Refer to [RFC1700] for more details.
  7711. * This field is valid only if
  7712. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7713. * - SPI (31:0): Security Parameters Index is an
  7714. * identification tag added to the header while using IPsec
  7715. * for tunneling the IP traffici.
  7716. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7717. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7718. * Assigned Internet Protocol Numbers.
  7719. * l4_proto numbers for standard protocol like UDP/TCP
  7720. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7721. * l4_proto = 17 for UDP etc.
  7722. * b'31:8 - reserved: Reserved for future use.
  7723. *
  7724. */
  7725. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7726. A_UINT32 msg_type:8,
  7727. pdev_id:8,
  7728. reserved0:16;
  7729. A_UINT32 ipsec_valid:1,
  7730. operation:7,
  7731. reserved1:24;
  7732. A_UINT32 ip_src_addr_31_0;
  7733. A_UINT32 ip_src_addr_63_32;
  7734. A_UINT32 ip_src_addr_95_64;
  7735. A_UINT32 ip_src_addr_127_96;
  7736. A_UINT32 ip_dest_addr_31_0;
  7737. A_UINT32 ip_dest_addr_63_32;
  7738. A_UINT32 ip_dest_addr_95_64;
  7739. A_UINT32 ip_dest_addr_127_96;
  7740. union {
  7741. A_UINT32 spi;
  7742. struct {
  7743. A_UINT32 l4_src_port:16,
  7744. l4_dest_port:16;
  7745. } ip;
  7746. } u;
  7747. A_UINT32 l4_proto:8,
  7748. reserved:24;
  7749. } POSTPACK;
  7750. /**
  7751. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7752. *
  7753. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7754. *
  7755. * @details
  7756. * The host will send this Full monitor mode register configuration message.
  7757. * This message can be sent per SOC or per PDEV which is differentiated
  7758. * by pdev id values.
  7759. *
  7760. * |31 16|15 11|10 8|7 3|2|1|0|
  7761. * |-------------------------------------------------------------|
  7762. * | reserved | pdev_id | MSG_TYPE |
  7763. * |-------------------------------------------------------------|
  7764. * | reserved |Release Ring |N|Z|E|
  7765. * |-------------------------------------------------------------|
  7766. *
  7767. * where E is 1-bit full monitor mode enable/disable.
  7768. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7769. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7770. *
  7771. * The following field definitions describe the format of the full monitor
  7772. * mode configuration message sent from the host to target for each pdev.
  7773. *
  7774. * Header fields:
  7775. * dword0 - b'7:0 - msg_type: This will be set to
  7776. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7777. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7778. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7779. * specified pdev's LMAC ring.
  7780. * b'31:16 - reserved : Reserved for future use.
  7781. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7782. * monitor mode rxdma register is to be enabled or disabled.
  7783. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7784. * additional descriptors at ppdu end for zero mpdus
  7785. * enabled or disabled.
  7786. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7787. * additional descriptors at ppdu end for non zero mpdus
  7788. * enabled or disabled.
  7789. * b'10:3 - release_ring: This indicates the destination ring
  7790. * selection for the descriptor at the end of PPDU
  7791. * 0 - REO ring select
  7792. * 1 - FW ring select
  7793. * 2 - SW ring select
  7794. * 3 - Release ring select
  7795. * Refer to htt_rx_full_mon_release_ring.
  7796. * b'31:11 - reserved for future use
  7797. */
  7798. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7799. A_UINT32 msg_type:8,
  7800. pdev_id:8,
  7801. reserved0:16;
  7802. A_UINT32 full_monitor_mode_enable:1,
  7803. addnl_descs_zero_mpdus_end:1,
  7804. addnl_descs_non_zero_mpdus_end:1,
  7805. release_ring:8,
  7806. reserved1:21;
  7807. } POSTPACK;
  7808. /**
  7809. * Enumeration for full monitor mode destination ring select
  7810. * 0 - REO destination ring select
  7811. * 1 - FW destination ring select
  7812. * 2 - SW destination ring select
  7813. * 3 - Release destination ring select
  7814. */
  7815. enum htt_rx_full_mon_release_ring {
  7816. HTT_RX_MON_RING_REO,
  7817. HTT_RX_MON_RING_FW,
  7818. HTT_RX_MON_RING_SW,
  7819. HTT_RX_MON_RING_RELEASE,
  7820. };
  7821. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7822. /* DWORD 0: Pdev ID */
  7823. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7824. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7825. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7826. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7827. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7828. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7829. do { \
  7830. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7831. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7832. } while (0)
  7833. /* DWORD 1:ENABLE */
  7834. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7835. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7836. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7837. do { \
  7838. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7839. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7840. } while (0)
  7841. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7842. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7843. /* DWORD 1:ZERO_MPDU */
  7844. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7845. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7846. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7847. do { \
  7848. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7849. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7850. } while (0)
  7851. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7852. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7853. /* DWORD 1:NON_ZERO_MPDU */
  7854. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7855. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7856. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7857. do { \
  7858. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7859. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7860. } while (0)
  7861. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7862. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7863. /* DWORD 1:RELEASE_RINGS */
  7864. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7865. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7866. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7867. do { \
  7868. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7869. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7870. } while (0)
  7871. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7872. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7873. /**
  7874. * Enumeration for IP Protocol or IPSEC Protocol
  7875. * IPsec describes the framework for providing security at IP layer.
  7876. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7877. */
  7878. enum htt_rx_flow_proto {
  7879. HTT_RX_FLOW_IP_PROTO,
  7880. HTT_RX_FLOW_IPSEC_PROTO,
  7881. };
  7882. /**
  7883. * Enumeration for FSE Cache Invalidation
  7884. * 0 - No Cache Invalidation required
  7885. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7886. * 2 - Complete FSE Cache Invalidation
  7887. * 3 - FSE Disable
  7888. * 4 - FSE Enable
  7889. */
  7890. enum htt_rx_fse_operation {
  7891. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7892. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7893. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7894. HTT_RX_FSE_DISABLE,
  7895. HTT_RX_FSE_ENABLE,
  7896. };
  7897. /* DWORD 0: Pdev ID */
  7898. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7899. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7900. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7901. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7902. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7903. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7904. do { \
  7905. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7906. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7907. } while (0)
  7908. /* DWORD 1:IP PROTO or IPSEC */
  7909. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7910. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7911. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7914. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7915. } while (0)
  7916. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7917. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7918. /* DWORD 1:FSE Operation */
  7919. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7920. #define HTT_RX_FSE_OPERATION_S 1
  7921. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7922. do { \
  7923. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7924. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7925. } while (0)
  7926. #define HTT_RX_FSE_OPERATION_GET(word) \
  7927. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7928. /* DWORD 2-9:IP Address */
  7929. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7930. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7931. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7932. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7933. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7934. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7935. do { \
  7936. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7937. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7938. } while (0)
  7939. /* DWORD 10:Source Port Number */
  7940. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7941. #define HTT_RX_FSE_SOURCEPORT_S 0
  7942. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7943. do { \
  7944. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7945. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7946. } while (0)
  7947. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7948. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7949. /* DWORD 11:Destination Port Number */
  7950. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7951. #define HTT_RX_FSE_DESTPORT_S 16
  7952. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7953. do { \
  7954. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7955. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7956. } while (0)
  7957. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7958. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7959. /* DWORD 10-11:SPI (In case of IPSEC) */
  7960. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7961. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7962. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7963. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7964. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7965. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7966. do { \
  7967. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7968. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7969. } while (0)
  7970. /* DWORD 12:L4 PROTO */
  7971. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7972. #define HTT_RX_FSE_L4_PROTO_S 0
  7973. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7974. do { \
  7975. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7976. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7977. } while (0)
  7978. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7979. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7980. /**
  7981. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7982. *
  7983. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7984. *
  7985. * |31 24|23 |15 8|7 2|1|0|
  7986. * |----------------+----------------+----------------+----------------|
  7987. * | reserved | pdev_id | msg_type |
  7988. * |---------------------------------+----------------+----------------|
  7989. * | reserved |E|F|
  7990. * |---------------------------------+----------------+----------------|
  7991. * Where E = Configure the target to provide the 3-tuple hash value in
  7992. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7993. * F = Configure the target to provide the 3-tuple hash value in
  7994. * flow_id_toeplitz field of rx_msdu_start tlv
  7995. *
  7996. * The following field definitions describe the format of the 3 tuple hash value
  7997. * message sent from the host to target as part of initialization sequence.
  7998. *
  7999. * Header fields:
  8000. * dword0 - b'7:0 - msg_type: This will be set to
  8001. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8002. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8003. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8004. * specified pdev's LMAC ring.
  8005. * b'31:16 - reserved : Reserved for future use
  8006. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8007. * b'1 - toeplitz_hash_2_or_4_field_enable
  8008. * b'31:2 - reserved : Reserved for future use
  8009. * ---------+------+----------------------------------------------------------
  8010. * bit1 | bit0 | Functionality
  8011. * ---------+------+----------------------------------------------------------
  8012. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8013. * | | in flow_id_toeplitz field
  8014. * ---------+------+----------------------------------------------------------
  8015. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8016. * | | in toeplitz_hash_2_or_4 field
  8017. * ---------+------+----------------------------------------------------------
  8018. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8019. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8020. * ---------+------+----------------------------------------------------------
  8021. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8022. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8023. * | | toeplitz_hash_2_or_4 field
  8024. *----------------------------------------------------------------------------
  8025. */
  8026. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8027. A_UINT32 msg_type :8,
  8028. pdev_id :8,
  8029. reserved0 :16;
  8030. A_UINT32 flow_id_toeplitz_field_enable :1,
  8031. toeplitz_hash_2_or_4_field_enable :1,
  8032. reserved1 :30;
  8033. } POSTPACK;
  8034. /* DWORD0 : pdev_id configuration Macros */
  8035. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8036. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8037. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8038. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8039. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8040. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8041. do { \
  8042. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8043. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8044. } while (0)
  8045. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8046. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8047. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8048. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8049. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8050. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8051. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8052. do { \
  8053. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8054. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8055. } while (0)
  8056. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8057. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8058. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8059. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8060. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8061. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8062. do { \
  8063. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8064. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8065. } while (0)
  8066. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8067. /**
  8068. * @brief host --> target Host PA Address Size
  8069. *
  8070. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8071. *
  8072. * @details
  8073. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8074. * provide the physical start address and size of each of the memory
  8075. * areas within host DDR that the target FW may need to access.
  8076. *
  8077. * For example, the host can use this message to allow the target FW
  8078. * to set up access to the host's pools of TQM link descriptors.
  8079. * The message would appear as follows:
  8080. *
  8081. * |31 24|23 16|15 8|7 0|
  8082. * |----------------+----------------+----------------+----------------|
  8083. * | reserved | num_entries | msg_type |
  8084. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8085. * | mem area 0 size |
  8086. * |----------------+----------------+----------------+----------------|
  8087. * | mem area 0 physical_address_lo |
  8088. * |----------------+----------------+----------------+----------------|
  8089. * | mem area 0 physical_address_hi |
  8090. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8091. * | mem area 1 size |
  8092. * |----------------+----------------+----------------+----------------|
  8093. * | mem area 1 physical_address_lo |
  8094. * |----------------+----------------+----------------+----------------|
  8095. * | mem area 1 physical_address_hi |
  8096. * |----------------+----------------+----------------+----------------|
  8097. * ...
  8098. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8099. * | mem area N size |
  8100. * |----------------+----------------+----------------+----------------|
  8101. * | mem area N physical_address_lo |
  8102. * |----------------+----------------+----------------+----------------|
  8103. * | mem area N physical_address_hi |
  8104. * |----------------+----------------+----------------+----------------|
  8105. *
  8106. * The message is interpreted as follows:
  8107. * dword0 - b'0:7 - msg_type: This will be set to
  8108. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8109. * b'8:15 - number_entries: Indicated the number of host memory
  8110. * areas specified within the remainder of the message
  8111. * b'16:31 - reserved.
  8112. * dword1 - b'0:31 - memory area 0 size in bytes
  8113. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8114. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8115. * and similar for memory area 1 through memory area N.
  8116. */
  8117. PREPACK struct htt_h2t_host_paddr_size {
  8118. A_UINT32 msg_type: 8,
  8119. num_entries: 8,
  8120. reserved: 16;
  8121. } POSTPACK;
  8122. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8123. A_UINT32 size;
  8124. A_UINT32 physical_address_lo;
  8125. A_UINT32 physical_address_hi;
  8126. } POSTPACK;
  8127. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8128. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8129. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8130. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8131. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8132. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8133. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8134. do { \
  8135. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8136. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8137. } while (0)
  8138. /**
  8139. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8140. *
  8141. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8142. *
  8143. * @details
  8144. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8145. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8146. *
  8147. * The message would appear as follows:
  8148. *
  8149. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8150. * |---------------------------------+---+---+----------+-+-----------|
  8151. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8152. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8153. *
  8154. *
  8155. * The message is interpreted as follows:
  8156. * dword0 - b'0:7 - msg_type: This will be set to
  8157. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8158. * b'8 - override bit to drive MSDUs to PPE ring
  8159. * b'9:13 - REO destination ring indication
  8160. * b'14 - Multi buffer msdu override enable bit
  8161. * b'15 - Intra BSS override
  8162. * b'16 - Decap raw override
  8163. * b'17 - Decap Native wifi override
  8164. * b'18 - IP frag override
  8165. * b'19:31 - reserved
  8166. */
  8167. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8168. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8169. override: 1,
  8170. reo_destination_indication: 5,
  8171. multi_buffer_msdu_override_en: 1,
  8172. intra_bss_override: 1,
  8173. decap_raw_override: 1,
  8174. decap_nwifi_override: 1,
  8175. ip_frag_override: 1,
  8176. reserved: 13;
  8177. } POSTPACK;
  8178. /* DWORD 0: Override */
  8179. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8180. #define HTT_PPE_CFG_OVERRIDE_S 8
  8181. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8182. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8183. HTT_PPE_CFG_OVERRIDE_S)
  8184. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8187. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8188. } while (0)
  8189. /* DWORD 0: REO Destination Indication*/
  8190. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8191. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8192. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8193. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8194. HTT_PPE_CFG_REO_DEST_IND_S)
  8195. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8196. do { \
  8197. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8198. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8199. } while (0)
  8200. /* DWORD 0: Multi buffer MSDU override */
  8201. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8202. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8203. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8204. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8205. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8206. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8207. do { \
  8208. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8209. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8210. } while (0)
  8211. /* DWORD 0: Intra BSS override */
  8212. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8213. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8214. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8215. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8216. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8217. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8218. do { \
  8219. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8220. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8221. } while (0)
  8222. /* DWORD 0: Decap RAW override */
  8223. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8224. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8225. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8226. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8227. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8228. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8229. do { \
  8230. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8231. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8232. } while (0)
  8233. /* DWORD 0: Decap NWIFI override */
  8234. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8235. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8236. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8237. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8238. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8239. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8242. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8243. } while (0)
  8244. /* DWORD 0: IP frag override */
  8245. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8246. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8247. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8248. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8249. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8250. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8251. do { \
  8252. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8253. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8254. } while (0)
  8255. /*
  8256. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8257. *
  8258. * @details
  8259. * The following field definitions describe the format of the HTT host
  8260. * to target FW VDEV TX RX stats retrieve message.
  8261. * The message specifies the type of stats the host wants to retrieve.
  8262. *
  8263. * |31 27|26 25|24 17|16|15 8|7 0|
  8264. * |-----------------------------------------------------------|
  8265. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8266. * |-----------------------------------------------------------|
  8267. * | vdev_id lower bitmask |
  8268. * |-----------------------------------------------------------|
  8269. * | vdev_id upper bitmask |
  8270. * |-----------------------------------------------------------|
  8271. * Header fields:
  8272. * Where:
  8273. * dword0 - b'7:0 - msg_type: This will be set to
  8274. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8275. * b'15:8 - pdev id
  8276. * b'16(E) - Enable/Disable the vdev HW stats
  8277. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8278. * b'25:26(R) - Reset stats bits
  8279. * 0: don't reset stats
  8280. * 1: reset stats once
  8281. * 2: reset stats at the start of each periodic interval
  8282. * b'27:31 - reserved for future use
  8283. * dword1 - b'0:31 - vdev_id lower bitmask
  8284. * dword2 - b'0:31 - vdev_id upper bitmask
  8285. */
  8286. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8287. A_UINT32 msg_type :8,
  8288. pdev_id :8,
  8289. enable :1,
  8290. periodic_interval :8,
  8291. reset_stats_bits :2,
  8292. reserved0 :5;
  8293. A_UINT32 vdev_id_lower_bitmask;
  8294. A_UINT32 vdev_id_upper_bitmask;
  8295. } POSTPACK;
  8296. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8297. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8298. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8299. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8300. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8301. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8302. do { \
  8303. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8304. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8305. } while (0)
  8306. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8307. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8308. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8309. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8310. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8311. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8314. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8315. } while (0)
  8316. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8317. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8318. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8319. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8320. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8321. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8322. do { \
  8323. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8324. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8325. } while (0)
  8326. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8327. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8328. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8329. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8330. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8331. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8334. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8335. } while (0)
  8336. /*
  8337. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8338. *
  8339. * @details
  8340. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8341. * the default MSDU queues for one of the TIDs within the specified peer
  8342. * to the specified service class.
  8343. * The TID is indirectly specified - each service class is associated
  8344. * with a TID. All default MSDU queues for this peer-TID will be
  8345. * linked to the service class in question.
  8346. *
  8347. * |31 16|15 8|7 0|
  8348. * |------------------------------+--------------+--------------|
  8349. * | peer ID | svc class ID | msg type |
  8350. * |------------------------------------------------------------|
  8351. * Header fields:
  8352. * dword0 - b'7:0 - msg_type: This will be set to
  8353. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8354. * b'15:8 - service class ID
  8355. * b'31:16 - peer ID
  8356. */
  8357. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8358. A_UINT32 msg_type :8,
  8359. svc_class_id :8,
  8360. peer_id :16;
  8361. } POSTPACK;
  8362. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8363. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8364. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8365. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8366. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8367. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8368. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8369. do { \
  8370. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8371. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8372. } while (0)
  8373. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8374. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8375. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8376. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8377. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8378. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8379. do { \
  8380. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8381. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8382. } while (0)
  8383. /*
  8384. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8385. *
  8386. * @details
  8387. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8388. * remove the linkage of the specified peer-TID's MSDU queues to
  8389. * service classes.
  8390. *
  8391. * |31 16|15 8|7 0|
  8392. * |------------------------------+--------------+--------------|
  8393. * | peer ID | svc class ID | msg type |
  8394. * |------------------------------------------------------------|
  8395. * Header fields:
  8396. * dword0 - b'7:0 - msg_type: This will be set to
  8397. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8398. * b'15:8 - service class ID
  8399. * b'31:16 - peer ID
  8400. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8401. * value for peer ID indicates that the target should
  8402. * apply the UNMAP_REQ to all peers.
  8403. */
  8404. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8405. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8406. A_UINT32 msg_type :8,
  8407. svc_class_id :8,
  8408. peer_id :16;
  8409. } POSTPACK;
  8410. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8411. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8412. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8413. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8414. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8415. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8416. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8417. do { \
  8418. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8419. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8420. } while (0)
  8421. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8422. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8423. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8424. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8425. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8426. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8427. do { \
  8428. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8429. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8430. } while (0)
  8431. /*
  8432. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8433. *
  8434. * @details
  8435. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8436. * request the target to report what service class the default MSDU queues
  8437. * of the specified TIDs within the peer are linked to.
  8438. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8439. * to report what service class (if any) the default MSDU queues for
  8440. * each of the specified TIDs are linked to.
  8441. *
  8442. * |31 16|15 8|7 1| 0|
  8443. * |------------------------------+--------------+--------------|
  8444. * | peer ID | TID mask | msg type |
  8445. * |------------------------------------------------------------|
  8446. * | reserved |ETO|
  8447. * |------------------------------------------------------------|
  8448. * Header fields:
  8449. * dword0 - b'7:0 - msg_type: This will be set to
  8450. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8451. * b'15:8 - TID mask
  8452. * b'31:16 - peer ID
  8453. * dword1 - b'0 - "Existing Tids Only" flag
  8454. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8455. * message generated by this REQ will only show the
  8456. * mapping for TIDs that actually exist in the target's
  8457. * peer object.
  8458. * Any TIDs that are covered by a MAP_REQ but which
  8459. * do not actually exist will be shown as being
  8460. * unmapped (i.e. svc class ID 0xff).
  8461. * If this flag is cleared, the MAP_REPORT_CONF message
  8462. * will consider not only the mapping of TIDs currently
  8463. * existing in the peer, but also the mapping that will
  8464. * be applied for any TID objects created within this
  8465. * peer in the future.
  8466. * b'31:1 - reserved for future use
  8467. */
  8468. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8469. A_UINT32 msg_type :8,
  8470. tid_mask :8,
  8471. peer_id :16;
  8472. A_UINT32 existing_tids_only:1,
  8473. reserved :31;
  8474. } POSTPACK;
  8475. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8476. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8477. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8478. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8479. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8480. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8481. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8482. do { \
  8483. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8484. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8485. } while (0)
  8486. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8487. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8488. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8489. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8490. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8491. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8492. do { \
  8493. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8494. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8495. } while (0)
  8496. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8497. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8498. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8499. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8500. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8501. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8504. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8505. } while (0)
  8506. /*=== target -> host messages ===============================================*/
  8507. enum htt_t2h_msg_type {
  8508. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8509. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8510. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8511. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8512. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8513. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8514. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8515. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8516. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8517. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8518. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8519. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8520. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8521. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8522. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8523. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8524. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8525. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8526. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8527. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8528. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8529. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8530. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8531. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8532. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8533. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8534. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8535. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8536. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8537. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8538. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8539. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8540. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8541. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8542. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8543. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8544. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8545. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8546. /* TX_OFFLOAD_DELIVER_IND:
  8547. * Forward the target's locally-generated packets to the host,
  8548. * to provide to the monitor mode interface.
  8549. */
  8550. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8551. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8552. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8553. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8554. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8555. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8556. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8557. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8558. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8559. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e,
  8560. HTT_T2H_MSG_TYPE_TEST,
  8561. /* keep this last */
  8562. HTT_T2H_NUM_MSGS
  8563. };
  8564. /*
  8565. * HTT target to host message type -
  8566. * stored in bits 7:0 of the first word of the message
  8567. */
  8568. #define HTT_T2H_MSG_TYPE_M 0xff
  8569. #define HTT_T2H_MSG_TYPE_S 0
  8570. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8571. do { \
  8572. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8573. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8574. } while (0)
  8575. #define HTT_T2H_MSG_TYPE_GET(word) \
  8576. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8577. /**
  8578. * @brief target -> host version number confirmation message definition
  8579. *
  8580. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8581. *
  8582. * |31 24|23 16|15 8|7 0|
  8583. * |----------------+----------------+----------------+----------------|
  8584. * | reserved | major number | minor number | msg type |
  8585. * |-------------------------------------------------------------------|
  8586. * : option request TLV (optional) |
  8587. * :...................................................................:
  8588. *
  8589. * The VER_CONF message may consist of a single 4-byte word, or may be
  8590. * extended with TLVs that specify HTT options selected by the target.
  8591. * The following option TLVs may be appended to the VER_CONF message:
  8592. * - LL_BUS_ADDR_SIZE
  8593. * - HL_SUPPRESS_TX_COMPL_IND
  8594. * - MAX_TX_QUEUE_GROUPS
  8595. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8596. * may be appended to the VER_CONF message (but only one TLV of each type).
  8597. *
  8598. * Header fields:
  8599. * - MSG_TYPE
  8600. * Bits 7:0
  8601. * Purpose: identifies this as a version number confirmation message
  8602. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8603. * - VER_MINOR
  8604. * Bits 15:8
  8605. * Purpose: Specify the minor number of the HTT message library version
  8606. * in use by the target firmware.
  8607. * The minor number specifies the specific revision within a range
  8608. * of fundamentally compatible HTT message definition revisions.
  8609. * Compatible revisions involve adding new messages or perhaps
  8610. * adding new fields to existing messages, in a backwards-compatible
  8611. * manner.
  8612. * Incompatible revisions involve changing the message type values,
  8613. * or redefining existing messages.
  8614. * Value: minor number
  8615. * - VER_MAJOR
  8616. * Bits 15:8
  8617. * Purpose: Specify the major number of the HTT message library version
  8618. * in use by the target firmware.
  8619. * The major number specifies the family of minor revisions that are
  8620. * fundamentally compatible with each other, but not with prior or
  8621. * later families.
  8622. * Value: major number
  8623. */
  8624. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8625. #define HTT_VER_CONF_MINOR_S 8
  8626. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8627. #define HTT_VER_CONF_MAJOR_S 16
  8628. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8631. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8632. } while (0)
  8633. #define HTT_VER_CONF_MINOR_GET(word) \
  8634. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8635. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8638. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8639. } while (0)
  8640. #define HTT_VER_CONF_MAJOR_GET(word) \
  8641. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8642. #define HTT_VER_CONF_BYTES 4
  8643. /**
  8644. * @brief - target -> host HTT Rx In order indication message
  8645. *
  8646. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8647. *
  8648. * @details
  8649. *
  8650. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8651. * |----------------+-------------------+---------------------+---------------|
  8652. * | peer ID | P| F| O| ext TID | msg type |
  8653. * |--------------------------------------------------------------------------|
  8654. * | MSDU count | Reserved | vdev id |
  8655. * |--------------------------------------------------------------------------|
  8656. * | MSDU 0 bus address (bits 31:0) |
  8657. #if HTT_PADDR64
  8658. * | MSDU 0 bus address (bits 63:32) |
  8659. #endif
  8660. * |--------------------------------------------------------------------------|
  8661. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8662. * |--------------------------------------------------------------------------|
  8663. * | MSDU 1 bus address (bits 31:0) |
  8664. #if HTT_PADDR64
  8665. * | MSDU 1 bus address (bits 63:32) |
  8666. #endif
  8667. * |--------------------------------------------------------------------------|
  8668. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8669. * |--------------------------------------------------------------------------|
  8670. */
  8671. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8672. *
  8673. * @details
  8674. * bits
  8675. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8676. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8677. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8678. * | | frag | | | | fail |chksum fail|
  8679. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8680. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8681. */
  8682. struct htt_rx_in_ord_paddr_ind_hdr_t
  8683. {
  8684. A_UINT32 /* word 0 */
  8685. msg_type: 8,
  8686. ext_tid: 5,
  8687. offload: 1,
  8688. frag: 1,
  8689. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8690. peer_id: 16;
  8691. A_UINT32 /* word 1 */
  8692. vap_id: 8,
  8693. /* NOTE:
  8694. * This reserved_1 field is not truly reserved - certain targets use
  8695. * this field internally to store debug information, and do not zero
  8696. * out the contents of the field before uploading the message to the
  8697. * host. Thus, any host-target communication supported by this field
  8698. * is limited to using values that are never used by the debug
  8699. * information stored by certain targets in the reserved_1 field.
  8700. * In particular, the targets in question don't use the value 0x3
  8701. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8702. * so this previously-unused value within these bits is available to
  8703. * use as the host / target PKT_CAPTURE_MODE flag.
  8704. */
  8705. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8706. /* if pkt_capture_mode == 0x3, host should
  8707. * send rx frames to monitor mode interface
  8708. */
  8709. msdu_cnt: 16;
  8710. };
  8711. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8712. {
  8713. A_UINT32 dma_addr;
  8714. A_UINT32
  8715. length: 16,
  8716. fw_desc: 8,
  8717. msdu_info:8;
  8718. };
  8719. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8720. {
  8721. A_UINT32 dma_addr_lo;
  8722. A_UINT32 dma_addr_hi;
  8723. A_UINT32
  8724. length: 16,
  8725. fw_desc: 8,
  8726. msdu_info:8;
  8727. };
  8728. #if HTT_PADDR64
  8729. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8730. #else
  8731. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8732. #endif
  8733. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8734. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8735. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8736. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8737. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8738. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8739. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8740. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8741. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8742. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8743. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8744. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8745. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8746. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8747. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8748. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8749. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8750. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8751. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8752. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8753. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8754. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8755. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8756. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8757. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8758. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8759. /* for systems using 64-bit format for bus addresses */
  8760. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8761. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8762. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8763. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8764. /* for systems using 32-bit format for bus addresses */
  8765. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8766. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8767. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8768. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8769. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8770. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8771. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8772. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8773. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8774. do { \
  8775. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8776. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8777. } while (0)
  8778. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8779. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8780. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8781. do { \
  8782. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8783. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8784. } while (0)
  8785. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8786. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8787. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8788. do { \
  8789. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8790. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8791. } while (0)
  8792. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8793. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8794. /*
  8795. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8796. * deliver the rx frames to the monitor mode interface.
  8797. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8798. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8799. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8800. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8801. */
  8802. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8803. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8804. do { \
  8805. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8806. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8807. } while (0)
  8808. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8809. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8810. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8811. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8812. do { \
  8813. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8814. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8815. } while (0)
  8816. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8817. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8818. /* for systems using 64-bit format for bus addresses */
  8819. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8822. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8823. } while (0)
  8824. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8825. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8826. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8829. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8830. } while (0)
  8831. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8832. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8833. /* for systems using 32-bit format for bus addresses */
  8834. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8835. do { \
  8836. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8837. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8838. } while (0)
  8839. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8840. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8841. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8842. do { \
  8843. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8844. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8845. } while (0)
  8846. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8847. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8848. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8851. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8852. } while (0)
  8853. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8854. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8855. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8856. do { \
  8857. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8858. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8859. } while (0)
  8860. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8861. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8862. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8863. do { \
  8864. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8865. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8866. } while (0)
  8867. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8868. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8869. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8870. do { \
  8871. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8872. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8873. } while (0)
  8874. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8875. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8876. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8877. do { \
  8878. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8879. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8880. } while (0)
  8881. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8882. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8883. /* definitions used within target -> host rx indication message */
  8884. PREPACK struct htt_rx_ind_hdr_prefix_t
  8885. {
  8886. A_UINT32 /* word 0 */
  8887. msg_type: 8,
  8888. ext_tid: 5,
  8889. release_valid: 1,
  8890. flush_valid: 1,
  8891. reserved0: 1,
  8892. peer_id: 16;
  8893. A_UINT32 /* word 1 */
  8894. flush_start_seq_num: 6,
  8895. flush_end_seq_num: 6,
  8896. release_start_seq_num: 6,
  8897. release_end_seq_num: 6,
  8898. num_mpdu_ranges: 8;
  8899. } POSTPACK;
  8900. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8901. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8902. #define HTT_TGT_RSSI_INVALID 0x80
  8903. PREPACK struct htt_rx_ppdu_desc_t
  8904. {
  8905. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8906. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8907. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8908. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8909. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8910. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8911. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8912. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8913. A_UINT32 /* word 0 */
  8914. rssi_cmb: 8,
  8915. timestamp_submicrosec: 8,
  8916. phy_err_code: 8,
  8917. phy_err: 1,
  8918. legacy_rate: 4,
  8919. legacy_rate_sel: 1,
  8920. end_valid: 1,
  8921. start_valid: 1;
  8922. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8923. union {
  8924. A_UINT32 /* word 1 */
  8925. rssi0_pri20: 8,
  8926. rssi0_ext20: 8,
  8927. rssi0_ext40: 8,
  8928. rssi0_ext80: 8;
  8929. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8930. } u0;
  8931. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8932. union {
  8933. A_UINT32 /* word 2 */
  8934. rssi1_pri20: 8,
  8935. rssi1_ext20: 8,
  8936. rssi1_ext40: 8,
  8937. rssi1_ext80: 8;
  8938. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8939. } u1;
  8940. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8941. union {
  8942. A_UINT32 /* word 3 */
  8943. rssi2_pri20: 8,
  8944. rssi2_ext20: 8,
  8945. rssi2_ext40: 8,
  8946. rssi2_ext80: 8;
  8947. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8948. } u2;
  8949. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8950. union {
  8951. A_UINT32 /* word 4 */
  8952. rssi3_pri20: 8,
  8953. rssi3_ext20: 8,
  8954. rssi3_ext40: 8,
  8955. rssi3_ext80: 8;
  8956. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8957. } u3;
  8958. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8959. A_UINT32 tsf32; /* word 5 */
  8960. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8961. A_UINT32 timestamp_microsec; /* word 6 */
  8962. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8963. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8964. A_UINT32 /* word 7 */
  8965. vht_sig_a1: 24,
  8966. preamble_type: 8;
  8967. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8968. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8969. A_UINT32 /* word 8 */
  8970. vht_sig_a2: 24,
  8971. /* sa_ant_matrix
  8972. * For cases where a single rx chain has options to be connected to
  8973. * different rx antennas, show which rx antennas were in use during
  8974. * receipt of a given PPDU.
  8975. * This sa_ant_matrix provides a bitmask of the antennas used while
  8976. * receiving this frame.
  8977. */
  8978. sa_ant_matrix: 8;
  8979. } POSTPACK;
  8980. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8981. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8982. PREPACK struct htt_rx_ind_hdr_suffix_t
  8983. {
  8984. A_UINT32 /* word 0 */
  8985. fw_rx_desc_bytes: 16,
  8986. reserved0: 16;
  8987. } POSTPACK;
  8988. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8989. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8990. PREPACK struct htt_rx_ind_hdr_t
  8991. {
  8992. struct htt_rx_ind_hdr_prefix_t prefix;
  8993. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8994. struct htt_rx_ind_hdr_suffix_t suffix;
  8995. } POSTPACK;
  8996. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8997. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8998. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8999. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9000. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9001. /*
  9002. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9003. * the offset into the HTT rx indication message at which the
  9004. * FW rx PPDU descriptor resides
  9005. */
  9006. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9007. /*
  9008. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9009. * the offset into the HTT rx indication message at which the
  9010. * header suffix (FW rx MSDU byte count) resides
  9011. */
  9012. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9013. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9014. /*
  9015. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9016. * the offset into the HTT rx indication message at which the per-MSDU
  9017. * information starts
  9018. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9019. * per-MSDU information portion of the message. The per-MSDU info itself
  9020. * starts at byte 12.
  9021. */
  9022. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9023. /**
  9024. * @brief target -> host rx indication message definition
  9025. *
  9026. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9027. *
  9028. * @details
  9029. * The following field definitions describe the format of the rx indication
  9030. * message sent from the target to the host.
  9031. * The message consists of three major sections:
  9032. * 1. a fixed-length header
  9033. * 2. a variable-length list of firmware rx MSDU descriptors
  9034. * 3. one or more 4-octet MPDU range information elements
  9035. * The fixed length header itself has two sub-sections
  9036. * 1. the message meta-information, including identification of the
  9037. * sender and type of the received data, and a 4-octet flush/release IE
  9038. * 2. the firmware rx PPDU descriptor
  9039. *
  9040. * The format of the message is depicted below.
  9041. * in this depiction, the following abbreviations are used for information
  9042. * elements within the message:
  9043. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9044. * elements associated with the PPDU start are valid.
  9045. * Specifically, the following fields are valid only if SV is set:
  9046. * RSSI (all variants), L, legacy rate, preamble type, service,
  9047. * VHT-SIG-A
  9048. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9049. * elements associated with the PPDU end are valid.
  9050. * Specifically, the following fields are valid only if EV is set:
  9051. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9052. * - L - Legacy rate selector - if legacy rates are used, this flag
  9053. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9054. * (L == 0) PHY.
  9055. * - P - PHY error flag - boolean indication of whether the rx frame had
  9056. * a PHY error
  9057. *
  9058. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9059. * |----------------+-------------------+---------------------+---------------|
  9060. * | peer ID | |RV|FV| ext TID | msg type |
  9061. * |--------------------------------------------------------------------------|
  9062. * | num | release | release | flush | flush |
  9063. * | MPDU | end | start | end | start |
  9064. * | ranges | seq num | seq num | seq num | seq num |
  9065. * |==========================================================================|
  9066. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9067. * |V|V| | rate | | | timestamp | RSSI |
  9068. * |--------------------------------------------------------------------------|
  9069. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9070. * |--------------------------------------------------------------------------|
  9071. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9072. * |--------------------------------------------------------------------------|
  9073. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9074. * |--------------------------------------------------------------------------|
  9075. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9076. * |--------------------------------------------------------------------------|
  9077. * | TSF LSBs |
  9078. * |--------------------------------------------------------------------------|
  9079. * | microsec timestamp |
  9080. * |--------------------------------------------------------------------------|
  9081. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9082. * |--------------------------------------------------------------------------|
  9083. * | service | HT-SIG / VHT-SIG-A2 |
  9084. * |==========================================================================|
  9085. * | reserved | FW rx desc bytes |
  9086. * |--------------------------------------------------------------------------|
  9087. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9088. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9089. * |--------------------------------------------------------------------------|
  9090. * : : :
  9091. * |--------------------------------------------------------------------------|
  9092. * | alignment | MSDU Rx |
  9093. * | padding | desc Bn |
  9094. * |--------------------------------------------------------------------------|
  9095. * | reserved | MPDU range status | MPDU count |
  9096. * |--------------------------------------------------------------------------|
  9097. * : reserved : MPDU range status : MPDU count :
  9098. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9099. *
  9100. * Header fields:
  9101. * - MSG_TYPE
  9102. * Bits 7:0
  9103. * Purpose: identifies this as an rx indication message
  9104. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9105. * - EXT_TID
  9106. * Bits 12:8
  9107. * Purpose: identify the traffic ID of the rx data, including
  9108. * special "extended" TID values for multicast, broadcast, and
  9109. * non-QoS data frames
  9110. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9111. * - FLUSH_VALID (FV)
  9112. * Bit 13
  9113. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9114. * is valid
  9115. * Value:
  9116. * 1 -> flush IE is valid and needs to be processed
  9117. * 0 -> flush IE is not valid and should be ignored
  9118. * - REL_VALID (RV)
  9119. * Bit 13
  9120. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9121. * is valid
  9122. * Value:
  9123. * 1 -> release IE is valid and needs to be processed
  9124. * 0 -> release IE is not valid and should be ignored
  9125. * - PEER_ID
  9126. * Bits 31:16
  9127. * Purpose: Identify, by ID, which peer sent the rx data
  9128. * Value: ID of the peer who sent the rx data
  9129. * - FLUSH_SEQ_NUM_START
  9130. * Bits 5:0
  9131. * Purpose: Indicate the start of a series of MPDUs to flush
  9132. * Not all MPDUs within this series are necessarily valid - the host
  9133. * must check each sequence number within this range to see if the
  9134. * corresponding MPDU is actually present.
  9135. * This field is only valid if the FV bit is set.
  9136. * Value:
  9137. * The sequence number for the first MPDUs to check to flush.
  9138. * The sequence number is masked by 0x3f.
  9139. * - FLUSH_SEQ_NUM_END
  9140. * Bits 11:6
  9141. * Purpose: Indicate the end of a series of MPDUs to flush
  9142. * Value:
  9143. * The sequence number one larger than the sequence number of the
  9144. * last MPDU to check to flush.
  9145. * The sequence number is masked by 0x3f.
  9146. * Not all MPDUs within this series are necessarily valid - the host
  9147. * must check each sequence number within this range to see if the
  9148. * corresponding MPDU is actually present.
  9149. * This field is only valid if the FV bit is set.
  9150. * - REL_SEQ_NUM_START
  9151. * Bits 17:12
  9152. * Purpose: Indicate the start of a series of MPDUs to release.
  9153. * All MPDUs within this series are present and valid - the host
  9154. * need not check each sequence number within this range to see if
  9155. * the corresponding MPDU is actually present.
  9156. * This field is only valid if the RV bit is set.
  9157. * Value:
  9158. * The sequence number for the first MPDUs to check to release.
  9159. * The sequence number is masked by 0x3f.
  9160. * - REL_SEQ_NUM_END
  9161. * Bits 23:18
  9162. * Purpose: Indicate the end of a series of MPDUs to release.
  9163. * Value:
  9164. * The sequence number one larger than the sequence number of the
  9165. * last MPDU to check to release.
  9166. * The sequence number is masked by 0x3f.
  9167. * All MPDUs within this series are present and valid - the host
  9168. * need not check each sequence number within this range to see if
  9169. * the corresponding MPDU is actually present.
  9170. * This field is only valid if the RV bit is set.
  9171. * - NUM_MPDU_RANGES
  9172. * Bits 31:24
  9173. * Purpose: Indicate how many ranges of MPDUs are present.
  9174. * Each MPDU range consists of a series of contiguous MPDUs within the
  9175. * rx frame sequence which all have the same MPDU status.
  9176. * Value: 1-63 (typically a small number, like 1-3)
  9177. *
  9178. * Rx PPDU descriptor fields:
  9179. * - RSSI_CMB
  9180. * Bits 7:0
  9181. * Purpose: Combined RSSI from all active rx chains, across the active
  9182. * bandwidth.
  9183. * Value: RSSI dB units w.r.t. noise floor
  9184. * - TIMESTAMP_SUBMICROSEC
  9185. * Bits 15:8
  9186. * Purpose: high-resolution timestamp
  9187. * Value:
  9188. * Sub-microsecond time of PPDU reception.
  9189. * This timestamp ranges from [0,MAC clock MHz).
  9190. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9191. * to form a high-resolution, large range rx timestamp.
  9192. * - PHY_ERR_CODE
  9193. * Bits 23:16
  9194. * Purpose:
  9195. * If the rx frame processing resulted in a PHY error, indicate what
  9196. * type of rx PHY error occurred.
  9197. * Value:
  9198. * This field is valid if the "P" (PHY_ERR) flag is set.
  9199. * TBD: document/specify the values for this field
  9200. * - PHY_ERR
  9201. * Bit 24
  9202. * Purpose: indicate whether the rx PPDU had a PHY error
  9203. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9204. * - LEGACY_RATE
  9205. * Bits 28:25
  9206. * Purpose:
  9207. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9208. * specify which rate was used.
  9209. * Value:
  9210. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9211. * flag.
  9212. * If LEGACY_RATE_SEL is 0:
  9213. * 0x8: OFDM 48 Mbps
  9214. * 0x9: OFDM 24 Mbps
  9215. * 0xA: OFDM 12 Mbps
  9216. * 0xB: OFDM 6 Mbps
  9217. * 0xC: OFDM 54 Mbps
  9218. * 0xD: OFDM 36 Mbps
  9219. * 0xE: OFDM 18 Mbps
  9220. * 0xF: OFDM 9 Mbps
  9221. * If LEGACY_RATE_SEL is 1:
  9222. * 0x8: CCK 11 Mbps long preamble
  9223. * 0x9: CCK 5.5 Mbps long preamble
  9224. * 0xA: CCK 2 Mbps long preamble
  9225. * 0xB: CCK 1 Mbps long preamble
  9226. * 0xC: CCK 11 Mbps short preamble
  9227. * 0xD: CCK 5.5 Mbps short preamble
  9228. * 0xE: CCK 2 Mbps short preamble
  9229. * - LEGACY_RATE_SEL
  9230. * Bit 29
  9231. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9232. * Value:
  9233. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9234. * used a legacy rate.
  9235. * 0 -> OFDM, 1 -> CCK
  9236. * - END_VALID
  9237. * Bit 30
  9238. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9239. * the start of the PPDU are valid. Specifically, the following
  9240. * fields are only valid if END_VALID is set:
  9241. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9242. * TIMESTAMP_SUBMICROSEC
  9243. * Value:
  9244. * 0 -> rx PPDU desc end fields are not valid
  9245. * 1 -> rx PPDU desc end fields are valid
  9246. * - START_VALID
  9247. * Bit 31
  9248. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9249. * the end of the PPDU are valid. Specifically, the following
  9250. * fields are only valid if START_VALID is set:
  9251. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9252. * VHT-SIG-A
  9253. * Value:
  9254. * 0 -> rx PPDU desc start fields are not valid
  9255. * 1 -> rx PPDU desc start fields are valid
  9256. * - RSSI0_PRI20
  9257. * Bits 7:0
  9258. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9259. * Value: RSSI dB units w.r.t. noise floor
  9260. *
  9261. * - RSSI0_EXT20
  9262. * Bits 7:0
  9263. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9264. * (if the rx bandwidth was >= 40 MHz)
  9265. * Value: RSSI dB units w.r.t. noise floor
  9266. * - RSSI0_EXT40
  9267. * Bits 7:0
  9268. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9269. * (if the rx bandwidth was >= 80 MHz)
  9270. * Value: RSSI dB units w.r.t. noise floor
  9271. * - RSSI0_EXT80
  9272. * Bits 7:0
  9273. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9274. * (if the rx bandwidth was >= 160 MHz)
  9275. * Value: RSSI dB units w.r.t. noise floor
  9276. *
  9277. * - RSSI1_PRI20
  9278. * Bits 7:0
  9279. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9280. * Value: RSSI dB units w.r.t. noise floor
  9281. * - RSSI1_EXT20
  9282. * Bits 7:0
  9283. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9284. * (if the rx bandwidth was >= 40 MHz)
  9285. * Value: RSSI dB units w.r.t. noise floor
  9286. * - RSSI1_EXT40
  9287. * Bits 7:0
  9288. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9289. * (if the rx bandwidth was >= 80 MHz)
  9290. * Value: RSSI dB units w.r.t. noise floor
  9291. * - RSSI1_EXT80
  9292. * Bits 7:0
  9293. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9294. * (if the rx bandwidth was >= 160 MHz)
  9295. * Value: RSSI dB units w.r.t. noise floor
  9296. *
  9297. * - RSSI2_PRI20
  9298. * Bits 7:0
  9299. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9300. * Value: RSSI dB units w.r.t. noise floor
  9301. * - RSSI2_EXT20
  9302. * Bits 7:0
  9303. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9304. * (if the rx bandwidth was >= 40 MHz)
  9305. * Value: RSSI dB units w.r.t. noise floor
  9306. * - RSSI2_EXT40
  9307. * Bits 7:0
  9308. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9309. * (if the rx bandwidth was >= 80 MHz)
  9310. * Value: RSSI dB units w.r.t. noise floor
  9311. * - RSSI2_EXT80
  9312. * Bits 7:0
  9313. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9314. * (if the rx bandwidth was >= 160 MHz)
  9315. * Value: RSSI dB units w.r.t. noise floor
  9316. *
  9317. * - RSSI3_PRI20
  9318. * Bits 7:0
  9319. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9320. * Value: RSSI dB units w.r.t. noise floor
  9321. * - RSSI3_EXT20
  9322. * Bits 7:0
  9323. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9324. * (if the rx bandwidth was >= 40 MHz)
  9325. * Value: RSSI dB units w.r.t. noise floor
  9326. * - RSSI3_EXT40
  9327. * Bits 7:0
  9328. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9329. * (if the rx bandwidth was >= 80 MHz)
  9330. * Value: RSSI dB units w.r.t. noise floor
  9331. * - RSSI3_EXT80
  9332. * Bits 7:0
  9333. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9334. * (if the rx bandwidth was >= 160 MHz)
  9335. * Value: RSSI dB units w.r.t. noise floor
  9336. *
  9337. * - TSF32
  9338. * Bits 31:0
  9339. * Purpose: specify the time the rx PPDU was received, in TSF units
  9340. * Value: 32 LSBs of the TSF
  9341. * - TIMESTAMP_MICROSEC
  9342. * Bits 31:0
  9343. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9344. * Value: PPDU rx time, in microseconds
  9345. * - VHT_SIG_A1
  9346. * Bits 23:0
  9347. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9348. * from the rx PPDU
  9349. * Value:
  9350. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9351. * VHT-SIG-A1 data.
  9352. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9353. * first 24 bits of the HT-SIG data.
  9354. * Otherwise, this field is invalid.
  9355. * Refer to the the 802.11 protocol for the definition of the
  9356. * HT-SIG and VHT-SIG-A1 fields
  9357. * - VHT_SIG_A2
  9358. * Bits 23:0
  9359. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9360. * from the rx PPDU
  9361. * Value:
  9362. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9363. * VHT-SIG-A2 data.
  9364. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9365. * last 24 bits of the HT-SIG data.
  9366. * Otherwise, this field is invalid.
  9367. * Refer to the the 802.11 protocol for the definition of the
  9368. * HT-SIG and VHT-SIG-A2 fields
  9369. * - PREAMBLE_TYPE
  9370. * Bits 31:24
  9371. * Purpose: indicate the PHY format of the received burst
  9372. * Value:
  9373. * 0x4: Legacy (OFDM/CCK)
  9374. * 0x8: HT
  9375. * 0x9: HT with TxBF
  9376. * 0xC: VHT
  9377. * 0xD: VHT with TxBF
  9378. * - SERVICE
  9379. * Bits 31:24
  9380. * Purpose: TBD
  9381. * Value: TBD
  9382. *
  9383. * Rx MSDU descriptor fields:
  9384. * - FW_RX_DESC_BYTES
  9385. * Bits 15:0
  9386. * Purpose: Indicate how many bytes in the Rx indication are used for
  9387. * FW Rx descriptors
  9388. *
  9389. * Payload fields:
  9390. * - MPDU_COUNT
  9391. * Bits 7:0
  9392. * Purpose: Indicate how many sequential MPDUs share the same status.
  9393. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9394. * - MPDU_STATUS
  9395. * Bits 15:8
  9396. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9397. * received successfully.
  9398. * Value:
  9399. * 0x1: success
  9400. * 0x2: FCS error
  9401. * 0x3: duplicate error
  9402. * 0x4: replay error
  9403. * 0x5: invalid peer
  9404. */
  9405. /* header fields */
  9406. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9407. #define HTT_RX_IND_EXT_TID_S 8
  9408. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9409. #define HTT_RX_IND_FLUSH_VALID_S 13
  9410. #define HTT_RX_IND_REL_VALID_M 0x4000
  9411. #define HTT_RX_IND_REL_VALID_S 14
  9412. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9413. #define HTT_RX_IND_PEER_ID_S 16
  9414. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9415. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9416. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9417. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9418. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9419. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9420. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9421. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9422. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9423. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9424. /* rx PPDU descriptor fields */
  9425. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9426. #define HTT_RX_IND_RSSI_CMB_S 0
  9427. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9428. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9429. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9430. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9431. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9432. #define HTT_RX_IND_PHY_ERR_S 24
  9433. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9434. #define HTT_RX_IND_LEGACY_RATE_S 25
  9435. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9436. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9437. #define HTT_RX_IND_END_VALID_M 0x40000000
  9438. #define HTT_RX_IND_END_VALID_S 30
  9439. #define HTT_RX_IND_START_VALID_M 0x80000000
  9440. #define HTT_RX_IND_START_VALID_S 31
  9441. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9442. #define HTT_RX_IND_RSSI_PRI20_S 0
  9443. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9444. #define HTT_RX_IND_RSSI_EXT20_S 8
  9445. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9446. #define HTT_RX_IND_RSSI_EXT40_S 16
  9447. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9448. #define HTT_RX_IND_RSSI_EXT80_S 24
  9449. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9450. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9451. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9452. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9453. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9454. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9455. #define HTT_RX_IND_SERVICE_M 0xff000000
  9456. #define HTT_RX_IND_SERVICE_S 24
  9457. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9458. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9459. /* rx MSDU descriptor fields */
  9460. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9461. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9462. /* payload fields */
  9463. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9464. #define HTT_RX_IND_MPDU_COUNT_S 0
  9465. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9466. #define HTT_RX_IND_MPDU_STATUS_S 8
  9467. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9470. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9471. } while (0)
  9472. #define HTT_RX_IND_EXT_TID_GET(word) \
  9473. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9474. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9475. do { \
  9476. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9477. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9478. } while (0)
  9479. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9480. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9481. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9484. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9485. } while (0)
  9486. #define HTT_RX_IND_REL_VALID_GET(word) \
  9487. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9488. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9489. do { \
  9490. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9491. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9492. } while (0)
  9493. #define HTT_RX_IND_PEER_ID_GET(word) \
  9494. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9495. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9496. do { \
  9497. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9498. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9499. } while (0)
  9500. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9501. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9502. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9503. do { \
  9504. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9505. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9506. } while (0)
  9507. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9508. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9509. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9510. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9511. do { \
  9512. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9513. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9514. } while (0)
  9515. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9516. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9517. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9518. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9519. do { \
  9520. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9521. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9522. } while (0)
  9523. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9524. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9525. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9526. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9527. do { \
  9528. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9529. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9530. } while (0)
  9531. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9532. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9533. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9534. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9537. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9538. } while (0)
  9539. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9540. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9541. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9542. /* FW rx PPDU descriptor fields */
  9543. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9544. do { \
  9545. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9546. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9547. } while (0)
  9548. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9549. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9550. HTT_RX_IND_RSSI_CMB_S)
  9551. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9552. do { \
  9553. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9554. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9555. } while (0)
  9556. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9557. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9558. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9559. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9560. do { \
  9561. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9562. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9563. } while (0)
  9564. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9565. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9566. HTT_RX_IND_PHY_ERR_CODE_S)
  9567. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9568. do { \
  9569. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9570. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9571. } while (0)
  9572. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9573. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9574. HTT_RX_IND_PHY_ERR_S)
  9575. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9576. do { \
  9577. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9578. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9579. } while (0)
  9580. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9581. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9582. HTT_RX_IND_LEGACY_RATE_S)
  9583. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9584. do { \
  9585. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9586. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9587. } while (0)
  9588. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9589. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9590. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9591. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9592. do { \
  9593. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9594. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9595. } while (0)
  9596. #define HTT_RX_IND_END_VALID_GET(word) \
  9597. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9598. HTT_RX_IND_END_VALID_S)
  9599. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9600. do { \
  9601. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9602. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9603. } while (0)
  9604. #define HTT_RX_IND_START_VALID_GET(word) \
  9605. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9606. HTT_RX_IND_START_VALID_S)
  9607. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9608. do { \
  9609. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9610. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9611. } while (0)
  9612. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9613. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9614. HTT_RX_IND_RSSI_PRI20_S)
  9615. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9616. do { \
  9617. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9618. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9619. } while (0)
  9620. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9621. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9622. HTT_RX_IND_RSSI_EXT20_S)
  9623. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9624. do { \
  9625. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9626. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9627. } while (0)
  9628. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9629. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9630. HTT_RX_IND_RSSI_EXT40_S)
  9631. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9634. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9635. } while (0)
  9636. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9637. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9638. HTT_RX_IND_RSSI_EXT80_S)
  9639. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9640. do { \
  9641. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9642. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9643. } while (0)
  9644. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9645. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9646. HTT_RX_IND_VHT_SIG_A1_S)
  9647. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9648. do { \
  9649. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9650. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9651. } while (0)
  9652. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9653. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9654. HTT_RX_IND_VHT_SIG_A2_S)
  9655. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9656. do { \
  9657. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9658. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9659. } while (0)
  9660. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9661. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9662. HTT_RX_IND_PREAMBLE_TYPE_S)
  9663. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9664. do { \
  9665. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9666. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9667. } while (0)
  9668. #define HTT_RX_IND_SERVICE_GET(word) \
  9669. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9670. HTT_RX_IND_SERVICE_S)
  9671. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9672. do { \
  9673. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9674. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9675. } while (0)
  9676. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9677. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9678. HTT_RX_IND_SA_ANT_MATRIX_S)
  9679. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9680. do { \
  9681. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9682. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9683. } while (0)
  9684. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9685. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9686. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9687. do { \
  9688. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9689. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9690. } while (0)
  9691. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9692. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9693. #define HTT_RX_IND_HL_BYTES \
  9694. (HTT_RX_IND_HDR_BYTES + \
  9695. 4 /* single FW rx MSDU descriptor */ + \
  9696. 4 /* single MPDU range information element */)
  9697. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9698. /* Could we use one macro entry? */
  9699. #define HTT_WORD_SET(word, field, value) \
  9700. do { \
  9701. HTT_CHECK_SET_VAL(field, value); \
  9702. (word) |= ((value) << field ## _S); \
  9703. } while (0)
  9704. #define HTT_WORD_GET(word, field) \
  9705. (((word) & field ## _M) >> field ## _S)
  9706. PREPACK struct hl_htt_rx_ind_base {
  9707. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9708. } POSTPACK;
  9709. /*
  9710. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9711. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9712. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9713. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9714. * htt_rx_ind_hl_rx_desc_t.
  9715. */
  9716. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9717. struct htt_rx_ind_hl_rx_desc_t {
  9718. A_UINT8 ver;
  9719. A_UINT8 len;
  9720. struct {
  9721. A_UINT8
  9722. first_msdu: 1,
  9723. last_msdu: 1,
  9724. c3_failed: 1,
  9725. c4_failed: 1,
  9726. ipv6: 1,
  9727. tcp: 1,
  9728. udp: 1,
  9729. reserved: 1;
  9730. } flags;
  9731. /* NOTE: no reserved space - don't append any new fields here */
  9732. };
  9733. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9734. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9735. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9736. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9737. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9738. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9739. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9740. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9741. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9742. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9743. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9744. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9745. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9746. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9747. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9748. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9749. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9750. /* This structure is used in HL, the basic descriptor information
  9751. * used by host. the structure is translated by FW from HW desc
  9752. * or generated by FW. But in HL monitor mode, the host would use
  9753. * the same structure with LL.
  9754. */
  9755. PREPACK struct hl_htt_rx_desc_base {
  9756. A_UINT32
  9757. seq_num:12,
  9758. encrypted:1,
  9759. chan_info_present:1,
  9760. resv0:2,
  9761. mcast_bcast:1,
  9762. fragment:1,
  9763. key_id_oct:8,
  9764. resv1:6;
  9765. A_UINT32
  9766. pn_31_0;
  9767. union {
  9768. struct {
  9769. A_UINT16 pn_47_32;
  9770. A_UINT16 pn_63_48;
  9771. } pn16;
  9772. A_UINT32 pn_63_32;
  9773. } u0;
  9774. A_UINT32
  9775. pn_95_64;
  9776. A_UINT32
  9777. pn_127_96;
  9778. } POSTPACK;
  9779. /*
  9780. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9781. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9782. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9783. * Please see htt_chan_change_t for description of the fields.
  9784. */
  9785. PREPACK struct htt_chan_info_t
  9786. {
  9787. A_UINT32 primary_chan_center_freq_mhz: 16,
  9788. contig_chan1_center_freq_mhz: 16;
  9789. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9790. phy_mode: 8,
  9791. reserved: 8;
  9792. } POSTPACK;
  9793. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9794. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9795. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9796. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9797. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9798. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9799. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9800. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9801. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9802. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9803. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9804. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9805. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9806. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9807. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9808. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9809. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9810. /* Channel information */
  9811. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9812. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9813. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9814. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9815. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9816. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9817. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9818. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9819. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9820. do { \
  9821. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9822. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9823. } while (0)
  9824. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9825. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9826. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9827. do { \
  9828. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9829. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9830. } while (0)
  9831. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9832. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9833. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9834. do { \
  9835. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9836. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9837. } while (0)
  9838. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9839. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9840. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9841. do { \
  9842. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9843. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9844. } while (0)
  9845. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9846. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9847. /*
  9848. * @brief target -> host message definition for FW offloaded pkts
  9849. *
  9850. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9851. *
  9852. * @details
  9853. * The following field definitions describe the format of the firmware
  9854. * offload deliver message sent from the target to the host.
  9855. *
  9856. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9857. *
  9858. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9859. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9860. * | reserved_1 | msg type |
  9861. * |--------------------------------------------------------------------------|
  9862. * | phy_timestamp_l32 |
  9863. * |--------------------------------------------------------------------------|
  9864. * | WORD2 (see below) |
  9865. * |--------------------------------------------------------------------------|
  9866. * | seqno | framectrl |
  9867. * |--------------------------------------------------------------------------|
  9868. * | reserved_3 | vdev_id | tid_num|
  9869. * |--------------------------------------------------------------------------|
  9870. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9871. * |--------------------------------------------------------------------------|
  9872. *
  9873. * where:
  9874. * STAT = status
  9875. * F = format (802.3 vs. 802.11)
  9876. *
  9877. * definition for word 2
  9878. *
  9879. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9880. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9881. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9882. * |--------------------------------------------------------------------------|
  9883. *
  9884. * where:
  9885. * PR = preamble
  9886. * BF = beamformed
  9887. */
  9888. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9889. {
  9890. A_UINT32 /* word 0 */
  9891. msg_type:8, /* [ 7: 0] */
  9892. reserved_1:24; /* [31: 8] */
  9893. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9894. A_UINT32 /* word 2 */
  9895. /* preamble:
  9896. * 0-OFDM,
  9897. * 1-CCk,
  9898. * 2-HT,
  9899. * 3-VHT
  9900. */
  9901. preamble: 2, /* [1:0] */
  9902. /* mcs:
  9903. * In case of HT preamble interpret
  9904. * MCS along with NSS.
  9905. * Valid values for HT are 0 to 7.
  9906. * HT mcs 0 with NSS 2 is mcs 8.
  9907. * Valid values for VHT are 0 to 9.
  9908. */
  9909. mcs: 4, /* [5:2] */
  9910. /* rate:
  9911. * This is applicable only for
  9912. * CCK and OFDM preamble type
  9913. * rate 0: OFDM 48 Mbps,
  9914. * 1: OFDM 24 Mbps,
  9915. * 2: OFDM 12 Mbps
  9916. * 3: OFDM 6 Mbps
  9917. * 4: OFDM 54 Mbps
  9918. * 5: OFDM 36 Mbps
  9919. * 6: OFDM 18 Mbps
  9920. * 7: OFDM 9 Mbps
  9921. * rate 0: CCK 11 Mbps Long
  9922. * 1: CCK 5.5 Mbps Long
  9923. * 2: CCK 2 Mbps Long
  9924. * 3: CCK 1 Mbps Long
  9925. * 4: CCK 11 Mbps Short
  9926. * 5: CCK 5.5 Mbps Short
  9927. * 6: CCK 2 Mbps Short
  9928. */
  9929. rate : 3, /* [ 8: 6] */
  9930. rssi : 8, /* [16: 9] units=dBm */
  9931. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9932. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9933. stbc : 1, /* [22] */
  9934. sgi : 1, /* [23] */
  9935. ldpc : 1, /* [24] */
  9936. beamformed: 1, /* [25] */
  9937. reserved_2: 6; /* [31:26] */
  9938. A_UINT32 /* word 3 */
  9939. framectrl:16, /* [15: 0] */
  9940. seqno:16; /* [31:16] */
  9941. A_UINT32 /* word 4 */
  9942. tid_num:5, /* [ 4: 0] actual TID number */
  9943. vdev_id:8, /* [12: 5] */
  9944. reserved_3:19; /* [31:13] */
  9945. A_UINT32 /* word 5 */
  9946. /* status:
  9947. * 0: tx_ok
  9948. * 1: retry
  9949. * 2: drop
  9950. * 3: filtered
  9951. * 4: abort
  9952. * 5: tid delete
  9953. * 6: sw abort
  9954. * 7: dropped by peer migration
  9955. */
  9956. status:3, /* [2:0] */
  9957. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9958. tx_mpdu_bytes:16, /* [19:4] */
  9959. /* Indicates retry count of offloaded/local generated Data tx frames */
  9960. tx_retry_cnt:6, /* [25:20] */
  9961. reserved_4:6; /* [31:26] */
  9962. } POSTPACK;
  9963. /* FW offload deliver ind message header fields */
  9964. /* DWORD one */
  9965. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9966. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9967. /* DWORD two */
  9968. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9969. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9970. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9971. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9972. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9973. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9974. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9975. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9976. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9977. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9978. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9979. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9980. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9981. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9982. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9983. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9984. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9985. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9986. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9987. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9988. /* DWORD three*/
  9989. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9990. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9991. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9992. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9993. /* DWORD four */
  9994. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9995. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9996. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9997. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9998. /* DWORD five */
  9999. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10000. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10001. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10002. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10003. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10004. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10005. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10006. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10007. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10008. do { \
  10009. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10010. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10011. } while (0)
  10012. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10013. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10014. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10017. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10018. } while (0)
  10019. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10020. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10021. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10022. do { \
  10023. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10024. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10025. } while (0)
  10026. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10027. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10028. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10031. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10032. } while (0)
  10033. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10034. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10035. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10036. do { \
  10037. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10038. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10039. } while (0)
  10040. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10041. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10042. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10045. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10046. } while (0)
  10047. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10048. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10049. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10052. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10053. } while (0)
  10054. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10055. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10056. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10059. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10060. } while (0)
  10061. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10062. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10063. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10064. do { \
  10065. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10066. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10067. } while (0)
  10068. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10069. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10070. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10071. do { \
  10072. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10073. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10074. } while (0)
  10075. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10076. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10077. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10078. do { \
  10079. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10080. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10081. } while (0)
  10082. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10083. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10084. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10085. do { \
  10086. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10087. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10088. } while (0)
  10089. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10090. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10091. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10092. do { \
  10093. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10094. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10095. } while (0)
  10096. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10097. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10098. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10099. do { \
  10100. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10101. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10102. } while (0)
  10103. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10104. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10105. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10106. do { \
  10107. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10108. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10109. } while (0)
  10110. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10111. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10112. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10113. do { \
  10114. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10115. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10116. } while (0)
  10117. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10118. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10119. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10120. do { \
  10121. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10122. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10123. } while (0)
  10124. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10125. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10126. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10127. do { \
  10128. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10129. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10130. } while (0)
  10131. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10132. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10133. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10134. do { \
  10135. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10136. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10137. } while (0)
  10138. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10139. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10140. /*
  10141. * @brief target -> host rx reorder flush message definition
  10142. *
  10143. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10144. *
  10145. * @details
  10146. * The following field definitions describe the format of the rx flush
  10147. * message sent from the target to the host.
  10148. * The message consists of a 4-octet header, followed by one or more
  10149. * 4-octet payload information elements.
  10150. *
  10151. * |31 24|23 8|7 0|
  10152. * |--------------------------------------------------------------|
  10153. * | TID | peer ID | msg type |
  10154. * |--------------------------------------------------------------|
  10155. * | seq num end | seq num start | MPDU status | reserved |
  10156. * |--------------------------------------------------------------|
  10157. * First DWORD:
  10158. * - MSG_TYPE
  10159. * Bits 7:0
  10160. * Purpose: identifies this as an rx flush message
  10161. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10162. * - PEER_ID
  10163. * Bits 23:8 (only bits 18:8 actually used)
  10164. * Purpose: identify which peer's rx data is being flushed
  10165. * Value: (rx) peer ID
  10166. * - TID
  10167. * Bits 31:24 (only bits 27:24 actually used)
  10168. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10169. * Value: traffic identifier
  10170. * Second DWORD:
  10171. * - MPDU_STATUS
  10172. * Bits 15:8
  10173. * Purpose:
  10174. * Indicate whether the flushed MPDUs should be discarded or processed.
  10175. * Value:
  10176. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10177. * stages of rx processing
  10178. * other: discard the MPDUs
  10179. * It is anticipated that flush messages will always have
  10180. * MPDU status == 1, but the status flag is included for
  10181. * flexibility.
  10182. * - SEQ_NUM_START
  10183. * Bits 23:16
  10184. * Purpose:
  10185. * Indicate the start of a series of consecutive MPDUs being flushed.
  10186. * Not all MPDUs within this range are necessarily valid - the host
  10187. * must check each sequence number within this range to see if the
  10188. * corresponding MPDU is actually present.
  10189. * Value:
  10190. * The sequence number for the first MPDU in the sequence.
  10191. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10192. * - SEQ_NUM_END
  10193. * Bits 30:24
  10194. * Purpose:
  10195. * Indicate the end of a series of consecutive MPDUs being flushed.
  10196. * Value:
  10197. * The sequence number one larger than the sequence number of the
  10198. * last MPDU being flushed.
  10199. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10200. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10201. * are to be released for further rx processing.
  10202. * Not all MPDUs within this range are necessarily valid - the host
  10203. * must check each sequence number within this range to see if the
  10204. * corresponding MPDU is actually present.
  10205. */
  10206. /* first DWORD */
  10207. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10208. #define HTT_RX_FLUSH_PEER_ID_S 8
  10209. #define HTT_RX_FLUSH_TID_M 0xff000000
  10210. #define HTT_RX_FLUSH_TID_S 24
  10211. /* second DWORD */
  10212. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10213. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10214. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10215. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10216. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10217. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10218. #define HTT_RX_FLUSH_BYTES 8
  10219. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10220. do { \
  10221. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10222. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10223. } while (0)
  10224. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10225. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10226. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10227. do { \
  10228. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10229. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10230. } while (0)
  10231. #define HTT_RX_FLUSH_TID_GET(word) \
  10232. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10233. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10234. do { \
  10235. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10236. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10237. } while (0)
  10238. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10239. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10240. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10241. do { \
  10242. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10243. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10244. } while (0)
  10245. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10246. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10247. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10248. do { \
  10249. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10250. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10251. } while (0)
  10252. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10253. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10254. /*
  10255. * @brief target -> host rx pn check indication message
  10256. *
  10257. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10258. *
  10259. * @details
  10260. * The following field definitions describe the format of the Rx PN check
  10261. * indication message sent from the target to the host.
  10262. * The message consists of a 4-octet header, followed by the start and
  10263. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10264. * IE is one octet containing the sequence number that failed the PN
  10265. * check.
  10266. *
  10267. * |31 24|23 8|7 0|
  10268. * |--------------------------------------------------------------|
  10269. * | TID | peer ID | msg type |
  10270. * |--------------------------------------------------------------|
  10271. * | Reserved | PN IE count | seq num end | seq num start|
  10272. * |--------------------------------------------------------------|
  10273. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10274. * |--------------------------------------------------------------|
  10275. * First DWORD:
  10276. * - MSG_TYPE
  10277. * Bits 7:0
  10278. * Purpose: Identifies this as an rx pn check indication message
  10279. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10280. * - PEER_ID
  10281. * Bits 23:8 (only bits 18:8 actually used)
  10282. * Purpose: identify which peer
  10283. * Value: (rx) peer ID
  10284. * - TID
  10285. * Bits 31:24 (only bits 27:24 actually used)
  10286. * Purpose: identify traffic identifier
  10287. * Value: traffic identifier
  10288. * Second DWORD:
  10289. * - SEQ_NUM_START
  10290. * Bits 7:0
  10291. * Purpose:
  10292. * Indicates the starting sequence number of the MPDU in this
  10293. * series of MPDUs that went though PN check.
  10294. * Value:
  10295. * The sequence number for the first MPDU in the sequence.
  10296. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10297. * - SEQ_NUM_END
  10298. * Bits 15:8
  10299. * Purpose:
  10300. * Indicates the ending sequence number of the MPDU in this
  10301. * series of MPDUs that went though PN check.
  10302. * Value:
  10303. * The sequence number one larger then the sequence number of the last
  10304. * MPDU being flushed.
  10305. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10306. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10307. * for invalid PN numbers and are ready to be released for further processing.
  10308. * Not all MPDUs within this range are necessarily valid - the host
  10309. * must check each sequence number within this range to see if the
  10310. * corresponding MPDU is actually present.
  10311. * - PN_IE_COUNT
  10312. * Bits 23:16
  10313. * Purpose:
  10314. * Used to determine the variable number of PN information elements in this
  10315. * message
  10316. *
  10317. * PN information elements:
  10318. * - PN_IE_x-
  10319. * Purpose:
  10320. * Each PN information element contains the sequence number of the MPDU that
  10321. * has failed the target PN check.
  10322. * Value:
  10323. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10324. * that failed the PN check.
  10325. */
  10326. /* first DWORD */
  10327. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10328. #define HTT_RX_PN_IND_PEER_ID_S 8
  10329. #define HTT_RX_PN_IND_TID_M 0xff000000
  10330. #define HTT_RX_PN_IND_TID_S 24
  10331. /* second DWORD */
  10332. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10333. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10334. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10335. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10336. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10337. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10338. #define HTT_RX_PN_IND_BYTES 8
  10339. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10340. do { \
  10341. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10342. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10343. } while (0)
  10344. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10345. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10346. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10347. do { \
  10348. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10349. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10350. } while (0)
  10351. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10352. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10353. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10354. do { \
  10355. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10356. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10357. } while (0)
  10358. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10359. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10360. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10361. do { \
  10362. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10363. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10364. } while (0)
  10365. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10366. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10367. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10368. do { \
  10369. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10370. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10371. } while (0)
  10372. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10373. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10374. /*
  10375. * @brief target -> host rx offload deliver message for LL system
  10376. *
  10377. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10378. *
  10379. * @details
  10380. * In a low latency system this message is sent whenever the offload
  10381. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10382. * The DMA of the actual packets into host memory is done before sending out
  10383. * this message. This message indicates only how many MSDUs to reap. The
  10384. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10385. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10386. * DMA'd by the MAC directly into host memory these packets do not contain
  10387. * the MAC descriptors in the header portion of the packet. Instead they contain
  10388. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10389. * message, the packets are delivered directly to the NW stack without going
  10390. * through the regular reorder buffering and PN checking path since it has
  10391. * already been done in target.
  10392. *
  10393. * |31 24|23 16|15 8|7 0|
  10394. * |-----------------------------------------------------------------------|
  10395. * | Total MSDU count | reserved | msg type |
  10396. * |-----------------------------------------------------------------------|
  10397. *
  10398. * @brief target -> host rx offload deliver message for HL system
  10399. *
  10400. * @details
  10401. * In a high latency system this message is sent whenever the offload manager
  10402. * flushes out the packets it has coalesced in its coalescing buffer. The
  10403. * actual packets are also carried along with this message. When the host
  10404. * receives this message, it is expected to deliver these packets to the NW
  10405. * stack directly instead of routing them through the reorder buffering and
  10406. * PN checking path since it has already been done in target.
  10407. *
  10408. * |31 24|23 16|15 8|7 0|
  10409. * |-----------------------------------------------------------------------|
  10410. * | Total MSDU count | reserved | msg type |
  10411. * |-----------------------------------------------------------------------|
  10412. * | peer ID | MSDU length |
  10413. * |-----------------------------------------------------------------------|
  10414. * | MSDU payload | FW Desc | tid | vdev ID |
  10415. * |-----------------------------------------------------------------------|
  10416. * | MSDU payload contd. |
  10417. * |-----------------------------------------------------------------------|
  10418. * | peer ID | MSDU length |
  10419. * |-----------------------------------------------------------------------|
  10420. * | MSDU payload | FW Desc | tid | vdev ID |
  10421. * |-----------------------------------------------------------------------|
  10422. * | MSDU payload contd. |
  10423. * |-----------------------------------------------------------------------|
  10424. *
  10425. */
  10426. /* first DWORD */
  10427. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10439. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10441. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10442. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10443. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10444. do { \
  10445. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10446. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10447. } while (0)
  10448. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10449. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10450. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10451. do { \
  10452. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10453. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10454. } while (0)
  10455. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10456. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10457. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10460. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10461. } while (0)
  10462. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10463. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10464. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10465. do { \
  10466. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10467. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10468. } while (0)
  10469. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10470. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10471. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10472. do { \
  10473. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10474. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10475. } while (0)
  10476. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10477. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10478. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10481. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10482. } while (0)
  10483. /**
  10484. * @brief target -> host rx peer map/unmap message definition
  10485. *
  10486. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10487. *
  10488. * @details
  10489. * The following diagram shows the format of the rx peer map message sent
  10490. * from the target to the host. This layout assumes the target operates
  10491. * as little-endian.
  10492. *
  10493. * This message always contains a SW peer ID. The main purpose of the
  10494. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10495. * with, so that the host can use that peer ID to determine which peer
  10496. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10497. * other purposes, such as identifying during tx completions which peer
  10498. * the tx frames in question were transmitted to.
  10499. *
  10500. * In certain generations of chips, the peer map message also contains
  10501. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10502. * to identify which peer the frame needs to be forwarded to (i.e. the
  10503. * peer assocated with the Destination MAC Address within the packet),
  10504. * and particularly which vdev needs to transmit the frame (for cases
  10505. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10506. * meaning as AST_INDEX_0.
  10507. * This DA-based peer ID that is provided for certain rx frames
  10508. * (the rx frames that need to be re-transmitted as tx frames)
  10509. * is the ID that the HW uses for referring to the peer in question,
  10510. * rather than the peer ID that the SW+FW use to refer to the peer.
  10511. *
  10512. *
  10513. * |31 24|23 16|15 8|7 0|
  10514. * |-----------------------------------------------------------------------|
  10515. * | SW peer ID | VDEV ID | msg type |
  10516. * |-----------------------------------------------------------------------|
  10517. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10518. * |-----------------------------------------------------------------------|
  10519. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10520. * |-----------------------------------------------------------------------|
  10521. *
  10522. *
  10523. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10524. *
  10525. * The following diagram shows the format of the rx peer unmap message sent
  10526. * from the target to the host.
  10527. *
  10528. * |31 24|23 16|15 8|7 0|
  10529. * |-----------------------------------------------------------------------|
  10530. * | SW peer ID | VDEV ID | msg type |
  10531. * |-----------------------------------------------------------------------|
  10532. *
  10533. * The following field definitions describe the format of the rx peer map
  10534. * and peer unmap messages sent from the target to the host.
  10535. * - MSG_TYPE
  10536. * Bits 7:0
  10537. * Purpose: identifies this as an rx peer map or peer unmap message
  10538. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10539. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10540. * - VDEV_ID
  10541. * Bits 15:8
  10542. * Purpose: Indicates which virtual device the peer is associated
  10543. * with.
  10544. * Value: vdev ID (used in the host to look up the vdev object)
  10545. * - PEER_ID (a.k.a. SW_PEER_ID)
  10546. * Bits 31:16
  10547. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10548. * freeing (unmap)
  10549. * Value: (rx) peer ID
  10550. * - MAC_ADDR_L32 (peer map only)
  10551. * Bits 31:0
  10552. * Purpose: Identifies which peer node the peer ID is for.
  10553. * Value: lower 4 bytes of peer node's MAC address
  10554. * - MAC_ADDR_U16 (peer map only)
  10555. * Bits 15:0
  10556. * Purpose: Identifies which peer node the peer ID is for.
  10557. * Value: upper 2 bytes of peer node's MAC address
  10558. * - HW_PEER_ID
  10559. * Bits 31:16
  10560. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10561. * address, so for rx frames marked for rx --> tx forwarding, the
  10562. * host can determine from the HW peer ID provided as meta-data with
  10563. * the rx frame which peer the frame is supposed to be forwarded to.
  10564. * Value: ID used by the MAC HW to identify the peer
  10565. */
  10566. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10567. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10568. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10569. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10570. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10571. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10572. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10573. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10574. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10575. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10576. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10577. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10578. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10579. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10580. do { \
  10581. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10582. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10583. } while (0)
  10584. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10585. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10586. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10587. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10588. do { \
  10589. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10590. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10591. } while (0)
  10592. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10593. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10594. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10595. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10596. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10597. do { \
  10598. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10599. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10600. } while (0)
  10601. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10602. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10603. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10604. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10605. #define HTT_RX_PEER_MAP_BYTES 12
  10606. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10607. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10608. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10609. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10610. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10611. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10612. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10613. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10614. #define HTT_RX_PEER_UNMAP_BYTES 4
  10615. /**
  10616. * @brief target -> host rx peer map V2 message definition
  10617. *
  10618. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10619. *
  10620. * @details
  10621. * The following diagram shows the format of the rx peer map v2 message sent
  10622. * from the target to the host. This layout assumes the target operates
  10623. * as little-endian.
  10624. *
  10625. * This message always contains a SW peer ID. The main purpose of the
  10626. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10627. * with, so that the host can use that peer ID to determine which peer
  10628. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10629. * other purposes, such as identifying during tx completions which peer
  10630. * the tx frames in question were transmitted to.
  10631. *
  10632. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10633. * is used during rx --> tx frame forwarding to identify which peer the
  10634. * frame needs to be forwarded to (i.e. the peer assocated with the
  10635. * Destination MAC Address within the packet), and particularly which vdev
  10636. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10637. * This DA-based peer ID that is provided for certain rx frames
  10638. * (the rx frames that need to be re-transmitted as tx frames)
  10639. * is the ID that the HW uses for referring to the peer in question,
  10640. * rather than the peer ID that the SW+FW use to refer to the peer.
  10641. *
  10642. * The HW peer id here is the same meaning as AST_INDEX_0.
  10643. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10644. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10645. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10646. * AST is valid.
  10647. *
  10648. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10649. * |-------------------------------------------------------------------------|
  10650. * | SW peer ID | VDEV ID | msg type |
  10651. * |-------------------------------------------------------------------------|
  10652. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10653. * |-------------------------------------------------------------------------|
  10654. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10655. * |-------------------------------------------------------------------------|
  10656. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10657. * |-------------------------------------------------------------------------|
  10658. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10659. * |-------------------------------------------------------------------------|
  10660. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10661. * |-------------------------------------------------------------------------|
  10662. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10663. * |-------------------------------------------------------------------------|
  10664. * | Reserved_2 |
  10665. * |-------------------------------------------------------------------------|
  10666. * Where:
  10667. * NH = Next Hop
  10668. * ASTVM = AST valid mask
  10669. * OA = on-chip AST valid bit
  10670. * ASTFM = AST flow mask
  10671. *
  10672. * The following field definitions describe the format of the rx peer map v2
  10673. * messages sent from the target to the host.
  10674. * - MSG_TYPE
  10675. * Bits 7:0
  10676. * Purpose: identifies this as an rx peer map v2 message
  10677. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10678. * - VDEV_ID
  10679. * Bits 15:8
  10680. * Purpose: Indicates which virtual device the peer is associated with.
  10681. * Value: vdev ID (used in the host to look up the vdev object)
  10682. * - SW_PEER_ID
  10683. * Bits 31:16
  10684. * Purpose: The peer ID (index) that WAL is allocating
  10685. * Value: (rx) peer ID
  10686. * - MAC_ADDR_L32
  10687. * Bits 31:0
  10688. * Purpose: Identifies which peer node the peer ID is for.
  10689. * Value: lower 4 bytes of peer node's MAC address
  10690. * - MAC_ADDR_U16
  10691. * Bits 15:0
  10692. * Purpose: Identifies which peer node the peer ID is for.
  10693. * Value: upper 2 bytes of peer node's MAC address
  10694. * - HW_PEER_ID / AST_INDEX_0
  10695. * Bits 31:16
  10696. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10697. * address, so for rx frames marked for rx --> tx forwarding, the
  10698. * host can determine from the HW peer ID provided as meta-data with
  10699. * the rx frame which peer the frame is supposed to be forwarded to.
  10700. * Value: ID used by the MAC HW to identify the peer
  10701. * - AST_HASH_VALUE
  10702. * Bits 15:0
  10703. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10704. * override feature.
  10705. * - NEXT_HOP
  10706. * Bit 16
  10707. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10708. * (Wireless Distribution System).
  10709. * - AST_VALID_MASK
  10710. * Bits 19:17
  10711. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10712. * - ONCHIP_AST_VALID_FLAG
  10713. * Bit 20
  10714. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10715. * is valid.
  10716. * - AST_INDEX_1
  10717. * Bits 15:0
  10718. * Purpose: indicate the second AST index for this peer
  10719. * - AST_0_FLOW_MASK
  10720. * Bits 19:16
  10721. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10722. * - AST_1_FLOW_MASK
  10723. * Bits 23:20
  10724. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10725. * - AST_2_FLOW_MASK
  10726. * Bits 27:24
  10727. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10728. * - AST_3_FLOW_MASK
  10729. * Bits 31:28
  10730. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10731. * - AST_INDEX_2
  10732. * Bits 15:0
  10733. * Purpose: indicate the third AST index for this peer
  10734. * - TID_VALID_HI_PRI
  10735. * Bits 23:16
  10736. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10737. * - TID_VALID_LOW_PRI
  10738. * Bits 31:24
  10739. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10740. * - AST_INDEX_3
  10741. * Bits 15:0
  10742. * Purpose: indicate the fourth AST index for this peer
  10743. * - ONCHIP_AST_IDX / RESERVED
  10744. * Bits 31:16
  10745. * Purpose: This field is valid only when split AST feature is enabled.
  10746. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10747. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10748. * address, this ast_idx is used for LMAC modules for RXPCU.
  10749. * Value: ID used by the LMAC HW to identify the peer
  10750. */
  10751. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10752. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10753. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10754. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10755. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10756. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10757. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10758. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10759. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10760. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10761. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10762. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10763. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10764. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10765. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10766. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10767. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10768. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10769. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10770. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10771. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10772. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10773. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10774. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10775. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10776. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10777. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10778. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10779. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10780. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10781. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10782. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10783. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10784. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10785. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10786. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10787. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10788. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10789. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10790. do { \
  10791. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10792. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10793. } while (0)
  10794. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10795. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10796. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10797. do { \
  10798. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10799. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10800. } while (0)
  10801. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10802. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10803. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10804. do { \
  10805. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10806. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10807. } while (0)
  10808. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10809. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10810. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10811. do { \
  10812. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10813. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10814. } while (0)
  10815. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10816. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10817. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10818. do { \
  10819. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10820. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10821. } while (0)
  10822. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10823. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10824. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10827. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10828. } while (0)
  10829. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10830. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10831. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10834. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10835. } while (0)
  10836. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10837. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10838. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10839. do { \
  10840. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10841. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10842. } while (0)
  10843. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10844. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10845. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10846. do { \
  10847. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10848. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10849. } while (0)
  10850. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10851. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10852. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10853. do { \
  10854. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10855. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10856. } while (0)
  10857. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10858. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10859. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10860. do { \
  10861. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10862. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10863. } while (0)
  10864. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10865. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10866. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10867. do { \
  10868. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10869. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10870. } while (0)
  10871. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10872. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10873. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10874. do { \
  10875. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10876. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10877. } while (0)
  10878. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10879. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10880. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10881. do { \
  10882. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10883. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10884. } while (0)
  10885. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10886. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10887. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10888. do { \
  10889. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10890. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10891. } while (0)
  10892. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10893. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10894. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10895. do { \
  10896. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10897. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10898. } while (0)
  10899. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10900. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10901. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10902. do { \
  10903. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10904. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10905. } while (0)
  10906. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10907. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10908. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10909. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10910. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10911. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10912. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10913. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10914. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10915. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10916. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10917. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10918. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10919. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10920. /**
  10921. * @brief target -> host rx peer map V3 message definition
  10922. *
  10923. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10924. *
  10925. * @details
  10926. * The following diagram shows the format of the rx peer map v3 message sent
  10927. * from the target to the host.
  10928. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10929. * This layout assumes the target operates as little-endian.
  10930. *
  10931. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10932. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10933. * | SW peer ID | VDEV ID | msg type |
  10934. * |-----------------+--------------------+-----------------+-----------------|
  10935. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10936. * |-----------------+--------------------+-----------------+-----------------|
  10937. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10938. * |-----------------+--------+-----------+-----------------+-----------------|
  10939. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10940. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10941. * | (8bits) | | (4bits) | |
  10942. * |-----------------+--------+--+--+--+--------------------------------------|
  10943. * | RESERVED |E |O | | |
  10944. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10945. * | |V |V | | |
  10946. * |-----------------+--------------------+-----------------------------------|
  10947. * | HTT_MSDU_IDX_ | RESERVED | |
  10948. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10949. * | (8bits) | | |
  10950. * |-----------------+--------------------+-----------------------------------|
  10951. * | Reserved_2 |
  10952. * |--------------------------------------------------------------------------|
  10953. * | Reserved_3 |
  10954. * |--------------------------------------------------------------------------|
  10955. *
  10956. * Where:
  10957. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10958. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10959. * NH = Next Hop
  10960. * The following field definitions describe the format of the rx peer map v3
  10961. * messages sent from the target to the host.
  10962. * - MSG_TYPE
  10963. * Bits 7:0
  10964. * Purpose: identifies this as a peer map v3 message
  10965. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10966. * - VDEV_ID
  10967. * Bits 15:8
  10968. * Purpose: Indicates which virtual device the peer is associated with.
  10969. * - SW_PEER_ID
  10970. * Bits 31:16
  10971. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10972. * - MAC_ADDR_L32
  10973. * Bits 31:0
  10974. * Purpose: Identifies which peer node the peer ID is for.
  10975. * Value: lower 4 bytes of peer node's MAC address
  10976. * - MAC_ADDR_U16
  10977. * Bits 15:0
  10978. * Purpose: Identifies which peer node the peer ID is for.
  10979. * Value: upper 2 bytes of peer node's MAC address
  10980. * - MULTICAST_SW_PEER_ID
  10981. * Bits 31:16
  10982. * Purpose: The multicast peer ID (index)
  10983. * Value: set to HTT_INVALID_PEER if not valid
  10984. * - HW_PEER_ID / AST_INDEX
  10985. * Bits 15:0
  10986. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10987. * address, so for rx frames marked for rx --> tx forwarding, the
  10988. * host can determine from the HW peer ID provided as meta-data with
  10989. * the rx frame which peer the frame is supposed to be forwarded to.
  10990. * - CACHE_SET_NUM
  10991. * Bits 19:16
  10992. * Purpose: Cache Set Number for AST_INDEX
  10993. * Cache set number that should be used to cache the index based
  10994. * search results, for address and flow search.
  10995. * This value should be equal to LSB 4 bits of the hash value
  10996. * of match data, in case of search index points to an entry which
  10997. * may be used in content based search also. The value can be
  10998. * anything when the entry pointed by search index will not be
  10999. * used for content based search.
  11000. * - HTT_MSDU_IDX_VALID_MASK
  11001. * Bits 31:24
  11002. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11003. * - ONCHIP_AST_IDX / RESERVED
  11004. * Bits 15:0
  11005. * Purpose: This field is valid only when split AST feature is enabled.
  11006. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11007. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11008. * address, this ast_idx is used for LMAC modules for RXPCU.
  11009. * - NEXT_HOP
  11010. * Bits 16
  11011. * Purpose: Flag indicates next_hop AST entry used for WDS
  11012. * (Wireless Distribution System).
  11013. * - ONCHIP_AST_VALID
  11014. * Bits 17
  11015. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11016. * - EXT_AST_VALID
  11017. * Bits 18
  11018. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11019. * - EXT_AST_INDEX
  11020. * Bits 15:0
  11021. * Purpose: This field describes Extended AST index
  11022. * Valid if EXT_AST_VALID flag set
  11023. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11024. * Bits 31:24
  11025. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11026. */
  11027. /* dword 0 */
  11028. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11029. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11030. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11031. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11032. /* dword 1 */
  11033. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11034. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11035. /* dword 2 */
  11036. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11037. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11038. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11039. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11040. /* dword 3 */
  11041. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11042. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11043. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11044. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11045. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11046. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11047. /* dword 4 */
  11048. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11049. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11050. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11051. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11052. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11053. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11054. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11055. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11056. /* dword 5 */
  11057. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11058. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11059. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11060. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11061. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11062. do { \
  11063. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11064. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11065. } while (0)
  11066. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11067. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11068. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11069. do { \
  11070. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11071. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11072. } while (0)
  11073. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11074. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11075. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11076. do { \
  11077. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11078. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11079. } while (0)
  11080. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11081. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11082. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11083. do { \
  11084. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11085. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11086. } while (0)
  11087. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11088. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11089. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11090. do { \
  11091. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11092. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11093. } while (0)
  11094. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11095. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11096. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11097. do { \
  11098. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11099. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11100. } while (0)
  11101. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11102. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11103. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11104. do { \
  11105. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11106. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11107. } while (0)
  11108. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11109. (((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)
  11110. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11111. do { \
  11112. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11113. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11114. } while (0)
  11115. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11116. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11117. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11118. do { \
  11119. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11120. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11121. } while (0)
  11122. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11123. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11124. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11125. do { \
  11126. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11127. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11128. } while (0)
  11129. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11130. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11131. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11132. do { \
  11133. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11134. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11135. } while (0)
  11136. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11137. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11138. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11139. do { \
  11140. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11141. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11142. } while (0)
  11143. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11144. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11145. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11146. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11147. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11148. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11149. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11150. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11151. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11152. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11153. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11154. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11155. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11156. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11157. /**
  11158. * @brief target -> host rx peer unmap V2 message definition
  11159. *
  11160. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11161. *
  11162. * The following diagram shows the format of the rx peer unmap message sent
  11163. * from the target to the host.
  11164. *
  11165. * |31 24|23 16|15 8|7 0|
  11166. * |-----------------------------------------------------------------------|
  11167. * | SW peer ID | VDEV ID | msg type |
  11168. * |-----------------------------------------------------------------------|
  11169. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11170. * |-----------------------------------------------------------------------|
  11171. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11172. * |-----------------------------------------------------------------------|
  11173. * | Peer Delete Duration |
  11174. * |-----------------------------------------------------------------------|
  11175. * | Reserved_0 | WDS Free Count |
  11176. * |-----------------------------------------------------------------------|
  11177. * | Reserved_1 |
  11178. * |-----------------------------------------------------------------------|
  11179. * | Reserved_2 |
  11180. * |-----------------------------------------------------------------------|
  11181. *
  11182. *
  11183. * The following field definitions describe the format of the rx peer unmap
  11184. * messages sent from the target to the host.
  11185. * - MSG_TYPE
  11186. * Bits 7:0
  11187. * Purpose: identifies this as an rx peer unmap v2 message
  11188. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11189. * - VDEV_ID
  11190. * Bits 15:8
  11191. * Purpose: Indicates which virtual device the peer is associated
  11192. * with.
  11193. * Value: vdev ID (used in the host to look up the vdev object)
  11194. * - SW_PEER_ID
  11195. * Bits 31:16
  11196. * Purpose: The peer ID (index) that WAL is freeing
  11197. * Value: (rx) peer ID
  11198. * - MAC_ADDR_L32
  11199. * Bits 31:0
  11200. * Purpose: Identifies which peer node the peer ID is for.
  11201. * Value: lower 4 bytes of peer node's MAC address
  11202. * - MAC_ADDR_U16
  11203. * Bits 15:0
  11204. * Purpose: Identifies which peer node the peer ID is for.
  11205. * Value: upper 2 bytes of peer node's MAC address
  11206. * - NEXT_HOP
  11207. * Bits 16
  11208. * Purpose: Bit indicates next_hop AST entry used for WDS
  11209. * (Wireless Distribution System).
  11210. * - PEER_DELETE_DURATION
  11211. * Bits 31:0
  11212. * Purpose: Time taken to delete peer, in msec,
  11213. * Used for monitoring / debugging PEER delete response delay
  11214. * - PEER_WDS_FREE_COUNT
  11215. * Bits 15:0
  11216. * Purpose: Count of WDS entries deleted associated to peer deleted
  11217. */
  11218. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11219. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11220. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11221. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11222. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11223. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11224. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11225. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11226. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11227. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11228. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11229. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11230. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11231. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11232. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11233. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11234. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11235. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11236. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11237. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11238. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11241. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11242. } while (0)
  11243. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11244. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11245. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11246. do { \
  11247. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11248. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11249. } while (0)
  11250. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11251. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11252. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11253. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11254. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11255. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11256. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11257. /**
  11258. * @brief target -> host rx peer mlo map message definition
  11259. *
  11260. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11261. *
  11262. * @details
  11263. * The following diagram shows the format of the rx mlo peer map message sent
  11264. * from the target to the host. This layout assumes the target operates
  11265. * as little-endian.
  11266. *
  11267. * MCC:
  11268. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11269. *
  11270. * WIN:
  11271. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11272. * It will be sent on the Assoc Link.
  11273. *
  11274. * This message always contains a MLO peer ID. The main purpose of the
  11275. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11276. * with, so that the host can use that MLO peer ID to determine which peer
  11277. * transmitted the rx frame.
  11278. *
  11279. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11280. * |-------------------------------------------------------------------------|
  11281. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11282. * |-------------------------------------------------------------------------|
  11283. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11284. * |-------------------------------------------------------------------------|
  11285. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11286. * |-------------------------------------------------------------------------|
  11287. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11288. * |-------------------------------------------------------------------------|
  11289. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11290. * |-------------------------------------------------------------------------|
  11291. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11292. * |-------------------------------------------------------------------------|
  11293. * |RSVD |
  11294. * |-------------------------------------------------------------------------|
  11295. * |RSVD |
  11296. * |-------------------------------------------------------------------------|
  11297. * | htt_tlv_hdr_t |
  11298. * |-------------------------------------------------------------------------|
  11299. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11300. * |-------------------------------------------------------------------------|
  11301. * | htt_tlv_hdr_t |
  11302. * |-------------------------------------------------------------------------|
  11303. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11304. * |-------------------------------------------------------------------------|
  11305. * | htt_tlv_hdr_t |
  11306. * |-------------------------------------------------------------------------|
  11307. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11308. * |-------------------------------------------------------------------------|
  11309. *
  11310. * Where:
  11311. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11312. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11313. * V (valid) - 1 Bit Bit17
  11314. * CHIPID - 3 Bits
  11315. * TIDMASK - 8 Bits
  11316. * CACHE_SET_NUM - 8 Bits
  11317. *
  11318. * The following field definitions describe the format of the rx MLO peer map
  11319. * messages sent from the target to the host.
  11320. * - MSG_TYPE
  11321. * Bits 7:0
  11322. * Purpose: identifies this as an rx mlo peer map message
  11323. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11324. *
  11325. * - MLO_PEER_ID
  11326. * Bits 23:8
  11327. * Purpose: The MLO peer ID (index).
  11328. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11329. * Value: MLO peer ID
  11330. *
  11331. * - NUMLINK
  11332. * Bits: 26:24 (3Bits)
  11333. * Purpose: Indicate the max number of logical links supported per client.
  11334. * Value: number of logical links
  11335. *
  11336. * - PRC
  11337. * Bits: 29:27 (3Bits)
  11338. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11339. * if there is migration of the primary chip.
  11340. * Value: Primary REO CHIPID
  11341. *
  11342. * - MAC_ADDR_L32
  11343. * Bits 31:0
  11344. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11345. * Value: lower 4 bytes of peer node's MAC address
  11346. *
  11347. * - MAC_ADDR_U16
  11348. * Bits 15:0
  11349. * Purpose: Identifies which peer node the peer ID is for.
  11350. * Value: upper 2 bytes of peer node's MAC address
  11351. *
  11352. * - PRIMARY_TCL_AST_IDX
  11353. * Bits 15:0
  11354. * Purpose: Primary TCL AST index for this peer.
  11355. *
  11356. * - V
  11357. * 1 Bit Position 16
  11358. * Purpose: If the ast idx is valid.
  11359. *
  11360. * - CHIPID
  11361. * Bits 19:17
  11362. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11363. *
  11364. * - TIDMASK
  11365. * Bits 27:20
  11366. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11367. *
  11368. * - CACHE_SET_NUM
  11369. * Bits 31:28
  11370. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11371. * Cache set number that should be used to cache the index based
  11372. * search results, for address and flow search.
  11373. * This value should be equal to LSB four bits of the hash value
  11374. * of match data, in case of search index points to an entry which
  11375. * may be used in content based search also. The value can be
  11376. * anything when the entry pointed by search index will not be
  11377. * used for content based search.
  11378. *
  11379. * - htt_tlv_hdr_t
  11380. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11381. *
  11382. * Bits 11:0
  11383. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11384. *
  11385. * Bits 23:12
  11386. * Purpose: Length, Length of the value that follows the header
  11387. *
  11388. * Bits 31:28
  11389. * Purpose: Reserved.
  11390. *
  11391. *
  11392. * - SW_PEER_ID
  11393. * Bits 15:0
  11394. * Purpose: The peer ID (index) that WAL is allocating
  11395. * Value: (rx) peer ID
  11396. *
  11397. * - VDEV_ID
  11398. * Bits 23:16
  11399. * Purpose: Indicates which virtual device the peer is associated with.
  11400. * Value: vdev ID (used in the host to look up the vdev object)
  11401. *
  11402. * - CHIPID
  11403. * Bits 26:24
  11404. * Purpose: Indicates which Chip id the peer is associated with.
  11405. * Value: chip ID (Provided by Host as part of QMI exchange)
  11406. */
  11407. typedef enum {
  11408. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11409. } MLO_PEER_MAP_TLV_TAG_ID;
  11410. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11411. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11412. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11413. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11414. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11415. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11416. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11417. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11418. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11419. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11420. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11421. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11422. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11423. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11424. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11425. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11426. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11427. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11428. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11429. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11430. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11431. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11432. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11433. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11434. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11435. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11436. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11437. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11438. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11439. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11440. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11441. do { \
  11442. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11443. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11444. } while (0)
  11445. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11446. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11447. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11448. do { \
  11449. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11450. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11451. } while (0)
  11452. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11453. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11454. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11455. do { \
  11456. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11457. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11458. } while (0)
  11459. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11460. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11461. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11462. do { \
  11463. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11464. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11465. } while (0)
  11466. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11467. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11468. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11469. do { \
  11470. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11471. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11472. } while (0)
  11473. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11474. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11475. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11476. do { \
  11477. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11478. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11479. } while (0)
  11480. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11481. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11482. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11483. do { \
  11484. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11485. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11486. } while (0)
  11487. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11488. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11489. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11490. do { \
  11491. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11492. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11493. } while (0)
  11494. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11495. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11496. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11497. do { \
  11498. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11499. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11500. } while (0)
  11501. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11502. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11503. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11504. do { \
  11505. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11506. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11507. } while (0)
  11508. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11509. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11510. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11511. do { \
  11512. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11513. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11514. } while (0)
  11515. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11516. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11517. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11518. do { \
  11519. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11520. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11521. } while (0)
  11522. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11523. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11524. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11525. do { \
  11526. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11527. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11528. } while (0)
  11529. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11530. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11531. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11532. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11533. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11534. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11535. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11536. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11537. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11538. *
  11539. * The following diagram shows the format of the rx mlo peer unmap message sent
  11540. * from the target to the host.
  11541. *
  11542. * |31 24|23 16|15 8|7 0|
  11543. * |-----------------------------------------------------------------------|
  11544. * | RSVD_24_31 | MLO peer ID | msg type |
  11545. * |-----------------------------------------------------------------------|
  11546. */
  11547. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11548. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11549. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11550. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11551. /**
  11552. * @brief target -> host message specifying security parameters
  11553. *
  11554. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11555. *
  11556. * @details
  11557. * The following diagram shows the format of the security specification
  11558. * message sent from the target to the host.
  11559. * This security specification message tells the host whether a PN check is
  11560. * necessary on rx data frames, and if so, how large the PN counter is.
  11561. * This message also tells the host about the security processing to apply
  11562. * to defragmented rx frames - specifically, whether a Message Integrity
  11563. * Check is required, and the Michael key to use.
  11564. *
  11565. * |31 24|23 16|15|14 8|7 0|
  11566. * |-----------------------------------------------------------------------|
  11567. * | peer ID | U| security type | msg type |
  11568. * |-----------------------------------------------------------------------|
  11569. * | Michael Key K0 |
  11570. * |-----------------------------------------------------------------------|
  11571. * | Michael Key K1 |
  11572. * |-----------------------------------------------------------------------|
  11573. * | WAPI RSC Low0 |
  11574. * |-----------------------------------------------------------------------|
  11575. * | WAPI RSC Low1 |
  11576. * |-----------------------------------------------------------------------|
  11577. * | WAPI RSC Hi0 |
  11578. * |-----------------------------------------------------------------------|
  11579. * | WAPI RSC Hi1 |
  11580. * |-----------------------------------------------------------------------|
  11581. *
  11582. * The following field definitions describe the format of the security
  11583. * indication message sent from the target to the host.
  11584. * - MSG_TYPE
  11585. * Bits 7:0
  11586. * Purpose: identifies this as a security specification message
  11587. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11588. * - SEC_TYPE
  11589. * Bits 14:8
  11590. * Purpose: specifies which type of security applies to the peer
  11591. * Value: htt_sec_type enum value
  11592. * - UNICAST
  11593. * Bit 15
  11594. * Purpose: whether this security is applied to unicast or multicast data
  11595. * Value: 1 -> unicast, 0 -> multicast
  11596. * - PEER_ID
  11597. * Bits 31:16
  11598. * Purpose: The ID number for the peer the security specification is for
  11599. * Value: peer ID
  11600. * - MICHAEL_KEY_K0
  11601. * Bits 31:0
  11602. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11603. * Value: Michael Key K0 (if security type is TKIP)
  11604. * - MICHAEL_KEY_K1
  11605. * Bits 31:0
  11606. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11607. * Value: Michael Key K1 (if security type is TKIP)
  11608. * - WAPI_RSC_LOW0
  11609. * Bits 31:0
  11610. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11611. * Value: WAPI RSC Low0 (if security type is WAPI)
  11612. * - WAPI_RSC_LOW1
  11613. * Bits 31:0
  11614. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11615. * Value: WAPI RSC Low1 (if security type is WAPI)
  11616. * - WAPI_RSC_HI0
  11617. * Bits 31:0
  11618. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11619. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11620. * - WAPI_RSC_HI1
  11621. * Bits 31:0
  11622. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11623. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11624. */
  11625. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11626. #define HTT_SEC_IND_SEC_TYPE_S 8
  11627. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11628. #define HTT_SEC_IND_UNICAST_S 15
  11629. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11630. #define HTT_SEC_IND_PEER_ID_S 16
  11631. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11632. do { \
  11633. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11634. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11635. } while (0)
  11636. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11637. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11638. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11639. do { \
  11640. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11641. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11642. } while (0)
  11643. #define HTT_SEC_IND_UNICAST_GET(word) \
  11644. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11645. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11646. do { \
  11647. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11648. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11649. } while (0)
  11650. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11651. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11652. #define HTT_SEC_IND_BYTES 28
  11653. /**
  11654. * @brief target -> host rx ADDBA / DELBA message definitions
  11655. *
  11656. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11657. *
  11658. * @details
  11659. * The following diagram shows the format of the rx ADDBA message sent
  11660. * from the target to the host:
  11661. *
  11662. * |31 20|19 16|15 8|7 0|
  11663. * |---------------------------------------------------------------------|
  11664. * | peer ID | TID | window size | msg type |
  11665. * |---------------------------------------------------------------------|
  11666. *
  11667. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11668. *
  11669. * The following diagram shows the format of the rx DELBA message sent
  11670. * from the target to the host:
  11671. *
  11672. * |31 20|19 16|15 10|9 8|7 0|
  11673. * |---------------------------------------------------------------------|
  11674. * | peer ID | TID | window size | IR| msg type |
  11675. * |---------------------------------------------------------------------|
  11676. *
  11677. * The following field definitions describe the format of the rx ADDBA
  11678. * and DELBA messages sent from the target to the host.
  11679. * - MSG_TYPE
  11680. * Bits 7:0
  11681. * Purpose: identifies this as an rx ADDBA or DELBA message
  11682. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11683. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11684. * - IR (initiator / recipient)
  11685. * Bits 9:8 (DELBA only)
  11686. * Purpose: specify whether the DELBA handshake was initiated by the
  11687. * local STA/AP, or by the peer STA/AP
  11688. * Value:
  11689. * 0 - unspecified
  11690. * 1 - initiator (a.k.a. originator)
  11691. * 2 - recipient (a.k.a. responder)
  11692. * 3 - unused / reserved
  11693. * - WIN_SIZE
  11694. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11695. * Purpose: Specifies the length of the block ack window (max = 64).
  11696. * Value:
  11697. * block ack window length specified by the received ADDBA/DELBA
  11698. * management message.
  11699. * - TID
  11700. * Bits 19:16
  11701. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11702. * Value:
  11703. * TID specified by the received ADDBA or DELBA management message.
  11704. * - PEER_ID
  11705. * Bits 31:20
  11706. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11707. * Value:
  11708. * ID (hash value) used by the host for fast, direct lookup of
  11709. * host SW peer info, including rx reorder states.
  11710. */
  11711. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11712. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11713. #define HTT_RX_ADDBA_TID_M 0xf0000
  11714. #define HTT_RX_ADDBA_TID_S 16
  11715. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11716. #define HTT_RX_ADDBA_PEER_ID_S 20
  11717. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11718. do { \
  11719. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11720. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11721. } while (0)
  11722. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11723. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11724. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11725. do { \
  11726. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11727. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11728. } while (0)
  11729. #define HTT_RX_ADDBA_TID_GET(word) \
  11730. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11731. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11732. do { \
  11733. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11734. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11735. } while (0)
  11736. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11737. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11738. #define HTT_RX_ADDBA_BYTES 4
  11739. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11740. #define HTT_RX_DELBA_INITIATOR_S 8
  11741. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11742. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11743. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11744. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11745. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11746. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11747. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11748. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11749. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11750. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11751. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11752. do { \
  11753. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11754. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11755. } while (0)
  11756. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11757. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11758. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11759. do { \
  11760. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11761. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11762. } while (0)
  11763. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11764. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11765. #define HTT_RX_DELBA_BYTES 4
  11766. /**
  11767. * @brief tx queue group information element definition
  11768. *
  11769. * @details
  11770. * The following diagram shows the format of the tx queue group
  11771. * information element, which can be included in target --> host
  11772. * messages to specify the number of tx "credits" (tx descriptors
  11773. * for LL, or tx buffers for HL) available to a particular group
  11774. * of host-side tx queues, and which host-side tx queues belong to
  11775. * the group.
  11776. *
  11777. * |31|30 24|23 16|15|14|13 0|
  11778. * |------------------------------------------------------------------------|
  11779. * | X| reserved | tx queue grp ID | A| S| credit count |
  11780. * |------------------------------------------------------------------------|
  11781. * | vdev ID mask | AC mask |
  11782. * |------------------------------------------------------------------------|
  11783. *
  11784. * The following definitions describe the fields within the tx queue group
  11785. * information element:
  11786. * - credit_count
  11787. * Bits 13:1
  11788. * Purpose: specify how many tx credits are available to the tx queue group
  11789. * Value: An absolute or relative, positive or negative credit value
  11790. * The 'A' bit specifies whether the value is absolute or relative.
  11791. * The 'S' bit specifies whether the value is positive or negative.
  11792. * A negative value can only be relative, not absolute.
  11793. * An absolute value replaces any prior credit value the host has for
  11794. * the tx queue group in question.
  11795. * A relative value is added to the prior credit value the host has for
  11796. * the tx queue group in question.
  11797. * - sign
  11798. * Bit 14
  11799. * Purpose: specify whether the credit count is positive or negative
  11800. * Value: 0 -> positive, 1 -> negative
  11801. * - absolute
  11802. * Bit 15
  11803. * Purpose: specify whether the credit count is absolute or relative
  11804. * Value: 0 -> relative, 1 -> absolute
  11805. * - txq_group_id
  11806. * Bits 23:16
  11807. * Purpose: indicate which tx queue group's credit and/or membership are
  11808. * being specified
  11809. * Value: 0 to max_tx_queue_groups-1
  11810. * - reserved
  11811. * Bits 30:16
  11812. * Value: 0x0
  11813. * - eXtension
  11814. * Bit 31
  11815. * Purpose: specify whether another tx queue group info element follows
  11816. * Value: 0 -> no more tx queue group information elements
  11817. * 1 -> another tx queue group information element immediately follows
  11818. * - ac_mask
  11819. * Bits 15:0
  11820. * Purpose: specify which Access Categories belong to the tx queue group
  11821. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11822. * the tx queue group.
  11823. * The AC bit-mask values are obtained by left-shifting by the
  11824. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11825. * - vdev_id_mask
  11826. * Bits 31:16
  11827. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11828. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11829. * belong to the tx queue group.
  11830. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11831. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11832. */
  11833. PREPACK struct htt_txq_group {
  11834. A_UINT32
  11835. credit_count: 14,
  11836. sign: 1,
  11837. absolute: 1,
  11838. tx_queue_group_id: 8,
  11839. reserved0: 7,
  11840. extension: 1;
  11841. A_UINT32
  11842. ac_mask: 16,
  11843. vdev_id_mask: 16;
  11844. } POSTPACK;
  11845. /* first word */
  11846. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11847. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11848. #define HTT_TXQ_GROUP_SIGN_S 14
  11849. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11850. #define HTT_TXQ_GROUP_ABS_S 15
  11851. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11852. #define HTT_TXQ_GROUP_ID_S 16
  11853. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11854. #define HTT_TXQ_GROUP_EXT_S 31
  11855. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11856. /* second word */
  11857. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11858. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11859. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11860. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11861. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11862. do { \
  11863. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11864. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11865. } while (0)
  11866. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11867. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11868. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11869. do { \
  11870. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11871. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11872. } while (0)
  11873. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11874. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11875. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11876. do { \
  11877. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11878. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11879. } while (0)
  11880. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11881. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11882. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11883. do { \
  11884. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11885. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11886. } while (0)
  11887. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11888. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11889. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11890. do { \
  11891. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11892. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11893. } while (0)
  11894. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11895. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11896. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11897. do { \
  11898. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11899. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11900. } while (0)
  11901. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11902. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11903. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11904. do { \
  11905. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11906. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11907. } while (0)
  11908. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11909. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11910. /**
  11911. * @brief target -> host TX completion indication message definition
  11912. *
  11913. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11914. *
  11915. * @details
  11916. * The following diagram shows the format of the TX completion indication sent
  11917. * from the target to the host
  11918. *
  11919. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11920. * |-------------------------------------------------------------------|
  11921. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11922. * |-------------------------------------------------------------------|
  11923. * payload:| MSDU1 ID | MSDU0 ID |
  11924. * |-------------------------------------------------------------------|
  11925. * : MSDU3 ID | MSDU2 ID :
  11926. * |-------------------------------------------------------------------|
  11927. * | struct htt_tx_compl_ind_append_retries |
  11928. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11929. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11930. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11931. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11932. * |-------------------------------------------------------------------|
  11933. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11934. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11935. * | MSDU0 tx_tsf64_low |
  11936. * |-------------------------------------------------------------------|
  11937. * | MSDU0 tx_tsf64_high |
  11938. * |-------------------------------------------------------------------|
  11939. * | MSDU1 tx_tsf64_low |
  11940. * |-------------------------------------------------------------------|
  11941. * | MSDU1 tx_tsf64_high |
  11942. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11943. * | phy_timestamp |
  11944. * |-------------------------------------------------------------------|
  11945. * | rate specs (see below) |
  11946. * |-------------------------------------------------------------------|
  11947. * | seqctrl | framectrl |
  11948. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11949. * Where:
  11950. * A0 = append (a.k.a. append0)
  11951. * A1 = append1
  11952. * TP = MSDU tx power presence
  11953. * A2 = append2
  11954. * A3 = append3
  11955. * A4 = append4
  11956. *
  11957. * The following field definitions describe the format of the TX completion
  11958. * indication sent from the target to the host
  11959. * Header fields:
  11960. * - msg_type
  11961. * Bits 7:0
  11962. * Purpose: identifies this as HTT TX completion indication
  11963. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11964. * - status
  11965. * Bits 10:8
  11966. * Purpose: the TX completion status of payload fragmentations descriptors
  11967. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11968. * - tid
  11969. * Bits 14:11
  11970. * Purpose: the tid associated with those fragmentation descriptors. It is
  11971. * valid or not, depending on the tid_invalid bit.
  11972. * Value: 0 to 15
  11973. * - tid_invalid
  11974. * Bits 15:15
  11975. * Purpose: this bit indicates whether the tid field is valid or not
  11976. * Value: 0 indicates valid; 1 indicates invalid
  11977. * - num
  11978. * Bits 23:16
  11979. * Purpose: the number of payload in this indication
  11980. * Value: 1 to 255
  11981. * - append (a.k.a. append0)
  11982. * Bits 24:24
  11983. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11984. * the number of tx retries for one MSDU at the end of this message
  11985. * Value: 0 indicates no appending; 1 indicates appending
  11986. * - append1
  11987. * Bits 25:25
  11988. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11989. * contains the timestamp info for each TX msdu id in payload.
  11990. * The order of the timestamps matches the order of the MSDU IDs.
  11991. * Note that a big-endian host needs to account for the reordering
  11992. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11993. * conversion) when determining which tx timestamp corresponds to
  11994. * which MSDU ID.
  11995. * Value: 0 indicates no appending; 1 indicates appending
  11996. * - msdu_tx_power_presence
  11997. * Bits 26:26
  11998. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11999. * for each MSDU referenced by the TX_COMPL_IND message.
  12000. * The tx power is reported in 0.5 dBm units.
  12001. * The order of the per-MSDU tx power reports matches the order
  12002. * of the MSDU IDs.
  12003. * Note that a big-endian host needs to account for the reordering
  12004. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12005. * conversion) when determining which Tx Power corresponds to
  12006. * which MSDU ID.
  12007. * Value: 0 indicates MSDU tx power reports are not appended,
  12008. * 1 indicates MSDU tx power reports are appended
  12009. * - append2
  12010. * Bits 27:27
  12011. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12012. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12013. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12014. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12015. * for each MSDU, for convenience.
  12016. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12017. * this append2 bit is set).
  12018. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12019. * dB above the noise floor.
  12020. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12021. * 1 indicates MSDU ACK RSSI values are appended.
  12022. * - append3
  12023. * Bits 28:28
  12024. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12025. * contains the tx tsf info based on wlan global TSF for
  12026. * each TX msdu id in payload.
  12027. * The order of the tx tsf matches the order of the MSDU IDs.
  12028. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12029. * values to indicate the the lower 32 bits and higher 32 bits of
  12030. * the tx tsf.
  12031. * The tx_tsf64 here represents the time MSDU was acked and the
  12032. * tx_tsf64 has microseconds units.
  12033. * Value: 0 indicates no appending; 1 indicates appending
  12034. * - append4
  12035. * Bits 29:29
  12036. * Purpose: Indicate whether data frame control fields and fields required
  12037. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12038. * message. The order of the this message matches the order of
  12039. * the MSDU IDs.
  12040. * Value: 0 indicates frame control fields and fields required for
  12041. * radio tap header values are not appended,
  12042. * 1 indicates frame control fields and fields required for
  12043. * radio tap header values are appended.
  12044. * Payload fields:
  12045. * - hmsdu_id
  12046. * Bits 15:0
  12047. * Purpose: this ID is used to track the Tx buffer in host
  12048. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12049. */
  12050. PREPACK struct htt_tx_data_hdr_information {
  12051. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12052. A_UINT32 /* word 1 */
  12053. /* preamble:
  12054. * 0-OFDM,
  12055. * 1-CCk,
  12056. * 2-HT,
  12057. * 3-VHT
  12058. */
  12059. preamble: 2, /* [1:0] */
  12060. /* mcs:
  12061. * In case of HT preamble interpret
  12062. * MCS along with NSS.
  12063. * Valid values for HT are 0 to 7.
  12064. * HT mcs 0 with NSS 2 is mcs 8.
  12065. * Valid values for VHT are 0 to 9.
  12066. */
  12067. mcs: 4, /* [5:2] */
  12068. /* rate:
  12069. * This is applicable only for
  12070. * CCK and OFDM preamble type
  12071. * rate 0: OFDM 48 Mbps,
  12072. * 1: OFDM 24 Mbps,
  12073. * 2: OFDM 12 Mbps
  12074. * 3: OFDM 6 Mbps
  12075. * 4: OFDM 54 Mbps
  12076. * 5: OFDM 36 Mbps
  12077. * 6: OFDM 18 Mbps
  12078. * 7: OFDM 9 Mbps
  12079. * rate 0: CCK 11 Mbps Long
  12080. * 1: CCK 5.5 Mbps Long
  12081. * 2: CCK 2 Mbps Long
  12082. * 3: CCK 1 Mbps Long
  12083. * 4: CCK 11 Mbps Short
  12084. * 5: CCK 5.5 Mbps Short
  12085. * 6: CCK 2 Mbps Short
  12086. */
  12087. rate : 3, /* [ 8: 6] */
  12088. rssi : 8, /* [16: 9] units=dBm */
  12089. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12090. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12091. stbc : 1, /* [22] */
  12092. sgi : 1, /* [23] */
  12093. ldpc : 1, /* [24] */
  12094. beamformed: 1, /* [25] */
  12095. /* tx_retry_cnt:
  12096. * Indicates retry count of data tx frames provided by the host.
  12097. */
  12098. tx_retry_cnt: 6; /* [31:26] */
  12099. A_UINT32 /* word 2 */
  12100. framectrl:16, /* [15: 0] */
  12101. seqno:16; /* [31:16] */
  12102. } POSTPACK;
  12103. #define HTT_TX_COMPL_IND_STATUS_S 8
  12104. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12105. #define HTT_TX_COMPL_IND_TID_S 11
  12106. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12107. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12108. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12109. #define HTT_TX_COMPL_IND_NUM_S 16
  12110. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12111. #define HTT_TX_COMPL_IND_APPEND_S 24
  12112. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12113. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12114. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12115. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12116. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12117. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12118. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12119. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12120. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12121. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12122. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12123. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12124. do { \
  12125. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12126. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12127. } while (0)
  12128. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12129. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12130. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12131. do { \
  12132. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12133. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12134. } while (0)
  12135. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12136. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12137. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12138. do { \
  12139. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12140. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12141. } while (0)
  12142. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12143. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12144. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12145. do { \
  12146. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12147. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12148. } while (0)
  12149. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12150. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12151. HTT_TX_COMPL_IND_TID_INV_S)
  12152. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12153. do { \
  12154. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12155. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12156. } while (0)
  12157. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12158. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12159. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12160. do { \
  12161. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12162. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12163. } while (0)
  12164. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12165. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12166. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12167. do { \
  12168. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12169. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12170. } while (0)
  12171. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12172. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12173. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12174. do { \
  12175. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12176. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12177. } while (0)
  12178. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12179. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12180. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12181. do { \
  12182. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12183. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12184. } while (0)
  12185. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12186. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12187. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12188. do { \
  12189. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12190. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12191. } while (0)
  12192. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12193. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12194. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12195. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12196. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12197. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12198. #define HTT_TX_COMPL_IND_STAT_OK 0
  12199. /* DISCARD:
  12200. * current meaning:
  12201. * MSDUs were queued for transmission but filtered by HW or SW
  12202. * without any over the air attempts
  12203. * legacy meaning (HL Rome):
  12204. * MSDUs were discarded by the target FW without any over the air
  12205. * attempts due to lack of space
  12206. */
  12207. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12208. /* NO_ACK:
  12209. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12210. */
  12211. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12212. /* POSTPONE:
  12213. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12214. * be downloaded again later (in the appropriate order), when they are
  12215. * deliverable.
  12216. */
  12217. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12218. /*
  12219. * The PEER_DEL tx completion status is used for HL cases
  12220. * where the peer the frame is for has been deleted.
  12221. * The host has already discarded its copy of the frame, but
  12222. * it still needs the tx completion to restore its credit.
  12223. */
  12224. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12225. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12226. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12227. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12228. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12229. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12230. PREPACK struct htt_tx_compl_ind_base {
  12231. A_UINT32 hdr;
  12232. A_UINT16 payload[1/*or more*/];
  12233. } POSTPACK;
  12234. PREPACK struct htt_tx_compl_ind_append_retries {
  12235. A_UINT16 msdu_id;
  12236. A_UINT8 tx_retries;
  12237. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12238. 0: this is the last append_retries struct */
  12239. } POSTPACK;
  12240. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12241. A_UINT32 timestamp[1/*or more*/];
  12242. } POSTPACK;
  12243. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12244. A_UINT32 tx_tsf64_low;
  12245. A_UINT32 tx_tsf64_high;
  12246. } POSTPACK;
  12247. /* htt_tx_data_hdr_information payload extension fields: */
  12248. /* DWORD zero */
  12249. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12250. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12251. /* DWORD one */
  12252. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12253. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12254. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12255. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12256. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12257. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12258. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12259. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12260. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12261. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12262. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12263. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12264. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12265. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12266. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12267. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12268. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12269. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12270. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12271. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12272. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12273. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12274. /* DWORD two */
  12275. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12276. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12277. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12278. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12279. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12280. do { \
  12281. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12282. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12283. } while (0)
  12284. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12285. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12286. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12287. do { \
  12288. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12289. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12290. } while (0)
  12291. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12292. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12293. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12294. do { \
  12295. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12296. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12297. } while (0)
  12298. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12299. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12300. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12301. do { \
  12302. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12303. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12304. } while (0)
  12305. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12306. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12307. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12308. do { \
  12309. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12310. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12311. } while (0)
  12312. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12313. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12314. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12315. do { \
  12316. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12317. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12318. } while (0)
  12319. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12320. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12321. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12322. do { \
  12323. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12324. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12325. } while (0)
  12326. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12327. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12328. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12329. do { \
  12330. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12331. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12332. } while (0)
  12333. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12334. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12335. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12336. do { \
  12337. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12338. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12339. } while (0)
  12340. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12341. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12342. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12343. do { \
  12344. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12345. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12346. } while (0)
  12347. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12348. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12349. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12350. do { \
  12351. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12352. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12353. } while (0)
  12354. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12355. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12356. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12357. do { \
  12358. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12359. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12360. } while (0)
  12361. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12362. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12363. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12364. do { \
  12365. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12366. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12367. } while (0)
  12368. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12369. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12370. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12371. do { \
  12372. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12373. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12374. } while (0)
  12375. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12376. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12377. /**
  12378. * @brief target -> host rate-control update indication message
  12379. *
  12380. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12381. *
  12382. * @details
  12383. * The following diagram shows the format of the RC Update message
  12384. * sent from the target to the host, while processing the tx-completion
  12385. * of a transmitted PPDU.
  12386. *
  12387. * |31 24|23 16|15 8|7 0|
  12388. * |-------------------------------------------------------------|
  12389. * | peer ID | vdev ID | msg_type |
  12390. * |-------------------------------------------------------------|
  12391. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12392. * |-------------------------------------------------------------|
  12393. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12394. * |-------------------------------------------------------------|
  12395. * | : |
  12396. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12397. * | : |
  12398. * |-------------------------------------------------------------|
  12399. * | : |
  12400. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12401. * | : |
  12402. * |-------------------------------------------------------------|
  12403. * : :
  12404. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12405. *
  12406. */
  12407. typedef struct {
  12408. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12409. A_UINT32 rate_code_flags;
  12410. A_UINT32 flags; /* Encodes information such as excessive
  12411. retransmission, aggregate, some info
  12412. from .11 frame control,
  12413. STBC, LDPC, (SGI and Tx Chain Mask
  12414. are encoded in ptx_rc->flags field),
  12415. AMPDU truncation (BT/time based etc.),
  12416. RTS/CTS attempt */
  12417. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12418. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12419. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12420. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12421. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12422. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12423. } HTT_RC_TX_DONE_PARAMS;
  12424. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12425. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12426. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12427. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12428. #define HTT_RC_UPDATE_VDEVID_S 8
  12429. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12430. #define HTT_RC_UPDATE_PEERID_S 16
  12431. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12432. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12433. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12434. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12437. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12438. } while (0)
  12439. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12440. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12441. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12444. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12445. } while (0)
  12446. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12447. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12448. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12451. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12452. } while (0)
  12453. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12454. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12455. /**
  12456. * @brief target -> host rx fragment indication message definition
  12457. *
  12458. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12459. *
  12460. * @details
  12461. * The following field definitions describe the format of the rx fragment
  12462. * indication message sent from the target to the host.
  12463. * The rx fragment indication message shares the format of the
  12464. * rx indication message, but not all fields from the rx indication message
  12465. * are relevant to the rx fragment indication message.
  12466. *
  12467. *
  12468. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12469. * |-----------+-------------------+---------------------+-------------|
  12470. * | peer ID | |FV| ext TID | msg type |
  12471. * |-------------------------------------------------------------------|
  12472. * | | flush | flush |
  12473. * | | end | start |
  12474. * | | seq num | seq num |
  12475. * |-------------------------------------------------------------------|
  12476. * | reserved | FW rx desc bytes |
  12477. * |-------------------------------------------------------------------|
  12478. * | | FW MSDU Rx |
  12479. * | | desc B0 |
  12480. * |-------------------------------------------------------------------|
  12481. * Header fields:
  12482. * - MSG_TYPE
  12483. * Bits 7:0
  12484. * Purpose: identifies this as an rx fragment indication message
  12485. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12486. * - EXT_TID
  12487. * Bits 12:8
  12488. * Purpose: identify the traffic ID of the rx data, including
  12489. * special "extended" TID values for multicast, broadcast, and
  12490. * non-QoS data frames
  12491. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12492. * - FLUSH_VALID (FV)
  12493. * Bit 13
  12494. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12495. * is valid
  12496. * Value:
  12497. * 1 -> flush IE is valid and needs to be processed
  12498. * 0 -> flush IE is not valid and should be ignored
  12499. * - PEER_ID
  12500. * Bits 31:16
  12501. * Purpose: Identify, by ID, which peer sent the rx data
  12502. * Value: ID of the peer who sent the rx data
  12503. * - FLUSH_SEQ_NUM_START
  12504. * Bits 5:0
  12505. * Purpose: Indicate the start of a series of MPDUs to flush
  12506. * Not all MPDUs within this series are necessarily valid - the host
  12507. * must check each sequence number within this range to see if the
  12508. * corresponding MPDU is actually present.
  12509. * This field is only valid if the FV bit is set.
  12510. * Value:
  12511. * The sequence number for the first MPDUs to check to flush.
  12512. * The sequence number is masked by 0x3f.
  12513. * - FLUSH_SEQ_NUM_END
  12514. * Bits 11:6
  12515. * Purpose: Indicate the end of a series of MPDUs to flush
  12516. * Value:
  12517. * The sequence number one larger than the sequence number of the
  12518. * last MPDU to check to flush.
  12519. * The sequence number is masked by 0x3f.
  12520. * Not all MPDUs within this series are necessarily valid - the host
  12521. * must check each sequence number within this range to see if the
  12522. * corresponding MPDU is actually present.
  12523. * This field is only valid if the FV bit is set.
  12524. * Rx descriptor fields:
  12525. * - FW_RX_DESC_BYTES
  12526. * Bits 15:0
  12527. * Purpose: Indicate how many bytes in the Rx indication are used for
  12528. * FW Rx descriptors
  12529. * Value: 1
  12530. */
  12531. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12532. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12533. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12534. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12535. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12536. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12537. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12538. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12539. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12540. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12541. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12542. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12543. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12544. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12545. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12546. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12547. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12548. #define HTT_RX_FRAG_IND_BYTES \
  12549. (4 /* msg hdr */ + \
  12550. 4 /* flush spec */ + \
  12551. 4 /* (unused) FW rx desc bytes spec */ + \
  12552. 4 /* FW rx desc */)
  12553. /**
  12554. * @brief target -> host test message definition
  12555. *
  12556. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12557. *
  12558. * @details
  12559. * The following field definitions describe the format of the test
  12560. * message sent from the target to the host.
  12561. * The message consists of a 4-octet header, followed by a variable
  12562. * number of 32-bit integer values, followed by a variable number
  12563. * of 8-bit character values.
  12564. *
  12565. * |31 16|15 8|7 0|
  12566. * |-----------------------------------------------------------|
  12567. * | num chars | num ints | msg type |
  12568. * |-----------------------------------------------------------|
  12569. * | int 0 |
  12570. * |-----------------------------------------------------------|
  12571. * | int 1 |
  12572. * |-----------------------------------------------------------|
  12573. * | ... |
  12574. * |-----------------------------------------------------------|
  12575. * | char 3 | char 2 | char 1 | char 0 |
  12576. * |-----------------------------------------------------------|
  12577. * | | | ... | char 4 |
  12578. * |-----------------------------------------------------------|
  12579. * - MSG_TYPE
  12580. * Bits 7:0
  12581. * Purpose: identifies this as a test message
  12582. * Value: HTT_MSG_TYPE_TEST
  12583. * - NUM_INTS
  12584. * Bits 15:8
  12585. * Purpose: indicate how many 32-bit integers follow the message header
  12586. * - NUM_CHARS
  12587. * Bits 31:16
  12588. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12589. */
  12590. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12591. #define HTT_RX_TEST_NUM_INTS_S 8
  12592. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12593. #define HTT_RX_TEST_NUM_CHARS_S 16
  12594. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12595. do { \
  12596. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12597. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12598. } while (0)
  12599. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12600. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12601. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12602. do { \
  12603. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12604. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12605. } while (0)
  12606. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12607. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12608. /**
  12609. * @brief target -> host packet log message
  12610. *
  12611. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12612. *
  12613. * @details
  12614. * The following field definitions describe the format of the packet log
  12615. * message sent from the target to the host.
  12616. * The message consists of a 4-octet header,followed by a variable number
  12617. * of 32-bit character values.
  12618. *
  12619. * |31 16|15 12|11 10|9 8|7 0|
  12620. * |------------------------------------------------------------------|
  12621. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12622. * |------------------------------------------------------------------|
  12623. * | payload |
  12624. * |------------------------------------------------------------------|
  12625. * - MSG_TYPE
  12626. * Bits 7:0
  12627. * Purpose: identifies this as a pktlog message
  12628. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12629. * - mac_id
  12630. * Bits 9:8
  12631. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12632. * Value: 0-3
  12633. * - pdev_id
  12634. * Bits 11:10
  12635. * Purpose: pdev_id
  12636. * Value: 0-3
  12637. * 0 (for rings at SOC level),
  12638. * 1/2/3 PDEV -> 0/1/2
  12639. * - payload_size
  12640. * Bits 31:16
  12641. * Purpose: explicitly specify the payload size
  12642. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12643. */
  12644. PREPACK struct htt_pktlog_msg {
  12645. A_UINT32 header;
  12646. A_UINT32 payload[1/* or more */];
  12647. } POSTPACK;
  12648. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12649. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12650. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12651. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12652. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12653. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12654. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12655. do { \
  12656. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12657. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12658. } while (0)
  12659. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12660. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12661. HTT_T2H_PKTLOG_MAC_ID_S)
  12662. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12663. do { \
  12664. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12665. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12666. } while (0)
  12667. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12668. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12669. HTT_T2H_PKTLOG_PDEV_ID_S)
  12670. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12671. do { \
  12672. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12673. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12674. } while (0)
  12675. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12676. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12677. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12678. /*
  12679. * Rx reorder statistics
  12680. * NB: all the fields must be defined in 4 octets size.
  12681. */
  12682. struct rx_reorder_stats {
  12683. /* Non QoS MPDUs received */
  12684. A_UINT32 deliver_non_qos;
  12685. /* MPDUs received in-order */
  12686. A_UINT32 deliver_in_order;
  12687. /* Flush due to reorder timer expired */
  12688. A_UINT32 deliver_flush_timeout;
  12689. /* Flush due to move out of window */
  12690. A_UINT32 deliver_flush_oow;
  12691. /* Flush due to DELBA */
  12692. A_UINT32 deliver_flush_delba;
  12693. /* MPDUs dropped due to FCS error */
  12694. A_UINT32 fcs_error;
  12695. /* MPDUs dropped due to monitor mode non-data packet */
  12696. A_UINT32 mgmt_ctrl;
  12697. /* Unicast-data MPDUs dropped due to invalid peer */
  12698. A_UINT32 invalid_peer;
  12699. /* MPDUs dropped due to duplication (non aggregation) */
  12700. A_UINT32 dup_non_aggr;
  12701. /* MPDUs dropped due to processed before */
  12702. A_UINT32 dup_past;
  12703. /* MPDUs dropped due to duplicate in reorder queue */
  12704. A_UINT32 dup_in_reorder;
  12705. /* Reorder timeout happened */
  12706. A_UINT32 reorder_timeout;
  12707. /* invalid bar ssn */
  12708. A_UINT32 invalid_bar_ssn;
  12709. /* reorder reset due to bar ssn */
  12710. A_UINT32 ssn_reset;
  12711. /* Flush due to delete peer */
  12712. A_UINT32 deliver_flush_delpeer;
  12713. /* Flush due to offload*/
  12714. A_UINT32 deliver_flush_offload;
  12715. /* Flush due to out of buffer*/
  12716. A_UINT32 deliver_flush_oob;
  12717. /* MPDUs dropped due to PN check fail */
  12718. A_UINT32 pn_fail;
  12719. /* MPDUs dropped due to unable to allocate memory */
  12720. A_UINT32 store_fail;
  12721. /* Number of times the tid pool alloc succeeded */
  12722. A_UINT32 tid_pool_alloc_succ;
  12723. /* Number of times the MPDU pool alloc succeeded */
  12724. A_UINT32 mpdu_pool_alloc_succ;
  12725. /* Number of times the MSDU pool alloc succeeded */
  12726. A_UINT32 msdu_pool_alloc_succ;
  12727. /* Number of times the tid pool alloc failed */
  12728. A_UINT32 tid_pool_alloc_fail;
  12729. /* Number of times the MPDU pool alloc failed */
  12730. A_UINT32 mpdu_pool_alloc_fail;
  12731. /* Number of times the MSDU pool alloc failed */
  12732. A_UINT32 msdu_pool_alloc_fail;
  12733. /* Number of times the tid pool freed */
  12734. A_UINT32 tid_pool_free;
  12735. /* Number of times the MPDU pool freed */
  12736. A_UINT32 mpdu_pool_free;
  12737. /* Number of times the MSDU pool freed */
  12738. A_UINT32 msdu_pool_free;
  12739. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12740. A_UINT32 msdu_queued;
  12741. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12742. A_UINT32 msdu_recycled;
  12743. /* Number of MPDUs with invalid peer but A2 found in AST */
  12744. A_UINT32 invalid_peer_a2_in_ast;
  12745. /* Number of MPDUs with invalid peer but A3 found in AST */
  12746. A_UINT32 invalid_peer_a3_in_ast;
  12747. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12748. A_UINT32 invalid_peer_bmc_mpdus;
  12749. /* Number of MSDUs with err attention word */
  12750. A_UINT32 rxdesc_err_att;
  12751. /* Number of MSDUs with flag of peer_idx_invalid */
  12752. A_UINT32 rxdesc_err_peer_idx_inv;
  12753. /* Number of MSDUs with flag of peer_idx_timeout */
  12754. A_UINT32 rxdesc_err_peer_idx_to;
  12755. /* Number of MSDUs with flag of overflow */
  12756. A_UINT32 rxdesc_err_ov;
  12757. /* Number of MSDUs with flag of msdu_length_err */
  12758. A_UINT32 rxdesc_err_msdu_len;
  12759. /* Number of MSDUs with flag of mpdu_length_err */
  12760. A_UINT32 rxdesc_err_mpdu_len;
  12761. /* Number of MSDUs with flag of tkip_mic_err */
  12762. A_UINT32 rxdesc_err_tkip_mic;
  12763. /* Number of MSDUs with flag of decrypt_err */
  12764. A_UINT32 rxdesc_err_decrypt;
  12765. /* Number of MSDUs with flag of fcs_err */
  12766. A_UINT32 rxdesc_err_fcs;
  12767. /* Number of Unicast (bc_mc bit is not set in attention word)
  12768. * frames with invalid peer handler
  12769. */
  12770. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12771. /* Number of unicast frame directly (direct bit is set in attention word)
  12772. * to DUT with invalid peer handler
  12773. */
  12774. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12775. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12776. * frames with invalid peer handler
  12777. */
  12778. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12779. /* Number of MSDUs dropped due to no first MSDU flag */
  12780. A_UINT32 rxdesc_no_1st_msdu;
  12781. /* Number of MSDUs droped due to ring overflow */
  12782. A_UINT32 msdu_drop_ring_ov;
  12783. /* Number of MSDUs dropped due to FC mismatch */
  12784. A_UINT32 msdu_drop_fc_mismatch;
  12785. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12786. A_UINT32 msdu_drop_mgmt_remote_ring;
  12787. /* Number of MSDUs dropped due to errors not reported in attention word */
  12788. A_UINT32 msdu_drop_misc;
  12789. /* Number of MSDUs go to offload before reorder */
  12790. A_UINT32 offload_msdu_wal;
  12791. /* Number of data frame dropped by offload after reorder */
  12792. A_UINT32 offload_msdu_reorder;
  12793. /* Number of MPDUs with sequence number in the past and within the BA window */
  12794. A_UINT32 dup_past_within_window;
  12795. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12796. A_UINT32 dup_past_outside_window;
  12797. /* Number of MSDUs with decrypt/MIC error */
  12798. A_UINT32 rxdesc_err_decrypt_mic;
  12799. /* Number of data MSDUs received on both local and remote rings */
  12800. A_UINT32 data_msdus_on_both_rings;
  12801. /* MPDUs never filled */
  12802. A_UINT32 holes_not_filled;
  12803. };
  12804. /*
  12805. * Rx Remote buffer statistics
  12806. * NB: all the fields must be defined in 4 octets size.
  12807. */
  12808. struct rx_remote_buffer_mgmt_stats {
  12809. /* Total number of MSDUs reaped for Rx processing */
  12810. A_UINT32 remote_reaped;
  12811. /* MSDUs recycled within firmware */
  12812. A_UINT32 remote_recycled;
  12813. /* MSDUs stored by Data Rx */
  12814. A_UINT32 data_rx_msdus_stored;
  12815. /* Number of HTT indications from WAL Rx MSDU */
  12816. A_UINT32 wal_rx_ind;
  12817. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12818. A_UINT32 wal_rx_ind_unconsumed;
  12819. /* Number of HTT indications from Data Rx MSDU */
  12820. A_UINT32 data_rx_ind;
  12821. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12822. A_UINT32 data_rx_ind_unconsumed;
  12823. /* Number of HTT indications from ATHBUF */
  12824. A_UINT32 athbuf_rx_ind;
  12825. /* Number of remote buffers requested for refill */
  12826. A_UINT32 refill_buf_req;
  12827. /* Number of remote buffers filled by the host */
  12828. A_UINT32 refill_buf_rsp;
  12829. /* Number of times MAC hw_index = f/w write_index */
  12830. A_INT32 mac_no_bufs;
  12831. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12832. A_INT32 fw_indices_equal;
  12833. /* Number of times f/w finds no buffers to post */
  12834. A_INT32 host_no_bufs;
  12835. };
  12836. /*
  12837. * TXBF MU/SU packets and NDPA statistics
  12838. * NB: all the fields must be defined in 4 octets size.
  12839. */
  12840. struct rx_txbf_musu_ndpa_pkts_stats {
  12841. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12842. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12843. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12844. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12845. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12846. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12847. };
  12848. /*
  12849. * htt_dbg_stats_status -
  12850. * present - The requested stats have been delivered in full.
  12851. * This indicates that either the stats information was contained
  12852. * in its entirety within this message, or else this message
  12853. * completes the delivery of the requested stats info that was
  12854. * partially delivered through earlier STATS_CONF messages.
  12855. * partial - The requested stats have been delivered in part.
  12856. * One or more subsequent STATS_CONF messages with the same
  12857. * cookie value will be sent to deliver the remainder of the
  12858. * information.
  12859. * error - The requested stats could not be delivered, for example due
  12860. * to a shortage of memory to construct a message holding the
  12861. * requested stats.
  12862. * invalid - The requested stat type is either not recognized, or the
  12863. * target is configured to not gather the stats type in question.
  12864. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12865. * series_done - This special value indicates that no further stats info
  12866. * elements are present within a series of stats info elems
  12867. * (within a stats upload confirmation message).
  12868. */
  12869. enum htt_dbg_stats_status {
  12870. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12871. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12872. HTT_DBG_STATS_STATUS_ERROR = 2,
  12873. HTT_DBG_STATS_STATUS_INVALID = 3,
  12874. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12875. };
  12876. /**
  12877. * @brief target -> host statistics upload
  12878. *
  12879. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12880. *
  12881. * @details
  12882. * The following field definitions describe the format of the HTT target
  12883. * to host stats upload confirmation message.
  12884. * The message contains a cookie echoed from the HTT host->target stats
  12885. * upload request, which identifies which request the confirmation is
  12886. * for, and a series of tag-length-value stats information elements.
  12887. * The tag-length header for each stats info element also includes a
  12888. * status field, to indicate whether the request for the stat type in
  12889. * question was fully met, partially met, unable to be met, or invalid
  12890. * (if the stat type in question is disabled in the target).
  12891. * A special value of all 1's in this status field is used to indicate
  12892. * the end of the series of stats info elements.
  12893. *
  12894. *
  12895. * |31 16|15 8|7 5|4 0|
  12896. * |------------------------------------------------------------|
  12897. * | reserved | msg type |
  12898. * |------------------------------------------------------------|
  12899. * | cookie LSBs |
  12900. * |------------------------------------------------------------|
  12901. * | cookie MSBs |
  12902. * |------------------------------------------------------------|
  12903. * | stats entry length | reserved | S |stat type|
  12904. * |------------------------------------------------------------|
  12905. * | |
  12906. * | type-specific stats info |
  12907. * | |
  12908. * |------------------------------------------------------------|
  12909. * | stats entry length | reserved | S |stat type|
  12910. * |------------------------------------------------------------|
  12911. * | |
  12912. * | type-specific stats info |
  12913. * | |
  12914. * |------------------------------------------------------------|
  12915. * | n/a | reserved | 111 | n/a |
  12916. * |------------------------------------------------------------|
  12917. * Header fields:
  12918. * - MSG_TYPE
  12919. * Bits 7:0
  12920. * Purpose: identifies this is a statistics upload confirmation message
  12921. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12922. * - COOKIE_LSBS
  12923. * Bits 31:0
  12924. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12925. * message with its preceding host->target stats request message.
  12926. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12927. * - COOKIE_MSBS
  12928. * Bits 31:0
  12929. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12930. * message with its preceding host->target stats request message.
  12931. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12932. *
  12933. * Stats Information Element tag-length header fields:
  12934. * - STAT_TYPE
  12935. * Bits 4:0
  12936. * Purpose: identifies the type of statistics info held in the
  12937. * following information element
  12938. * Value: htt_dbg_stats_type
  12939. * - STATUS
  12940. * Bits 7:5
  12941. * Purpose: indicate whether the requested stats are present
  12942. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12943. * the completion of the stats entry series
  12944. * - LENGTH
  12945. * Bits 31:16
  12946. * Purpose: indicate the stats information size
  12947. * Value: This field specifies the number of bytes of stats information
  12948. * that follows the element tag-length header.
  12949. * It is expected but not required that this length is a multiple of
  12950. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12951. * subsequent stats entry header will begin on a 4-byte aligned
  12952. * boundary.
  12953. */
  12954. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12955. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12956. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12957. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12958. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12959. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12960. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12961. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12962. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12963. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12964. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12965. do { \
  12966. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12967. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12968. } while (0)
  12969. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12970. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12971. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12972. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12973. do { \
  12974. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12975. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12976. } while (0)
  12977. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12978. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12979. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12980. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12981. do { \
  12982. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12983. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12984. } while (0)
  12985. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12986. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12987. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12988. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12989. #define HTT_MAX_AGGR 64
  12990. #define HTT_HL_MAX_AGGR 18
  12991. /**
  12992. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12993. *
  12994. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12995. *
  12996. * @details
  12997. * The following field definitions describe the format of the HTT host
  12998. * to target frag_desc/msdu_ext bank configuration message.
  12999. * The message contains the based address and the min and max id of the
  13000. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13001. * MSDU_EXT/FRAG_DESC.
  13002. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13003. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13004. * the hardware does the mapping/translation.
  13005. *
  13006. * Total banks that can be configured is configured to 16.
  13007. *
  13008. * This should be called before any TX has be initiated by the HTT
  13009. *
  13010. * |31 16|15 8|7 5|4 0|
  13011. * |------------------------------------------------------------|
  13012. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13013. * |------------------------------------------------------------|
  13014. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13015. #if HTT_PADDR64
  13016. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13017. #endif
  13018. * |------------------------------------------------------------|
  13019. * | ... |
  13020. * |------------------------------------------------------------|
  13021. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13022. #if HTT_PADDR64
  13023. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13024. #endif
  13025. * |------------------------------------------------------------|
  13026. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13027. * |------------------------------------------------------------|
  13028. * | ... |
  13029. * |------------------------------------------------------------|
  13030. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13031. * |------------------------------------------------------------|
  13032. * Header fields:
  13033. * - MSG_TYPE
  13034. * Bits 7:0
  13035. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13036. * for systems with 64-bit format for bus addresses:
  13037. * - BANKx_BASE_ADDRESS_LO
  13038. * Bits 31:0
  13039. * Purpose: Provide a mechanism to specify the base address of the
  13040. * MSDU_EXT bank physical/bus address.
  13041. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13042. * - BANKx_BASE_ADDRESS_HI
  13043. * Bits 31:0
  13044. * Purpose: Provide a mechanism to specify the base address of the
  13045. * MSDU_EXT bank physical/bus address.
  13046. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13047. * for systems with 32-bit format for bus addresses:
  13048. * - BANKx_BASE_ADDRESS
  13049. * Bits 31:0
  13050. * Purpose: Provide a mechanism to specify the base address of the
  13051. * MSDU_EXT bank physical/bus address.
  13052. * Value: MSDU_EXT bank physical / bus address
  13053. * - BANKx_MIN_ID
  13054. * Bits 15:0
  13055. * Purpose: Provide a mechanism to specify the min index that needs to
  13056. * mapped.
  13057. * - BANKx_MAX_ID
  13058. * Bits 31:16
  13059. * Purpose: Provide a mechanism to specify the max index that needs to
  13060. * mapped.
  13061. *
  13062. */
  13063. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13064. * safe value.
  13065. * @note MAX supported banks is 16.
  13066. */
  13067. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13068. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13069. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13070. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13071. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13072. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13073. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13074. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13075. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13076. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13077. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13078. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13079. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13080. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13081. do { \
  13082. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13083. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13084. } while (0)
  13085. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13086. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13087. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13088. do { \
  13089. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13090. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13091. } while (0)
  13092. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13093. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13094. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13095. do { \
  13096. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13097. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13098. } while (0)
  13099. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13100. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13101. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13102. do { \
  13103. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13104. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13105. } while (0)
  13106. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13107. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13108. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13109. do { \
  13110. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13111. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13112. } while (0)
  13113. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13114. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13115. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13116. do { \
  13117. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13118. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13119. } while (0)
  13120. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13121. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13122. /*
  13123. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13124. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13125. * addresses are stored in a XXX-bit field.
  13126. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13127. * htt_tx_frag_desc64_bank_cfg_t structs.
  13128. */
  13129. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13130. _paddr_bits_, \
  13131. _paddr__bank_base_address_) \
  13132. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13133. /** word 0 \
  13134. * msg_type: 8, \
  13135. * pdev_id: 2, \
  13136. * swap: 1, \
  13137. * reserved0: 5, \
  13138. * num_banks: 8, \
  13139. * desc_size: 8; \
  13140. */ \
  13141. A_UINT32 word0; \
  13142. /* \
  13143. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13144. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13145. * the second A_UINT32). \
  13146. */ \
  13147. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13148. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13149. } POSTPACK
  13150. /* define htt_tx_frag_desc32_bank_cfg_t */
  13151. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13152. /* define htt_tx_frag_desc64_bank_cfg_t */
  13153. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13154. /*
  13155. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13156. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13157. */
  13158. #if HTT_PADDR64
  13159. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13160. #else
  13161. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13162. #endif
  13163. /**
  13164. * @brief target -> host HTT TX Credit total count update message definition
  13165. *
  13166. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13167. *
  13168. *|31 16|15|14 9| 8 |7 0 |
  13169. *|---------------------+--+----------+-------+----------|
  13170. *|cur htt credit delta | Q| reserved | sign | msg type |
  13171. *|------------------------------------------------------|
  13172. *
  13173. * Header fields:
  13174. * - MSG_TYPE
  13175. * Bits 7:0
  13176. * Purpose: identifies this as a htt tx credit delta update message
  13177. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13178. * - SIGN
  13179. * Bits 8
  13180. * identifies whether credit delta is positive or negative
  13181. * Value:
  13182. * - 0x0: credit delta is positive, rebalance in some buffers
  13183. * - 0x1: credit delta is negative, rebalance out some buffers
  13184. * - reserved
  13185. * Bits 14:9
  13186. * Value: 0x0
  13187. * - TXQ_GRP
  13188. * Bit 15
  13189. * Purpose: indicates whether any tx queue group information elements
  13190. * are appended to the tx credit update message
  13191. * Value: 0 -> no tx queue group information element is present
  13192. * 1 -> a tx queue group information element immediately follows
  13193. * - DELTA_COUNT
  13194. * Bits 31:16
  13195. * Purpose: Specify current htt credit delta absolute count
  13196. */
  13197. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13198. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13199. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13200. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13201. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13202. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13203. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13204. do { \
  13205. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13206. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13207. } while (0)
  13208. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13209. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13210. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13211. do { \
  13212. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13213. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13214. } while (0)
  13215. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13216. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13217. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13218. do { \
  13219. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13220. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13221. } while (0)
  13222. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13223. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13224. #define HTT_TX_CREDIT_MSG_BYTES 4
  13225. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13226. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13227. /**
  13228. * @brief HTT WDI_IPA Operation Response Message
  13229. *
  13230. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13231. *
  13232. * @details
  13233. * HTT WDI_IPA Operation Response message is sent by target
  13234. * to host confirming suspend or resume operation.
  13235. * |31 24|23 16|15 8|7 0|
  13236. * |----------------+----------------+----------------+----------------|
  13237. * | op_code | Rsvd | msg_type |
  13238. * |-------------------------------------------------------------------|
  13239. * | Rsvd | Response len |
  13240. * |-------------------------------------------------------------------|
  13241. * | |
  13242. * | Response-type specific info |
  13243. * | |
  13244. * | |
  13245. * |-------------------------------------------------------------------|
  13246. * Header fields:
  13247. * - MSG_TYPE
  13248. * Bits 7:0
  13249. * Purpose: Identifies this as WDI_IPA Operation Response message
  13250. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13251. * - OP_CODE
  13252. * Bits 31:16
  13253. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13254. * value: = enum htt_wdi_ipa_op_code
  13255. * - RSP_LEN
  13256. * Bits 16:0
  13257. * Purpose: length for the response-type specific info
  13258. * value: = length in bytes for response-type specific info
  13259. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13260. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13261. */
  13262. PREPACK struct htt_wdi_ipa_op_response_t
  13263. {
  13264. /* DWORD 0: flags and meta-data */
  13265. A_UINT32
  13266. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13267. reserved1: 8,
  13268. op_code: 16;
  13269. A_UINT32
  13270. rsp_len: 16,
  13271. reserved2: 16;
  13272. } POSTPACK;
  13273. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13274. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13275. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13276. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13277. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13278. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13279. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13280. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13281. do { \
  13282. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13283. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13284. } while (0)
  13285. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13286. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13287. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13288. do { \
  13289. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13290. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13291. } while (0)
  13292. enum htt_phy_mode {
  13293. htt_phy_mode_11a = 0,
  13294. htt_phy_mode_11g = 1,
  13295. htt_phy_mode_11b = 2,
  13296. htt_phy_mode_11g_only = 3,
  13297. htt_phy_mode_11na_ht20 = 4,
  13298. htt_phy_mode_11ng_ht20 = 5,
  13299. htt_phy_mode_11na_ht40 = 6,
  13300. htt_phy_mode_11ng_ht40 = 7,
  13301. htt_phy_mode_11ac_vht20 = 8,
  13302. htt_phy_mode_11ac_vht40 = 9,
  13303. htt_phy_mode_11ac_vht80 = 10,
  13304. htt_phy_mode_11ac_vht20_2g = 11,
  13305. htt_phy_mode_11ac_vht40_2g = 12,
  13306. htt_phy_mode_11ac_vht80_2g = 13,
  13307. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13308. htt_phy_mode_11ac_vht160 = 15,
  13309. htt_phy_mode_max,
  13310. };
  13311. /**
  13312. * @brief target -> host HTT channel change indication
  13313. *
  13314. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13315. *
  13316. * @details
  13317. * Specify when a channel change occurs.
  13318. * This allows the host to precisely determine which rx frames arrived
  13319. * on the old channel and which rx frames arrived on the new channel.
  13320. *
  13321. *|31 |7 0 |
  13322. *|-------------------------------------------+----------|
  13323. *| reserved | msg type |
  13324. *|------------------------------------------------------|
  13325. *| primary_chan_center_freq_mhz |
  13326. *|------------------------------------------------------|
  13327. *| contiguous_chan1_center_freq_mhz |
  13328. *|------------------------------------------------------|
  13329. *| contiguous_chan2_center_freq_mhz |
  13330. *|------------------------------------------------------|
  13331. *| phy_mode |
  13332. *|------------------------------------------------------|
  13333. *
  13334. * Header fields:
  13335. * - MSG_TYPE
  13336. * Bits 7:0
  13337. * Purpose: identifies this as a htt channel change indication message
  13338. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13339. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13340. * Bits 31:0
  13341. * Purpose: identify the (center of the) new 20 MHz primary channel
  13342. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13343. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13344. * Bits 31:0
  13345. * Purpose: identify the (center of the) contiguous frequency range
  13346. * comprising the new channel.
  13347. * For example, if the new channel is a 80 MHz channel extending
  13348. * 60 MHz beyond the primary channel, this field would be 30 larger
  13349. * than the primary channel center frequency field.
  13350. * Value: center frequency of the contiguous frequency range comprising
  13351. * the full channel in MHz units
  13352. * (80+80 channels also use the CONTIG_CHAN2 field)
  13353. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13354. * Bits 31:0
  13355. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13356. * within a VHT 80+80 channel.
  13357. * This field is only relevant for VHT 80+80 channels.
  13358. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13359. * channel (arbitrary value for cases besides VHT 80+80)
  13360. * - PHY_MODE
  13361. * Bits 31:0
  13362. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13363. * and band
  13364. * Value: htt_phy_mode enum value
  13365. */
  13366. PREPACK struct htt_chan_change_t
  13367. {
  13368. /* DWORD 0: flags and meta-data */
  13369. A_UINT32
  13370. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13371. reserved1: 24;
  13372. A_UINT32 primary_chan_center_freq_mhz;
  13373. A_UINT32 contig_chan1_center_freq_mhz;
  13374. A_UINT32 contig_chan2_center_freq_mhz;
  13375. A_UINT32 phy_mode;
  13376. } POSTPACK;
  13377. /*
  13378. * Due to historical / backwards-compatibility reasons, maintain the
  13379. * below htt_chan_change_msg struct definition, which needs to be
  13380. * consistent with the above htt_chan_change_t struct definition
  13381. * (aside from the htt_chan_change_t definition including the msg_type
  13382. * dword within the message, and the htt_chan_change_msg only containing
  13383. * the payload of the message that follows the msg_type dword).
  13384. */
  13385. PREPACK struct htt_chan_change_msg {
  13386. A_UINT32 chan_mhz; /* frequency in mhz */
  13387. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13388. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13389. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13390. } POSTPACK;
  13391. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13392. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13393. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13394. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13395. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13396. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13397. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13398. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13399. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13400. do { \
  13401. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13402. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13403. } while (0)
  13404. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13405. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13406. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13407. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13408. do { \
  13409. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13410. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13411. } while (0)
  13412. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13413. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13414. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13415. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13416. do { \
  13417. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13418. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13419. } while (0)
  13420. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13421. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13422. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13423. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13424. do { \
  13425. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13426. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13427. } while (0)
  13428. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13429. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13430. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13431. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13432. /**
  13433. * @brief rx offload packet error message
  13434. *
  13435. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13436. *
  13437. * @details
  13438. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13439. * of target payload like mic err.
  13440. *
  13441. * |31 24|23 16|15 8|7 0|
  13442. * |----------------+----------------+----------------+----------------|
  13443. * | tid | vdev_id | msg_sub_type | msg_type |
  13444. * |-------------------------------------------------------------------|
  13445. * : (sub-type dependent content) :
  13446. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13447. * Header fields:
  13448. * - msg_type
  13449. * Bits 7:0
  13450. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13451. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13452. * - msg_sub_type
  13453. * Bits 15:8
  13454. * Purpose: Identifies which type of rx error is reported by this message
  13455. * value: htt_rx_ofld_pkt_err_type
  13456. * - vdev_id
  13457. * Bits 23:16
  13458. * Purpose: Identifies which vdev received the erroneous rx frame
  13459. * value:
  13460. * - tid
  13461. * Bits 31:24
  13462. * Purpose: Identifies the traffic type of the rx frame
  13463. * value:
  13464. *
  13465. * - The payload fields used if the sub-type == MIC error are shown below.
  13466. * Note - MIC err is per MSDU, while PN is per MPDU.
  13467. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13468. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13469. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13470. * instead of sending separate HTT messages for each wrong MSDU within
  13471. * the MPDU.
  13472. *
  13473. * |31 24|23 16|15 8|7 0|
  13474. * |----------------+----------------+----------------+----------------|
  13475. * | Rsvd | key_id | peer_id |
  13476. * |-------------------------------------------------------------------|
  13477. * | receiver MAC addr 31:0 |
  13478. * |-------------------------------------------------------------------|
  13479. * | Rsvd | receiver MAC addr 47:32 |
  13480. * |-------------------------------------------------------------------|
  13481. * | transmitter MAC addr 31:0 |
  13482. * |-------------------------------------------------------------------|
  13483. * | Rsvd | transmitter MAC addr 47:32 |
  13484. * |-------------------------------------------------------------------|
  13485. * | PN 31:0 |
  13486. * |-------------------------------------------------------------------|
  13487. * | Rsvd | PN 47:32 |
  13488. * |-------------------------------------------------------------------|
  13489. * - peer_id
  13490. * Bits 15:0
  13491. * Purpose: identifies which peer is frame is from
  13492. * value:
  13493. * - key_id
  13494. * Bits 23:16
  13495. * Purpose: identifies key_id of rx frame
  13496. * value:
  13497. * - RA_31_0 (receiver MAC addr 31:0)
  13498. * Bits 31:0
  13499. * Purpose: identifies by MAC address which vdev received the frame
  13500. * value: MAC address lower 4 bytes
  13501. * - RA_47_32 (receiver MAC addr 47:32)
  13502. * Bits 15:0
  13503. * Purpose: identifies by MAC address which vdev received the frame
  13504. * value: MAC address upper 2 bytes
  13505. * - TA_31_0 (transmitter MAC addr 31:0)
  13506. * Bits 31:0
  13507. * Purpose: identifies by MAC address which peer transmitted the frame
  13508. * value: MAC address lower 4 bytes
  13509. * - TA_47_32 (transmitter MAC addr 47:32)
  13510. * Bits 15:0
  13511. * Purpose: identifies by MAC address which peer transmitted the frame
  13512. * value: MAC address upper 2 bytes
  13513. * - PN_31_0
  13514. * Bits 31:0
  13515. * Purpose: Identifies pn of rx frame
  13516. * value: PN lower 4 bytes
  13517. * - PN_47_32
  13518. * Bits 15:0
  13519. * Purpose: Identifies pn of rx frame
  13520. * value:
  13521. * TKIP or CCMP: PN upper 2 bytes
  13522. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13523. */
  13524. enum htt_rx_ofld_pkt_err_type {
  13525. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13526. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13527. };
  13528. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13529. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13530. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13531. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13532. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13533. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13534. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13535. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13536. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13537. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13538. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13539. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13540. do { \
  13541. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13542. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13543. } while (0)
  13544. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13545. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13546. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13547. do { \
  13548. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13549. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13550. } while (0)
  13551. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13552. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13553. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13554. do { \
  13555. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13556. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13557. } while (0)
  13558. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13560. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13561. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13562. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13563. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13577. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13578. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13580. do { \
  13581. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13582. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13583. } while (0)
  13584. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13585. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13586. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13587. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13588. do { \
  13589. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13590. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13591. } while (0)
  13592. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13593. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13594. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13595. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13596. do { \
  13597. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13598. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13599. } while (0)
  13600. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13601. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13602. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13603. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13604. do { \
  13605. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13606. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13607. } while (0)
  13608. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13609. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13610. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13612. do { \
  13613. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13614. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13615. } while (0)
  13616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13617. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13618. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13620. do { \
  13621. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13622. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13623. } while (0)
  13624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13625. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13626. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13628. do { \
  13629. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13630. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13631. } while (0)
  13632. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13633. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13634. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13635. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13636. do { \
  13637. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13638. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13639. } while (0)
  13640. /**
  13641. * @brief target -> host peer rate report message
  13642. *
  13643. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13644. *
  13645. * @details
  13646. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13647. * justified rate of all the peers.
  13648. *
  13649. * |31 24|23 16|15 8|7 0|
  13650. * |----------------+----------------+----------------+----------------|
  13651. * | peer_count | | msg_type |
  13652. * |-------------------------------------------------------------------|
  13653. * : Payload (variant number of peer rate report) :
  13654. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13655. * Header fields:
  13656. * - msg_type
  13657. * Bits 7:0
  13658. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13659. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13660. * - reserved
  13661. * Bits 15:8
  13662. * Purpose:
  13663. * value:
  13664. * - peer_count
  13665. * Bits 31:16
  13666. * Purpose: Specify how many peer rate report elements are present in the payload.
  13667. * value:
  13668. *
  13669. * Payload:
  13670. * There are variant number of peer rate report follow the first 32 bits.
  13671. * The peer rate report is defined as follows.
  13672. *
  13673. * |31 20|19 16|15 0|
  13674. * |-----------------------+---------+---------------------------------|-
  13675. * | reserved | phy | peer_id | \
  13676. * |-------------------------------------------------------------------| -> report #0
  13677. * | rate | /
  13678. * |-----------------------+---------+---------------------------------|-
  13679. * | reserved | phy | peer_id | \
  13680. * |-------------------------------------------------------------------| -> report #1
  13681. * | rate | /
  13682. * |-----------------------+---------+---------------------------------|-
  13683. * | reserved | phy | peer_id | \
  13684. * |-------------------------------------------------------------------| -> report #2
  13685. * | rate | /
  13686. * |-------------------------------------------------------------------|-
  13687. * : :
  13688. * : :
  13689. * : :
  13690. * :-------------------------------------------------------------------:
  13691. *
  13692. * - peer_id
  13693. * Bits 15:0
  13694. * Purpose: identify the peer
  13695. * value:
  13696. * - phy
  13697. * Bits 19:16
  13698. * Purpose: identify which phy is in use
  13699. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13700. * Please see enum htt_peer_report_phy_type for detail.
  13701. * - reserved
  13702. * Bits 31:20
  13703. * Purpose:
  13704. * value:
  13705. * - rate
  13706. * Bits 31:0
  13707. * Purpose: represent the justified rate of the peer specified by peer_id
  13708. * value:
  13709. */
  13710. enum htt_peer_rate_report_phy_type {
  13711. HTT_PEER_RATE_REPORT_11B = 0,
  13712. HTT_PEER_RATE_REPORT_11A_G,
  13713. HTT_PEER_RATE_REPORT_11N,
  13714. HTT_PEER_RATE_REPORT_11AC,
  13715. };
  13716. #define HTT_PEER_RATE_REPORT_SIZE 8
  13717. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13718. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13719. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13720. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13721. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13722. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13723. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13724. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13725. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13726. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13727. do { \
  13728. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13729. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13730. } while (0)
  13731. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13732. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13733. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13734. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13735. do { \
  13736. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13737. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13738. } while (0)
  13739. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13740. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13741. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13742. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13743. do { \
  13744. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13745. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13746. } while (0)
  13747. /**
  13748. * @brief target -> host flow pool map message
  13749. *
  13750. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13751. *
  13752. * @details
  13753. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13754. * a flow of descriptors.
  13755. *
  13756. * This message is in TLV format and indicates the parameters to be setup a
  13757. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13758. * receive descriptors from a specified pool.
  13759. *
  13760. * The message would appear as follows:
  13761. *
  13762. * |31 24|23 16|15 8|7 0|
  13763. * |----------------+----------------+----------------+----------------|
  13764. * header | reserved | num_flows | msg_type |
  13765. * |-------------------------------------------------------------------|
  13766. * | |
  13767. * : payload :
  13768. * | |
  13769. * |-------------------------------------------------------------------|
  13770. *
  13771. * The header field is one DWORD long and is interpreted as follows:
  13772. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13773. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13774. * this message
  13775. * b'16-31 - reserved: These bits are reserved for future use
  13776. *
  13777. * Payload:
  13778. * The payload would contain multiple objects of the following structure. Each
  13779. * object represents a flow.
  13780. *
  13781. * |31 24|23 16|15 8|7 0|
  13782. * |----------------+----------------+----------------+----------------|
  13783. * header | reserved | num_flows | msg_type |
  13784. * |-------------------------------------------------------------------|
  13785. * payload0| flow_type |
  13786. * |-------------------------------------------------------------------|
  13787. * | flow_id |
  13788. * |-------------------------------------------------------------------|
  13789. * | reserved0 | flow_pool_id |
  13790. * |-------------------------------------------------------------------|
  13791. * | reserved1 | flow_pool_size |
  13792. * |-------------------------------------------------------------------|
  13793. * | reserved2 |
  13794. * |-------------------------------------------------------------------|
  13795. * payload1| flow_type |
  13796. * |-------------------------------------------------------------------|
  13797. * | flow_id |
  13798. * |-------------------------------------------------------------------|
  13799. * | reserved0 | flow_pool_id |
  13800. * |-------------------------------------------------------------------|
  13801. * | reserved1 | flow_pool_size |
  13802. * |-------------------------------------------------------------------|
  13803. * | reserved2 |
  13804. * |-------------------------------------------------------------------|
  13805. * | . |
  13806. * | . |
  13807. * | . |
  13808. * |-------------------------------------------------------------------|
  13809. *
  13810. * Each payload is 5 DWORDS long and is interpreted as follows:
  13811. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13812. * this flow is associated. It can be VDEV, peer,
  13813. * or tid (AC). Based on enum htt_flow_type.
  13814. *
  13815. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13816. * object. For flow_type vdev it is set to the
  13817. * vdevid, for peer it is peerid and for tid, it is
  13818. * tid_num.
  13819. *
  13820. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13821. * in the host for this flow
  13822. * b'16:31 - reserved0: This field in reserved for the future. In case
  13823. * we have a hierarchical implementation (HCM) of
  13824. * pools, it can be used to indicate the ID of the
  13825. * parent-pool.
  13826. *
  13827. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13828. * Descriptors for this flow will be
  13829. * allocated from this pool in the host.
  13830. * b'16:31 - reserved1: This field in reserved for the future. In case
  13831. * we have a hierarchical implementation of pools,
  13832. * it can be used to indicate the max number of
  13833. * descriptors in the pool. The b'0:15 can be used
  13834. * to indicate min number of descriptors in the
  13835. * HCM scheme.
  13836. *
  13837. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13838. * we have a hierarchical implementation of pools,
  13839. * b'0:15 can be used to indicate the
  13840. * priority-based borrowing (PBB) threshold of
  13841. * the flow's pool. The b'16:31 are still left
  13842. * reserved.
  13843. */
  13844. enum htt_flow_type {
  13845. FLOW_TYPE_VDEV = 0,
  13846. /* Insert new flow types above this line */
  13847. };
  13848. PREPACK struct htt_flow_pool_map_payload_t {
  13849. A_UINT32 flow_type;
  13850. A_UINT32 flow_id;
  13851. A_UINT32 flow_pool_id:16,
  13852. reserved0:16;
  13853. A_UINT32 flow_pool_size:16,
  13854. reserved1:16;
  13855. A_UINT32 reserved2;
  13856. } POSTPACK;
  13857. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13858. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13859. (sizeof(struct htt_flow_pool_map_payload_t))
  13860. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13861. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13862. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13863. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13864. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13865. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13866. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13867. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13868. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13869. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13870. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13871. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13872. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13873. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13874. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13875. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13876. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13877. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13878. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13879. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13880. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13881. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13882. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13883. do { \
  13884. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13885. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13886. } while (0)
  13887. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13888. do { \
  13889. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13890. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13891. } while (0)
  13892. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13893. do { \
  13894. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13895. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13896. } while (0)
  13897. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13898. do { \
  13899. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13900. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13901. } while (0)
  13902. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13903. do { \
  13904. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13905. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13906. } while (0)
  13907. /**
  13908. * @brief target -> host flow pool unmap message
  13909. *
  13910. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13911. *
  13912. * @details
  13913. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13914. * down a flow of descriptors.
  13915. * This message indicates that for the flow (whose ID is provided) is wanting
  13916. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13917. * pool of descriptors from where descriptors are being allocated for this
  13918. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13919. * be unmapped by the host.
  13920. *
  13921. * The message would appear as follows:
  13922. *
  13923. * |31 24|23 16|15 8|7 0|
  13924. * |----------------+----------------+----------------+----------------|
  13925. * | reserved0 | msg_type |
  13926. * |-------------------------------------------------------------------|
  13927. * | flow_type |
  13928. * |-------------------------------------------------------------------|
  13929. * | flow_id |
  13930. * |-------------------------------------------------------------------|
  13931. * | reserved1 | flow_pool_id |
  13932. * |-------------------------------------------------------------------|
  13933. *
  13934. * The message is interpreted as follows:
  13935. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13936. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13937. * b'8:31 - reserved0: Reserved for future use
  13938. *
  13939. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13940. * this flow is associated. It can be VDEV, peer,
  13941. * or tid (AC). Based on enum htt_flow_type.
  13942. *
  13943. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13944. * object. For flow_type vdev it is set to the
  13945. * vdevid, for peer it is peerid and for tid, it is
  13946. * tid_num.
  13947. *
  13948. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13949. * used in the host for this flow
  13950. * b'16:31 - reserved0: This field in reserved for the future.
  13951. *
  13952. */
  13953. PREPACK struct htt_flow_pool_unmap_t {
  13954. A_UINT32 msg_type:8,
  13955. reserved0:24;
  13956. A_UINT32 flow_type;
  13957. A_UINT32 flow_id;
  13958. A_UINT32 flow_pool_id:16,
  13959. reserved1:16;
  13960. } POSTPACK;
  13961. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13962. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13963. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13964. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13965. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13966. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13967. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13968. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13969. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13970. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13971. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13972. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13973. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13974. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13975. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13976. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13977. do { \
  13978. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13979. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13980. } while (0)
  13981. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13982. do { \
  13983. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13984. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13985. } while (0)
  13986. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13987. do { \
  13988. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13989. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13990. } while (0)
  13991. /**
  13992. * @brief target -> host SRING setup done message
  13993. *
  13994. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13995. *
  13996. * @details
  13997. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13998. * SRNG ring setup is done
  13999. *
  14000. * This message indicates whether the last setup operation is successful.
  14001. * It will be sent to host when host set respose_required bit in
  14002. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14003. * The message would appear as follows:
  14004. *
  14005. * |31 24|23 16|15 8|7 0|
  14006. * |--------------- +----------------+----------------+----------------|
  14007. * | setup_status | ring_id | pdev_id | msg_type |
  14008. * |-------------------------------------------------------------------|
  14009. *
  14010. * The message is interpreted as follows:
  14011. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14012. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14013. * b'8:15 - pdev_id:
  14014. * 0 (for rings at SOC/UMAC level),
  14015. * 1/2/3 mac id (for rings at LMAC level)
  14016. * b'16:23 - ring_id: Identify the ring which is set up
  14017. * More details can be got from enum htt_srng_ring_id
  14018. * b'24:31 - setup_status: Indicate status of setup operation
  14019. * Refer to htt_ring_setup_status
  14020. */
  14021. PREPACK struct htt_sring_setup_done_t {
  14022. A_UINT32 msg_type: 8,
  14023. pdev_id: 8,
  14024. ring_id: 8,
  14025. setup_status: 8;
  14026. } POSTPACK;
  14027. enum htt_ring_setup_status {
  14028. htt_ring_setup_status_ok = 0,
  14029. htt_ring_setup_status_error,
  14030. };
  14031. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14032. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14033. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14034. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14035. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14036. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14037. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14038. do { \
  14039. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14040. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14041. } while (0)
  14042. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14043. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14044. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14045. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14046. HTT_SRING_SETUP_DONE_RING_ID_S)
  14047. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14048. do { \
  14049. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14050. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14051. } while (0)
  14052. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14053. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14054. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14055. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14056. HTT_SRING_SETUP_DONE_STATUS_S)
  14057. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14058. do { \
  14059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14060. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14061. } while (0)
  14062. /**
  14063. * @brief target -> flow map flow info
  14064. *
  14065. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14066. *
  14067. * @details
  14068. * HTT TX map flow entry with tqm flow pointer
  14069. * Sent from firmware to host to add tqm flow pointer in corresponding
  14070. * flow search entry. Flow metadata is replayed back to host as part of this
  14071. * struct to enable host to find the specific flow search entry
  14072. *
  14073. * The message would appear as follows:
  14074. *
  14075. * |31 28|27 18|17 14|13 8|7 0|
  14076. * |-------+------------------------------------------+----------------|
  14077. * | rsvd0 | fse_hsh_idx | msg_type |
  14078. * |-------------------------------------------------------------------|
  14079. * | rsvd1 | tid | peer_id |
  14080. * |-------------------------------------------------------------------|
  14081. * | tqm_flow_pntr_lo |
  14082. * |-------------------------------------------------------------------|
  14083. * | tqm_flow_pntr_hi |
  14084. * |-------------------------------------------------------------------|
  14085. * | fse_meta_data |
  14086. * |-------------------------------------------------------------------|
  14087. *
  14088. * The message is interpreted as follows:
  14089. *
  14090. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14091. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14092. *
  14093. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14094. * for this flow entry
  14095. *
  14096. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14097. *
  14098. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14099. *
  14100. * dword1 - b'14:17 - tid
  14101. *
  14102. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14103. *
  14104. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14105. *
  14106. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14107. *
  14108. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14109. * given by host
  14110. */
  14111. PREPACK struct htt_tx_map_flow_info {
  14112. A_UINT32
  14113. msg_type: 8,
  14114. fse_hsh_idx: 20,
  14115. rsvd0: 4;
  14116. A_UINT32
  14117. peer_id: 14,
  14118. tid: 4,
  14119. rsvd1: 14;
  14120. A_UINT32 tqm_flow_pntr_lo;
  14121. A_UINT32 tqm_flow_pntr_hi;
  14122. struct htt_tx_flow_metadata fse_meta_data;
  14123. } POSTPACK;
  14124. /* DWORD 0 */
  14125. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14126. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14127. /* DWORD 1 */
  14128. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14129. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14130. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14131. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14132. /* DWORD 0 */
  14133. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14134. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14135. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14136. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14137. do { \
  14138. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14139. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14140. } while (0)
  14141. /* DWORD 1 */
  14142. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14143. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14144. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14145. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14146. do { \
  14147. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14148. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14149. } while (0)
  14150. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14151. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14152. HTT_TX_MAP_FLOW_INFO_TID_S)
  14153. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14154. do { \
  14155. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14156. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14157. } while (0)
  14158. /*
  14159. * htt_dbg_ext_stats_status -
  14160. * present - The requested stats have been delivered in full.
  14161. * This indicates that either the stats information was contained
  14162. * in its entirety within this message, or else this message
  14163. * completes the delivery of the requested stats info that was
  14164. * partially delivered through earlier STATS_CONF messages.
  14165. * partial - The requested stats have been delivered in part.
  14166. * One or more subsequent STATS_CONF messages with the same
  14167. * cookie value will be sent to deliver the remainder of the
  14168. * information.
  14169. * error - The requested stats could not be delivered, for example due
  14170. * to a shortage of memory to construct a message holding the
  14171. * requested stats.
  14172. * invalid - The requested stat type is either not recognized, or the
  14173. * target is configured to not gather the stats type in question.
  14174. */
  14175. enum htt_dbg_ext_stats_status {
  14176. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14177. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14178. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14179. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14180. };
  14181. /**
  14182. * @brief target -> host ppdu stats upload
  14183. *
  14184. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14185. *
  14186. * @details
  14187. * The following field definitions describe the format of the HTT target
  14188. * to host ppdu stats indication message.
  14189. *
  14190. *
  14191. * |31 16|15 12|11 10|9 8|7 0 |
  14192. * |----------------------------------------------------------------------|
  14193. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14194. * |----------------------------------------------------------------------|
  14195. * | ppdu_id |
  14196. * |----------------------------------------------------------------------|
  14197. * | Timestamp in us |
  14198. * |----------------------------------------------------------------------|
  14199. * | reserved |
  14200. * |----------------------------------------------------------------------|
  14201. * | type-specific stats info |
  14202. * | (see htt_ppdu_stats.h) |
  14203. * |----------------------------------------------------------------------|
  14204. * Header fields:
  14205. * - MSG_TYPE
  14206. * Bits 7:0
  14207. * Purpose: Identifies this is a PPDU STATS indication
  14208. * message.
  14209. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14210. * - mac_id
  14211. * Bits 9:8
  14212. * Purpose: mac_id of this ppdu_id
  14213. * Value: 0-3
  14214. * - pdev_id
  14215. * Bits 11:10
  14216. * Purpose: pdev_id of this ppdu_id
  14217. * Value: 0-3
  14218. * 0 (for rings at SOC level),
  14219. * 1/2/3 PDEV -> 0/1/2
  14220. * - payload_size
  14221. * Bits 31:16
  14222. * Purpose: total tlv size
  14223. * Value: payload_size in bytes
  14224. */
  14225. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14226. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14227. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14228. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14229. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14230. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14231. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14232. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14233. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14234. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14235. do { \
  14236. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14237. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14238. } while (0)
  14239. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14240. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14241. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14242. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14243. do { \
  14244. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14245. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14246. } while (0)
  14247. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14248. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14249. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14250. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14251. do { \
  14252. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14253. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14254. } while (0)
  14255. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14256. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14257. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14258. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14259. do { \
  14260. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14261. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14262. } while (0)
  14263. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14264. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14265. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14266. /* htt_t2h_ppdu_stats_ind_hdr_t
  14267. * This struct contains the fields within the header of the
  14268. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14269. * stats info.
  14270. * This struct assumes little-endian layout, and thus is only
  14271. * suitable for use within processors known to be little-endian
  14272. * (such as the target).
  14273. * In contrast, the above macros provide endian-portable methods
  14274. * to get and set the bitfields within this PPDU_STATS_IND header.
  14275. */
  14276. typedef struct {
  14277. A_UINT32 msg_type: 8, /* bits 7:0 */
  14278. mac_id: 2, /* bits 9:8 */
  14279. pdev_id: 2, /* bits 11:10 */
  14280. reserved1: 4, /* bits 15:12 */
  14281. payload_size: 16; /* bits 31:16 */
  14282. A_UINT32 ppdu_id;
  14283. A_UINT32 timestamp_us;
  14284. A_UINT32 reserved2;
  14285. } htt_t2h_ppdu_stats_ind_hdr_t;
  14286. /**
  14287. * @brief target -> host extended statistics upload
  14288. *
  14289. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14290. *
  14291. * @details
  14292. * The following field definitions describe the format of the HTT target
  14293. * to host stats upload confirmation message.
  14294. * The message contains a cookie echoed from the HTT host->target stats
  14295. * upload request, which identifies which request the confirmation is
  14296. * for, and a single stats can span over multiple HTT stats indication
  14297. * due to the HTT message size limitation so every HTT ext stats indication
  14298. * will have tag-length-value stats information elements.
  14299. * The tag-length header for each HTT stats IND message also includes a
  14300. * status field, to indicate whether the request for the stat type in
  14301. * question was fully met, partially met, unable to be met, or invalid
  14302. * (if the stat type in question is disabled in the target).
  14303. * A Done bit 1's indicate the end of the of stats info elements.
  14304. *
  14305. *
  14306. * |31 16|15 12|11|10 8|7 5|4 0|
  14307. * |--------------------------------------------------------------|
  14308. * | reserved | msg type |
  14309. * |--------------------------------------------------------------|
  14310. * | cookie LSBs |
  14311. * |--------------------------------------------------------------|
  14312. * | cookie MSBs |
  14313. * |--------------------------------------------------------------|
  14314. * | stats entry length | rsvd | D| S | stat type |
  14315. * |--------------------------------------------------------------|
  14316. * | type-specific stats info |
  14317. * | (see htt_stats.h) |
  14318. * |--------------------------------------------------------------|
  14319. * Header fields:
  14320. * - MSG_TYPE
  14321. * Bits 7:0
  14322. * Purpose: Identifies this is a extended statistics upload confirmation
  14323. * message.
  14324. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14325. * - COOKIE_LSBS
  14326. * Bits 31:0
  14327. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14328. * message with its preceding host->target stats request message.
  14329. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14330. * - COOKIE_MSBS
  14331. * Bits 31:0
  14332. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14333. * message with its preceding host->target stats request message.
  14334. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14335. *
  14336. * Stats Information Element tag-length header fields:
  14337. * - STAT_TYPE
  14338. * Bits 7:0
  14339. * Purpose: identifies the type of statistics info held in the
  14340. * following information element
  14341. * Value: htt_dbg_ext_stats_type
  14342. * - STATUS
  14343. * Bits 10:8
  14344. * Purpose: indicate whether the requested stats are present
  14345. * Value: htt_dbg_ext_stats_status
  14346. * - DONE
  14347. * Bits 11
  14348. * Purpose:
  14349. * Indicates the completion of the stats entry, this will be the last
  14350. * stats conf HTT segment for the requested stats type.
  14351. * Value:
  14352. * 0 -> the stats retrieval is ongoing
  14353. * 1 -> the stats retrieval is complete
  14354. * - LENGTH
  14355. * Bits 31:16
  14356. * Purpose: indicate the stats information size
  14357. * Value: This field specifies the number of bytes of stats information
  14358. * that follows the element tag-length header.
  14359. * It is expected but not required that this length is a multiple of
  14360. * 4 bytes.
  14361. */
  14362. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14363. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14364. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14365. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14366. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14367. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14368. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14369. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14370. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14371. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14372. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14373. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14374. do { \
  14375. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14376. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14377. } while (0)
  14378. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14379. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14380. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14381. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14382. do { \
  14383. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14384. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14385. } while (0)
  14386. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14387. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14388. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14389. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14390. do { \
  14391. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14392. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14393. } while (0)
  14394. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14395. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14396. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14397. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14398. do { \
  14399. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14400. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14401. } while (0)
  14402. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14403. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14404. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14405. typedef enum {
  14406. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14407. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14408. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14409. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14410. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14411. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14412. /* Reserved from 128 - 255 for target internal use.*/
  14413. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14414. } HTT_PEER_TYPE;
  14415. /** macro to convert MAC address from char array to HTT word format */
  14416. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14417. (phtt_mac_addr)->mac_addr31to0 = \
  14418. (((c_macaddr)[0] << 0) | \
  14419. ((c_macaddr)[1] << 8) | \
  14420. ((c_macaddr)[2] << 16) | \
  14421. ((c_macaddr)[3] << 24)); \
  14422. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14423. } while (0)
  14424. /**
  14425. * @brief target -> host monitor mac header indication message
  14426. *
  14427. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14428. *
  14429. * @details
  14430. * The following diagram shows the format of the monitor mac header message
  14431. * sent from the target to the host.
  14432. * This message is primarily sent when promiscuous rx mode is enabled.
  14433. * One message is sent per rx PPDU.
  14434. *
  14435. * |31 24|23 16|15 8|7 0|
  14436. * |-------------------------------------------------------------|
  14437. * | peer_id | reserved0 | msg_type |
  14438. * |-------------------------------------------------------------|
  14439. * | reserved1 | num_mpdu |
  14440. * |-------------------------------------------------------------|
  14441. * | struct hw_rx_desc |
  14442. * | (see wal_rx_desc.h) |
  14443. * |-------------------------------------------------------------|
  14444. * | struct ieee80211_frame_addr4 |
  14445. * | (see ieee80211_defs.h) |
  14446. * |-------------------------------------------------------------|
  14447. * | struct ieee80211_frame_addr4 |
  14448. * | (see ieee80211_defs.h) |
  14449. * |-------------------------------------------------------------|
  14450. * | ...... |
  14451. * |-------------------------------------------------------------|
  14452. *
  14453. * Header fields:
  14454. * - msg_type
  14455. * Bits 7:0
  14456. * Purpose: Identifies this is a monitor mac header indication message.
  14457. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14458. * - peer_id
  14459. * Bits 31:16
  14460. * Purpose: Software peer id given by host during association,
  14461. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14462. * for rx PPDUs received from unassociated peers.
  14463. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14464. * - num_mpdu
  14465. * Bits 15:0
  14466. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14467. * delivered within the message.
  14468. * Value: 1 to 32
  14469. * num_mpdu is limited to a maximum value of 32, due to buffer
  14470. * size limits. For PPDUs with more than 32 MPDUs, only the
  14471. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14472. * the PPDU will be provided.
  14473. */
  14474. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14475. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14476. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14477. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14478. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14479. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14480. do { \
  14481. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14482. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14483. } while (0)
  14484. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14485. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14486. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14487. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14488. do { \
  14489. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14490. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14491. } while (0)
  14492. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14493. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14494. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14495. /**
  14496. * @brief target -> host flow pool resize Message
  14497. *
  14498. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14499. *
  14500. * @details
  14501. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14502. * the flow pool associated with the specified ID is resized
  14503. *
  14504. * The message would appear as follows:
  14505. *
  14506. * |31 16|15 8|7 0|
  14507. * |---------------------------------+----------------+----------------|
  14508. * | reserved0 | Msg type |
  14509. * |-------------------------------------------------------------------|
  14510. * | flow pool new size | flow pool ID |
  14511. * |-------------------------------------------------------------------|
  14512. *
  14513. * The message is interpreted as follows:
  14514. * b'0:7 - msg_type: This will be set to 0x21
  14515. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14516. *
  14517. * b'0:15 - flow pool ID: Existing flow pool ID
  14518. *
  14519. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14520. *
  14521. */
  14522. PREPACK struct htt_flow_pool_resize_t {
  14523. A_UINT32 msg_type:8,
  14524. reserved0:24;
  14525. A_UINT32 flow_pool_id:16,
  14526. flow_pool_new_size:16;
  14527. } POSTPACK;
  14528. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14529. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14530. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14531. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14532. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14533. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14534. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14535. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14536. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14537. do { \
  14538. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14539. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14540. } while (0)
  14541. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14542. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14543. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14544. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14545. do { \
  14546. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14547. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14548. } while (0)
  14549. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14550. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14551. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14552. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14553. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14554. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14555. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14556. /*
  14557. * The read and write indices point to the data within the host buffer.
  14558. * Because the first 4 bytes of the host buffer is used for the read index and
  14559. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14560. * The read index and write index are the byte offsets from the base of the
  14561. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14562. * Refer the ASCII text picture below.
  14563. */
  14564. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14565. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14566. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14567. /*
  14568. ***************************************************************************
  14569. *
  14570. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14571. *
  14572. ***************************************************************************
  14573. *
  14574. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14575. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14576. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14577. * written into the Host memory region mentioned below.
  14578. *
  14579. * Read index is updated by the Host. At any point of time, the read index will
  14580. * indicate the index that will next be read by the Host. The read index is
  14581. * in units of bytes offset from the base of the meta-data buffer.
  14582. *
  14583. * Write index is updated by the FW. At any point of time, the write index will
  14584. * indicate from where the FW can start writing any new data. The write index is
  14585. * in units of bytes offset from the base of the meta-data buffer.
  14586. *
  14587. * If the Host is not fast enough in reading the CFR data, any new capture data
  14588. * would be dropped if there is no space left to write the new captures.
  14589. *
  14590. * The last 4 bytes of the memory region will have the magic pattern
  14591. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14592. * not overrun the host buffer.
  14593. *
  14594. * ,--------------------. read and write indices store the
  14595. * | | byte offset from the base of the
  14596. * | ,--------+--------. meta-data buffer to the next
  14597. * | | | | location within the data buffer
  14598. * | | v v that will be read / written
  14599. * ************************************************************************
  14600. * * Read * Write * * Magic *
  14601. * * index * index * CFR data1 ...... CFR data N * pattern *
  14602. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14603. * ************************************************************************
  14604. * |<---------- data buffer ---------->|
  14605. *
  14606. * |<----------------- meta-data buffer allocated in Host ----------------|
  14607. *
  14608. * Note:
  14609. * - Considering the 4 bytes needed to store the Read index (R) and the
  14610. * Write index (W), the initial value is as follows:
  14611. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14612. * - Buffer empty condition:
  14613. * R = W
  14614. *
  14615. * Regarding CFR data format:
  14616. * --------------------------
  14617. *
  14618. * Each CFR tone is stored in HW as 16-bits with the following format:
  14619. * {bits[15:12], bits[11:6], bits[5:0]} =
  14620. * {unsigned exponent (4 bits),
  14621. * signed mantissa_real (6 bits),
  14622. * signed mantissa_imag (6 bits)}
  14623. *
  14624. * CFR_real = mantissa_real * 2^(exponent-5)
  14625. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14626. *
  14627. *
  14628. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14629. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14630. *
  14631. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14632. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14633. * .
  14634. * .
  14635. * .
  14636. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14637. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14638. */
  14639. /* Bandwidth of peer CFR captures */
  14640. typedef enum {
  14641. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14642. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14643. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14644. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14645. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14646. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14647. } HTT_PEER_CFR_CAPTURE_BW;
  14648. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14649. * was captured
  14650. */
  14651. typedef enum {
  14652. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14653. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14654. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14655. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14656. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14657. } HTT_PEER_CFR_CAPTURE_MODE;
  14658. typedef enum {
  14659. /* This message type is currently used for the below purpose:
  14660. *
  14661. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14662. * wmi_peer_cfr_capture_cmd.
  14663. * If payload_present bit is set to 0 then the associated memory region
  14664. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14665. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14666. * message; the CFR dump will be present at the end of the message,
  14667. * after the chan_phy_mode.
  14668. */
  14669. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14670. /* Always keep this last */
  14671. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14672. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14673. /**
  14674. * @brief target -> host CFR dump completion indication message definition
  14675. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14676. *
  14677. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14678. *
  14679. * @details
  14680. * The following diagram shows the format of the Channel Frequency Response
  14681. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14682. * the channel capture of a peer is copied by Firmware into the Host memory
  14683. *
  14684. * **************************************************************************
  14685. *
  14686. * Message format when the CFR capture message type is
  14687. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14688. *
  14689. * **************************************************************************
  14690. *
  14691. * |31 16|15 |8|7 0|
  14692. * |----------------------------------------------------------------|
  14693. * header: | reserved |P| msg_type |
  14694. * word 0 | | | |
  14695. * |----------------------------------------------------------------|
  14696. * payload: | cfr_capture_msg_type |
  14697. * word 1 | |
  14698. * |----------------------------------------------------------------|
  14699. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14700. * word 2 | | | | | | | | |
  14701. * |----------------------------------------------------------------|
  14702. * | mac_addr31to0 |
  14703. * word 3 | |
  14704. * |----------------------------------------------------------------|
  14705. * | unused / reserved | mac_addr47to32 |
  14706. * word 4 | | |
  14707. * |----------------------------------------------------------------|
  14708. * | index |
  14709. * word 5 | |
  14710. * |----------------------------------------------------------------|
  14711. * | length |
  14712. * word 6 | |
  14713. * |----------------------------------------------------------------|
  14714. * | timestamp |
  14715. * word 7 | |
  14716. * |----------------------------------------------------------------|
  14717. * | counter |
  14718. * word 8 | |
  14719. * |----------------------------------------------------------------|
  14720. * | chan_mhz |
  14721. * word 9 | |
  14722. * |----------------------------------------------------------------|
  14723. * | band_center_freq1 |
  14724. * word 10 | |
  14725. * |----------------------------------------------------------------|
  14726. * | band_center_freq2 |
  14727. * word 11 | |
  14728. * |----------------------------------------------------------------|
  14729. * | chan_phy_mode |
  14730. * word 12 | |
  14731. * |----------------------------------------------------------------|
  14732. * where,
  14733. * P - payload present bit (payload_present explained below)
  14734. * req_id - memory request id (mem_req_id explained below)
  14735. * S - status field (status explained below)
  14736. * capbw - capture bandwidth (capture_bw explained below)
  14737. * mode - mode of capture (mode explained below)
  14738. * sts - space time streams (sts_count explained below)
  14739. * chbw - channel bandwidth (channel_bw explained below)
  14740. * captype - capture type (cap_type explained below)
  14741. *
  14742. * The following field definitions describe the format of the CFR dump
  14743. * completion indication sent from the target to the host
  14744. *
  14745. * Header fields:
  14746. *
  14747. * Word 0
  14748. * - msg_type
  14749. * Bits 7:0
  14750. * Purpose: Identifies this as CFR TX completion indication
  14751. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14752. * - payload_present
  14753. * Bit 8
  14754. * Purpose: Identifies how CFR data is sent to host
  14755. * Value: 0 - If CFR Payload is written to host memory
  14756. * 1 - If CFR Payload is sent as part of HTT message
  14757. * (This is the requirement for SDIO/USB where it is
  14758. * not possible to write CFR data to host memory)
  14759. * - reserved
  14760. * Bits 31:9
  14761. * Purpose: Reserved
  14762. * Value: 0
  14763. *
  14764. * Payload fields:
  14765. *
  14766. * Word 1
  14767. * - cfr_capture_msg_type
  14768. * Bits 31:0
  14769. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14770. * to specify the format used for the remainder of the message
  14771. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14772. * (currently only MSG_TYPE_1 is defined)
  14773. *
  14774. * Word 2
  14775. * - mem_req_id
  14776. * Bits 6:0
  14777. * Purpose: Contain the mem request id of the region where the CFR capture
  14778. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14779. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14780. this value is invalid)
  14781. * - status
  14782. * Bit 7
  14783. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14784. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14785. * - capture_bw
  14786. * Bits 10:8
  14787. * Purpose: Carry the bandwidth of the CFR capture
  14788. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14789. * - mode
  14790. * Bits 13:11
  14791. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14792. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14793. * - sts_count
  14794. * Bits 16:14
  14795. * Purpose: Carry the number of space time streams
  14796. * Value: Number of space time streams
  14797. * - channel_bw
  14798. * Bits 19:17
  14799. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14800. * measurement
  14801. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14802. * - cap_type
  14803. * Bits 23:20
  14804. * Purpose: Carry the type of the capture
  14805. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14806. * - vdev_id
  14807. * Bits 31:24
  14808. * Purpose: Carry the virtual device id
  14809. * Value: vdev ID
  14810. *
  14811. * Word 3
  14812. * - mac_addr31to0
  14813. * Bits 31:0
  14814. * Purpose: Contain the bits 31:0 of the peer MAC address
  14815. * Value: Bits 31:0 of the peer MAC address
  14816. *
  14817. * Word 4
  14818. * - mac_addr47to32
  14819. * Bits 15:0
  14820. * Purpose: Contain the bits 47:32 of the peer MAC address
  14821. * Value: Bits 47:32 of the peer MAC address
  14822. *
  14823. * Word 5
  14824. * - index
  14825. * Bits 31:0
  14826. * Purpose: Contain the index at which this CFR dump was written in the Host
  14827. * allocated memory. This index is the number of bytes from the base address.
  14828. * Value: Index position
  14829. *
  14830. * Word 6
  14831. * - length
  14832. * Bits 31:0
  14833. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14834. * Value: Length of the CFR capture of the peer
  14835. *
  14836. * Word 7
  14837. * - timestamp
  14838. * Bits 31:0
  14839. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14840. * clock used for this timestamp is private to the target and not visible to
  14841. * the host i.e., Host can interpret only the relative timestamp deltas from
  14842. * one message to the next, but can't interpret the absolute timestamp from a
  14843. * single message.
  14844. * Value: Timestamp in microseconds
  14845. *
  14846. * Word 8
  14847. * - counter
  14848. * Bits 31:0
  14849. * Purpose: Carry the count of the current CFR capture from FW. This is
  14850. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14851. * in host memory)
  14852. * Value: Count of the current CFR capture
  14853. *
  14854. * Word 9
  14855. * - chan_mhz
  14856. * Bits 31:0
  14857. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14858. * Value: Primary 20 channel frequency
  14859. *
  14860. * Word 10
  14861. * - band_center_freq1
  14862. * Bits 31:0
  14863. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14864. * Value: Center frequency 1 in MHz
  14865. *
  14866. * Word 11
  14867. * - band_center_freq2
  14868. * Bits 31:0
  14869. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14870. * the VDEV
  14871. * 80plus80 mode
  14872. * Value: Center frequency 2 in MHz
  14873. *
  14874. * Word 12
  14875. * - chan_phy_mode
  14876. * Bits 31:0
  14877. * Purpose: Carry the phy mode of the channel, of the VDEV
  14878. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14879. */
  14880. PREPACK struct htt_cfr_dump_ind_type_1 {
  14881. A_UINT32 mem_req_id:7,
  14882. status:1,
  14883. capture_bw:3,
  14884. mode:3,
  14885. sts_count:3,
  14886. channel_bw:3,
  14887. cap_type:4,
  14888. vdev_id:8;
  14889. htt_mac_addr addr;
  14890. A_UINT32 index;
  14891. A_UINT32 length;
  14892. A_UINT32 timestamp;
  14893. A_UINT32 counter;
  14894. struct htt_chan_change_msg chan;
  14895. } POSTPACK;
  14896. PREPACK struct htt_cfr_dump_compl_ind {
  14897. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14898. union {
  14899. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14900. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14901. /* If there is a need to change the memory layout and its associated
  14902. * HTT indication format, a new CFR capture message type can be
  14903. * introduced and added into this union.
  14904. */
  14905. };
  14906. } POSTPACK;
  14907. /*
  14908. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14909. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14910. */
  14911. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14912. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14913. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14914. do { \
  14915. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14916. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14917. } while(0)
  14918. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14919. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14920. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14921. /*
  14922. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14923. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14924. */
  14925. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14926. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14927. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14928. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14929. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14930. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14931. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14932. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14933. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14934. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14935. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14936. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14937. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14938. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14939. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14940. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14941. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14942. do { \
  14943. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14944. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14945. } while (0)
  14946. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14947. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14948. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14949. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14950. do { \
  14951. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14952. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14953. } while (0)
  14954. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14955. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14956. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14957. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14958. do { \
  14959. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14960. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14961. } while (0)
  14962. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14963. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14964. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14965. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14966. do { \
  14967. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14968. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14969. } while (0)
  14970. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14971. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14972. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14973. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14974. do { \
  14975. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14976. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14977. } while (0)
  14978. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14979. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14980. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14981. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14982. do { \
  14983. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14984. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14985. } while (0)
  14986. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14987. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14988. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14989. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14990. do { \
  14991. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14992. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14993. } while (0)
  14994. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14995. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14996. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14997. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14998. do { \
  14999. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15000. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15001. } while (0)
  15002. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15003. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15004. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15005. /**
  15006. * @brief target -> host peer (PPDU) stats message
  15007. *
  15008. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15009. *
  15010. * @details
  15011. * This message is generated by FW when FW is sending stats to host
  15012. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15013. * This message is sent autonomously by the target rather than upon request
  15014. * by the host.
  15015. * The following field definitions describe the format of the HTT target
  15016. * to host peer stats indication message.
  15017. *
  15018. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15019. * or more PPDU stats records.
  15020. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15021. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15022. * then the message would start with the
  15023. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15024. * below.
  15025. *
  15026. * |31 16|15|14|13 11|10 9|8|7 0|
  15027. * |-------------------------------------------------------------|
  15028. * | reserved |MSG_TYPE |
  15029. * |-------------------------------------------------------------|
  15030. * rec 0 | TLV header |
  15031. * rec 0 |-------------------------------------------------------------|
  15032. * rec 0 | ppdu successful bytes |
  15033. * rec 0 |-------------------------------------------------------------|
  15034. * rec 0 | ppdu retry bytes |
  15035. * rec 0 |-------------------------------------------------------------|
  15036. * rec 0 | ppdu failed bytes |
  15037. * rec 0 |-------------------------------------------------------------|
  15038. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15039. * rec 0 |-------------------------------------------------------------|
  15040. * rec 0 | retried MSDUs | successful MSDUs |
  15041. * rec 0 |-------------------------------------------------------------|
  15042. * rec 0 | TX duration | failed MSDUs |
  15043. * rec 0 |-------------------------------------------------------------|
  15044. * ...
  15045. * |-------------------------------------------------------------|
  15046. * rec N | TLV header |
  15047. * rec N |-------------------------------------------------------------|
  15048. * rec N | ppdu successful bytes |
  15049. * rec N |-------------------------------------------------------------|
  15050. * rec N | ppdu retry bytes |
  15051. * rec N |-------------------------------------------------------------|
  15052. * rec N | ppdu failed bytes |
  15053. * rec N |-------------------------------------------------------------|
  15054. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15055. * rec N |-------------------------------------------------------------|
  15056. * rec N | retried MSDUs | successful MSDUs |
  15057. * rec N |-------------------------------------------------------------|
  15058. * rec N | TX duration | failed MSDUs |
  15059. * rec N |-------------------------------------------------------------|
  15060. *
  15061. * where:
  15062. * A = is A-MPDU flag
  15063. * BA = block-ack failure flags
  15064. * BW = bandwidth spec
  15065. * SG = SGI enabled spec
  15066. * S = skipped rate ctrl
  15067. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15068. *
  15069. * Header
  15070. * ------
  15071. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15072. * dword0 - b'8:31 - reserved : Reserved for future use
  15073. *
  15074. * payload include below peer_stats information
  15075. * --------------------------------------------
  15076. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15077. * @tx_success_bytes : total successful bytes in the PPDU.
  15078. * @tx_retry_bytes : total retried bytes in the PPDU.
  15079. * @tx_failed_bytes : total failed bytes in the PPDU.
  15080. * @tx_ratecode : rate code used for the PPDU.
  15081. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15082. * @ba_ack_failed : BA/ACK failed for this PPDU
  15083. * b00 -> BA received
  15084. * b01 -> BA failed once
  15085. * b10 -> BA failed twice, when HW retry is enabled.
  15086. * @bw : BW
  15087. * b00 -> 20 MHz
  15088. * b01 -> 40 MHz
  15089. * b10 -> 80 MHz
  15090. * b11 -> 160 MHz (or 80+80)
  15091. * @sg : SGI enabled
  15092. * @s : skipped ratectrl
  15093. * @peer_id : peer id
  15094. * @tx_success_msdus : successful MSDUs
  15095. * @tx_retry_msdus : retried MSDUs
  15096. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15097. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15098. */
  15099. /**
  15100. * @brief target -> host backpressure event
  15101. *
  15102. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15103. *
  15104. * @details
  15105. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15106. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15107. * This message will only be sent if the backpressure condition has existed
  15108. * continuously for an initial period (100 ms).
  15109. * Repeat messages with updated information will be sent after each
  15110. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15111. * This message indicates the ring id along with current head and tail index
  15112. * locations (i.e. write and read indices).
  15113. * The backpressure time indicates the time in ms for which continous
  15114. * backpressure has been observed in the ring.
  15115. *
  15116. * The message format is as follows:
  15117. *
  15118. * |31 24|23 16|15 8|7 0|
  15119. * |----------------+----------------+----------------+----------------|
  15120. * | ring_id | ring_type | pdev_id | msg_type |
  15121. * |-------------------------------------------------------------------|
  15122. * | tail_idx | head_idx |
  15123. * |-------------------------------------------------------------------|
  15124. * | backpressure_time_ms |
  15125. * |-------------------------------------------------------------------|
  15126. *
  15127. * The message is interpreted as follows:
  15128. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15129. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15130. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15131. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15132. the msg is for LMAC ring.
  15133. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15134. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15135. * htt_backpressure_lmac_ring_id. This represents
  15136. * the ring id for which continous backpressure is seen
  15137. *
  15138. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15139. * the ring indicated by the ring_id
  15140. *
  15141. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15142. * the ring indicated by the ring id
  15143. *
  15144. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15145. * backpressure has been seen in the ring
  15146. * indicated by the ring_id.
  15147. * Units = milliseconds
  15148. */
  15149. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15150. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15151. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15152. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15153. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15154. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15155. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15156. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15157. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15158. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15159. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15160. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15161. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15162. do { \
  15163. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15164. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15165. } while (0)
  15166. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15167. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15168. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15169. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15170. do { \
  15171. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15172. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15173. } while (0)
  15174. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15175. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15176. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15177. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15178. do { \
  15179. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15180. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15181. } while (0)
  15182. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15183. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15184. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15185. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15186. do { \
  15187. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15188. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15189. } while (0)
  15190. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15191. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15192. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15193. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15194. do { \
  15195. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15196. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15197. } while (0)
  15198. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15199. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15200. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15201. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15202. do { \
  15203. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15204. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15205. } while (0)
  15206. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15207. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15208. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15209. enum htt_backpressure_ring_type {
  15210. HTT_SW_RING_TYPE_UMAC,
  15211. HTT_SW_RING_TYPE_LMAC,
  15212. HTT_SW_RING_TYPE_MAX,
  15213. };
  15214. /* Ring id for which the message is sent to host */
  15215. enum htt_backpressure_umac_ringid {
  15216. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15217. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15218. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15219. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15220. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15221. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15222. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15223. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15224. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15225. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15226. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15227. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15228. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15229. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15230. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15231. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15232. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15233. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15234. HTT_SW_UMAC_RING_IDX_MAX,
  15235. };
  15236. enum htt_backpressure_lmac_ringid {
  15237. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15238. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15239. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15240. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15241. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15242. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15243. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15244. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15245. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15246. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15247. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15248. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15249. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15250. HTT_SW_LMAC_RING_IDX_MAX,
  15251. };
  15252. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15253. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15254. pdev_id: 8,
  15255. ring_type: 8, /* htt_backpressure_ring_type */
  15256. /*
  15257. * ring_id holds an enum value from either
  15258. * htt_backpressure_umac_ringid or
  15259. * htt_backpressure_lmac_ringid, based on
  15260. * the ring_type setting.
  15261. */
  15262. ring_id: 8;
  15263. A_UINT16 head_idx;
  15264. A_UINT16 tail_idx;
  15265. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15266. } POSTPACK;
  15267. /*
  15268. * Defines two 32 bit words that can be used by the target to indicate a per
  15269. * user RU allocation and rate information.
  15270. *
  15271. * This information is currently provided in the "sw_response_reference_ptr"
  15272. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15273. * "rx_ppdu_end_user_stats" TLV.
  15274. *
  15275. * VALID:
  15276. * The consumer of these words must explicitly check the valid bit,
  15277. * and only attempt interpretation of any of the remaining fields if
  15278. * the valid bit is set to 1.
  15279. *
  15280. * VERSION:
  15281. * The consumer of these words must also explicitly check the version bit,
  15282. * and only use the V0 definition if the VERSION field is set to 0.
  15283. *
  15284. * Version 1 is currently undefined, with the exception of the VALID and
  15285. * VERSION fields.
  15286. *
  15287. * Version 0:
  15288. *
  15289. * The fields below are duplicated per BW.
  15290. *
  15291. * The consumer must determine which BW field to use, based on the UL OFDMA
  15292. * PPDU BW indicated by HW.
  15293. *
  15294. * RU_START: RU26 start index for the user.
  15295. * Note that this is always using the RU26 index, regardless
  15296. * of the actual RU assigned to the user
  15297. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15298. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15299. *
  15300. * For example, 20MHz (the value in the top row is RU_START)
  15301. *
  15302. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15303. * RU Size 1 (52): | | | | | |
  15304. * RU Size 2 (106): | | | |
  15305. * RU Size 3 (242): | |
  15306. *
  15307. * RU_SIZE: Indicates the RU size, as defined by enum
  15308. * htt_ul_ofdma_user_info_ru_size.
  15309. *
  15310. * LDPC: LDPC enabled (if 0, BCC is used)
  15311. *
  15312. * DCM: DCM enabled
  15313. *
  15314. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15315. * |---------------------------------+--------------------------------|
  15316. * |Ver|Valid| FW internal |
  15317. * |---------------------------------+--------------------------------|
  15318. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15319. * |---------------------------------+--------------------------------|
  15320. */
  15321. enum htt_ul_ofdma_user_info_ru_size {
  15322. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15323. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15324. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15325. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15326. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15327. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15328. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15329. };
  15330. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15331. struct htt_ul_ofdma_user_info_v0 {
  15332. A_UINT32 word0;
  15333. A_UINT32 word1;
  15334. };
  15335. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15336. A_UINT32 w0_fw_rsvd:30; \
  15337. A_UINT32 w0_valid:1; \
  15338. A_UINT32 w0_version:1;
  15339. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15340. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15341. };
  15342. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15343. A_UINT32 w1_nss:3; \
  15344. A_UINT32 w1_mcs:4; \
  15345. A_UINT32 w1_ldpc:1; \
  15346. A_UINT32 w1_dcm:1; \
  15347. A_UINT32 w1_ru_start:7; \
  15348. A_UINT32 w1_ru_size:3; \
  15349. A_UINT32 w1_trig_type:4; \
  15350. A_UINT32 w1_unused:9;
  15351. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15352. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15353. };
  15354. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15355. A_UINT32 w0_fw_rsvd:27; \
  15356. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15357. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15358. 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) */
  15359. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15360. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15361. };
  15362. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15363. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15364. A_UINT32 w1_trig_type:4; \
  15365. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15366. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15367. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15368. };
  15369. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15370. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15371. union {
  15372. A_UINT32 word0;
  15373. struct {
  15374. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15375. };
  15376. };
  15377. union {
  15378. A_UINT32 word1;
  15379. struct {
  15380. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15381. };
  15382. };
  15383. } POSTPACK;
  15384. /*
  15385. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15386. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15387. * this should be picked.
  15388. */
  15389. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15390. union {
  15391. A_UINT32 word0;
  15392. struct {
  15393. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15394. };
  15395. };
  15396. union {
  15397. A_UINT32 word1;
  15398. struct {
  15399. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15400. };
  15401. };
  15402. } POSTPACK;
  15403. enum HTT_UL_OFDMA_TRIG_TYPE {
  15404. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15405. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15406. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15407. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15408. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15409. };
  15410. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15411. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15412. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15413. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15414. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15415. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15416. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15417. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15418. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15419. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15420. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15421. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15422. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15423. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15424. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15425. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15426. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15427. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15428. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15429. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15430. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15431. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15432. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15433. /*--- word 0 ---*/
  15434. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15435. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15436. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15437. do { \
  15438. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15439. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15440. } while (0)
  15441. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15442. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15443. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15444. do { \
  15445. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15446. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15447. } while (0)
  15448. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15449. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15450. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15451. do { \
  15452. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15453. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15454. } while (0)
  15455. /*--- word 1 ---*/
  15456. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15457. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15458. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15459. do { \
  15460. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15461. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15462. } while (0)
  15463. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15464. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15465. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15466. do { \
  15467. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15468. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15469. } while (0)
  15470. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15471. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15472. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15473. do { \
  15474. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15475. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15476. } while (0)
  15477. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15478. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15479. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15480. do { \
  15481. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15482. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15483. } while (0)
  15484. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15485. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15486. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15487. do { \
  15488. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15489. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15490. } while (0)
  15491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15492. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15494. do { \
  15495. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15496. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15497. } while (0)
  15498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15499. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15501. do { \
  15502. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15503. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15504. } while (0)
  15505. /**
  15506. * @brief target -> host channel calibration data message
  15507. *
  15508. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15509. *
  15510. * @brief host -> target channel calibration data message
  15511. *
  15512. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15513. *
  15514. * @details
  15515. * The following field definitions describe the format of the channel
  15516. * calibration data message sent from the target to the host when
  15517. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15518. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15519. * The message is defined as htt_chan_caldata_msg followed by a variable
  15520. * number of 32-bit character values.
  15521. *
  15522. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15523. * |------------------------------------------------------------------|
  15524. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15525. * |------------------------------------------------------------------|
  15526. * | payload size | mhz |
  15527. * |------------------------------------------------------------------|
  15528. * | center frequency 2 | center frequency 1 |
  15529. * |------------------------------------------------------------------|
  15530. * | check sum |
  15531. * |------------------------------------------------------------------|
  15532. * | payload |
  15533. * |------------------------------------------------------------------|
  15534. * message info field:
  15535. * - MSG_TYPE
  15536. * Bits 7:0
  15537. * Purpose: identifies this as a channel calibration data message
  15538. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15539. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15540. * - SUB_TYPE
  15541. * Bits 11:8
  15542. * Purpose: T2H: indicates whether target is providing chan cal data
  15543. * to the host to store, or requesting that the host
  15544. * download previously-stored data.
  15545. * H2T: indicates whether the host is providing the requested
  15546. * channel cal data, or if it is rejecting the data
  15547. * request because it does not have the requested data.
  15548. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15549. * - CHKSUM_VALID
  15550. * Bit 12
  15551. * Purpose: indicates if the checksum field is valid
  15552. * value:
  15553. * - FRAG
  15554. * Bit 19:16
  15555. * Purpose: indicates the fragment index for message
  15556. * value: 0 for first fragment, 1 for second fragment, ...
  15557. * - APPEND
  15558. * Bit 20
  15559. * Purpose: indicates if this is the last fragment
  15560. * value: 0 = final fragment, 1 = more fragments will be appended
  15561. *
  15562. * channel and payload size field
  15563. * - MHZ
  15564. * Bits 15:0
  15565. * Purpose: indicates the channel primary frequency
  15566. * Value:
  15567. * - PAYLOAD_SIZE
  15568. * Bits 31:16
  15569. * Purpose: indicates the bytes of calibration data in payload
  15570. * Value:
  15571. *
  15572. * center frequency field
  15573. * - CENTER FREQUENCY 1
  15574. * Bits 15:0
  15575. * Purpose: indicates the channel center frequency
  15576. * Value: channel center frequency, in MHz units
  15577. * - CENTER FREQUENCY 2
  15578. * Bits 31:16
  15579. * Purpose: indicates the secondary channel center frequency,
  15580. * only for 11acvht 80plus80 mode
  15581. * Value: secondary channel center frequeny, in MHz units, if applicable
  15582. *
  15583. * checksum field
  15584. * - CHECK_SUM
  15585. * Bits 31:0
  15586. * Purpose: check the payload data, it is just for this fragment.
  15587. * This is intended for the target to check that the channel
  15588. * calibration data returned by the host is the unmodified data
  15589. * that was previously provided to the host by the target.
  15590. * value: checksum of fragment payload
  15591. */
  15592. PREPACK struct htt_chan_caldata_msg {
  15593. /* DWORD 0: message info */
  15594. A_UINT32
  15595. msg_type: 8,
  15596. sub_type: 4 ,
  15597. chksum_valid: 1, /** 1:valid, 0:invalid */
  15598. reserved1: 3,
  15599. frag_idx: 4, /** fragment index for calibration data */
  15600. appending: 1, /** 0: no fragment appending,
  15601. * 1: extra fragment appending */
  15602. reserved2: 11;
  15603. /* DWORD 1: channel and payload size */
  15604. A_UINT32
  15605. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15606. payload_size: 16; /** unit: bytes */
  15607. /* DWORD 2: center frequency */
  15608. A_UINT32
  15609. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15610. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15611. * valid only for 11acvht 80plus80 mode */
  15612. /* DWORD 3: check sum */
  15613. A_UINT32 chksum;
  15614. /* variable length for calibration data */
  15615. A_UINT32 payload[1/* or more */];
  15616. } POSTPACK;
  15617. /* T2H SUBTYPE */
  15618. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15619. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15620. /* H2T SUBTYPE */
  15621. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15622. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15623. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15624. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15625. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15626. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15627. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15628. do { \
  15629. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15630. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15631. } while (0)
  15632. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15633. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15634. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15635. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15636. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15637. do { \
  15638. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15639. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15640. } while (0)
  15641. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15642. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15643. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15644. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15645. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15646. do { \
  15647. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15648. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15649. } while (0)
  15650. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15651. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15652. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15653. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15654. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15655. do { \
  15656. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15657. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15658. } while (0)
  15659. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15660. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15661. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15662. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15663. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15664. do { \
  15665. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15666. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15667. } while (0)
  15668. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15669. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15670. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15671. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15672. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15673. do { \
  15674. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15675. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15676. } while (0)
  15677. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15678. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15679. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15680. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15681. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15682. do { \
  15683. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15684. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15685. } while (0)
  15686. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15687. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15688. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15689. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15690. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15691. do { \
  15692. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15693. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15694. } while (0)
  15695. /**
  15696. * @brief target -> host FSE CMEM based send
  15697. *
  15698. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15699. *
  15700. * @details
  15701. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15702. * FSE placement in CMEM is enabled.
  15703. *
  15704. * This message sends the non-secure CMEM base address.
  15705. * It will be sent to host in response to message
  15706. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15707. * The message would appear as follows:
  15708. *
  15709. * |31 24|23 16|15 8|7 0|
  15710. * |----------------+----------------+----------------+----------------|
  15711. * | reserved | num_entries | msg_type |
  15712. * |----------------+----------------+----------------+----------------|
  15713. * | base_address_lo |
  15714. * |----------------+----------------+----------------+----------------|
  15715. * | base_address_hi |
  15716. * |-------------------------------------------------------------------|
  15717. *
  15718. * The message is interpreted as follows:
  15719. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15720. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15721. * b'8:15 - number_entries: Indicated the number of entries
  15722. * programmed.
  15723. * b'16:31 - reserved.
  15724. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15725. * CMEM base address
  15726. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15727. * CMEM base address
  15728. */
  15729. PREPACK struct htt_cmem_base_send_t {
  15730. A_UINT32 msg_type: 8,
  15731. num_entries: 8,
  15732. reserved: 16;
  15733. A_UINT32 base_address_lo;
  15734. A_UINT32 base_address_hi;
  15735. } POSTPACK;
  15736. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15737. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15738. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15739. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15740. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15741. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15742. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15743. do { \
  15744. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15745. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15746. } while (0)
  15747. /**
  15748. * @brief - HTT PPDU ID format
  15749. *
  15750. * @details
  15751. * The following field definitions describe the format of the PPDU ID.
  15752. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15753. *
  15754. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15755. * +--------------------------------------------------------------------------
  15756. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15757. * +--------------------------------------------------------------------------
  15758. *
  15759. * sch id :Schedule command id
  15760. * Bits [11 : 0] : monotonically increasing counter to track the
  15761. * PPDU posted to a specific transmit queue.
  15762. *
  15763. * hwq_id: Hardware Queue ID.
  15764. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15765. *
  15766. * mac_id: MAC ID
  15767. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15768. *
  15769. * seq_idx: Sequence index.
  15770. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15771. * a particular TXOP.
  15772. *
  15773. * tqm_cmd: HWSCH/TQM flag.
  15774. * Bit [23] : Always set to 0.
  15775. *
  15776. * seq_cmd_type: Sequence command type.
  15777. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15778. * Refer to enum HTT_STATS_FTYPE for values.
  15779. */
  15780. PREPACK struct htt_ppdu_id {
  15781. A_UINT32
  15782. sch_id: 12,
  15783. hwq_id: 5,
  15784. mac_id: 2,
  15785. seq_idx: 2,
  15786. reserved1: 2,
  15787. tqm_cmd: 1,
  15788. seq_cmd_type: 6,
  15789. reserved2: 2;
  15790. } POSTPACK;
  15791. #define HTT_PPDU_ID_SCH_ID_S 0
  15792. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15793. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15794. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15795. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15796. do { \
  15797. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15798. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15799. } while (0)
  15800. #define HTT_PPDU_ID_HWQ_ID_S 12
  15801. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15802. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15803. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15804. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15805. do { \
  15806. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15807. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15808. } while (0)
  15809. #define HTT_PPDU_ID_MAC_ID_S 17
  15810. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15811. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15812. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15813. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15814. do { \
  15815. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15816. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15817. } while (0)
  15818. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15819. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15820. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15821. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15822. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15823. do { \
  15824. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15825. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15826. } while (0)
  15827. #define HTT_PPDU_ID_TQM_CMD_S 23
  15828. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15829. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15830. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15831. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15832. do { \
  15833. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15834. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15835. } while (0)
  15836. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15837. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15838. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15839. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15840. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15841. do { \
  15842. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15843. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15844. } while (0)
  15845. /**
  15846. * @brief target -> RX PEER METADATA V0 format
  15847. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15848. * message from target, and will confirm to the target which peer metadata
  15849. * version to use in the wmi_init message.
  15850. *
  15851. * The following diagram shows the format of the RX PEER METADATA.
  15852. *
  15853. * |31 24|23 16|15 8|7 0|
  15854. * |-----------------------------------------------------------------------|
  15855. * | Reserved | VDEV ID | PEER ID |
  15856. * |-----------------------------------------------------------------------|
  15857. */
  15858. PREPACK struct htt_rx_peer_metadata_v0 {
  15859. A_UINT32
  15860. peer_id: 16,
  15861. vdev_id: 8,
  15862. reserved1: 8;
  15863. } POSTPACK;
  15864. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15865. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15866. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15867. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15868. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15869. do { \
  15870. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15871. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15872. } while (0)
  15873. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15874. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15875. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15876. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15877. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15878. do { \
  15879. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15880. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15881. } while (0)
  15882. /**
  15883. * @brief target -> RX PEER METADATA V1 format
  15884. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15885. * message from target, and will confirm to the target which peer metadata
  15886. * version to use in the wmi_init message.
  15887. *
  15888. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15889. *
  15890. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15891. * |-----------------------------------------------------------------------|
  15892. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15893. * |-----------------------------------------------------------------------|
  15894. */
  15895. PREPACK struct htt_rx_peer_metadata_v1 {
  15896. A_UINT32
  15897. peer_id: 13,
  15898. ml_peer_valid: 1,
  15899. reserved1: 2,
  15900. vdev_id: 8,
  15901. lmac_id: 2,
  15902. chip_id: 3,
  15903. reserved2: 3;
  15904. } POSTPACK;
  15905. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15906. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15907. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15908. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15909. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15910. do { \
  15911. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15912. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15913. } while (0)
  15914. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15915. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15916. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15917. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15918. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15919. do { \
  15920. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15921. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15922. } while (0)
  15923. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15924. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15925. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15926. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15927. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15928. do { \
  15929. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15930. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15931. } while (0)
  15932. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15933. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15934. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15935. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15936. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15937. do { \
  15938. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15939. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15940. } while (0)
  15941. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15942. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15943. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15944. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15945. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15946. do { \
  15947. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15948. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15949. } while (0)
  15950. /*
  15951. * In some systems, the host SW wants to specify priorities between
  15952. * different MSDU / flow queues within the same peer-TID.
  15953. * The below enums are used for the host to identify to the target
  15954. * which MSDU queue's priority it wants to adjust.
  15955. */
  15956. /*
  15957. * The MSDUQ index describe index of TCL HW, where each index is
  15958. * used for queuing particular types of MSDUs.
  15959. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15960. */
  15961. enum HTT_MSDUQ_INDEX {
  15962. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15963. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15964. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15965. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15966. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15967. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15968. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15969. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15970. HTT_MSDUQ_MAX_INDEX,
  15971. };
  15972. /* MSDU qtype definition */
  15973. enum HTT_MSDU_QTYPE {
  15974. /*
  15975. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15976. * relative priority. Instead, the relative priority of CRIT_0 versus
  15977. * CRIT_1 is controlled by the FW, through the configuration parameters
  15978. * it applies to the queues.
  15979. */
  15980. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15981. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15982. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15983. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15984. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15985. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15986. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15987. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15988. /* New MSDU_QTYPE should be added above this line */
  15989. /*
  15990. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15991. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15992. * any host/target message definitions. The QTYPE_MAX value can
  15993. * only be used internally within the host or within the target.
  15994. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15995. * it must regard the unexpected value as a default qtype value,
  15996. * or ignore it.
  15997. */
  15998. HTT_MSDU_QTYPE_MAX,
  15999. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16000. };
  16001. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16002. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16003. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16004. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16005. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16006. };
  16007. /**
  16008. * @brief target -> host mlo timestamp offset indication
  16009. *
  16010. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16011. *
  16012. * @details
  16013. * The following field definitions describe the format of the HTT target
  16014. * to host mlo timestamp offset indication message.
  16015. *
  16016. *
  16017. * |31 16|15 12|11 10|9 8|7 0 |
  16018. * |----------------------------------------------------------------------|
  16019. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16020. * |----------------------------------------------------------------------|
  16021. * | Sync time stamp lo in us |
  16022. * |----------------------------------------------------------------------|
  16023. * | Sync time stamp hi in us |
  16024. * |----------------------------------------------------------------------|
  16025. * | mlo time stamp offset lo in us |
  16026. * |----------------------------------------------------------------------|
  16027. * | mlo time stamp offset hi in us |
  16028. * |----------------------------------------------------------------------|
  16029. * | mlo time stamp offset clocks in clock ticks |
  16030. * |----------------------------------------------------------------------|
  16031. * |31 26|25 16|15 0 |
  16032. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16033. * | | compensation in clks | |
  16034. * |----------------------------------------------------------------------|
  16035. * |31 22|21 0 |
  16036. * | rsvd 3 | mlo time stamp comp timer period |
  16037. * |----------------------------------------------------------------------|
  16038. * The message is interpreted as follows:
  16039. *
  16040. * dword0 - b'0:7 - msg_type: This will be set to
  16041. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16042. * value: 0x28
  16043. *
  16044. * dword0 - b'9:8 - pdev_id
  16045. *
  16046. * dword0 - b'11:10 - chip_id
  16047. *
  16048. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16049. *
  16050. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16051. *
  16052. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16053. * which last sync interrupt was received
  16054. *
  16055. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16056. * which last sync interrupt was received
  16057. *
  16058. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16059. *
  16060. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16061. *
  16062. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16063. *
  16064. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16065. *
  16066. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16067. * for sub us resolution
  16068. *
  16069. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16070. *
  16071. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16072. * is applied, in us
  16073. *
  16074. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16075. */
  16076. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16077. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16078. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16079. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16080. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16081. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16082. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16083. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16084. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16085. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16086. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16087. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16088. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16089. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16090. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16091. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16092. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16093. do { \
  16094. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16095. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16096. } while (0)
  16097. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16098. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16099. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16100. do { \
  16101. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16102. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16103. } while (0)
  16104. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16105. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16106. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16107. do { \
  16108. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16109. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16110. } while (0)
  16111. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16112. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16113. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16114. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16115. do { \
  16116. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16117. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16118. } while (0)
  16119. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16120. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16121. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16122. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16123. do { \
  16124. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16125. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16126. } while (0)
  16127. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16128. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16129. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16130. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16131. do { \
  16132. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16133. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16134. } while (0)
  16135. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16136. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16137. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16138. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16139. do { \
  16140. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16141. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16142. } while (0)
  16143. typedef struct {
  16144. A_UINT32 msg_type: 8, /* bits 7:0 */
  16145. pdev_id: 2, /* bits 9:8 */
  16146. chip_id: 2, /* bits 11:10 */
  16147. reserved1: 4, /* bits 15:12 */
  16148. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16149. A_UINT32 sync_timestamp_lo_us;
  16150. A_UINT32 sync_timestamp_hi_us;
  16151. A_UINT32 mlo_timestamp_offset_lo_us;
  16152. A_UINT32 mlo_timestamp_offset_hi_us;
  16153. A_UINT32 mlo_timestamp_offset_clks;
  16154. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16155. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16156. reserved2: 6; /* bits 31:26 */
  16157. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16158. reserved3: 10; /* bits 31:22 */
  16159. } htt_t2h_mlo_offset_ind_t;
  16160. /*
  16161. * @brief target -> host VDEV TX RX STATS
  16162. *
  16163. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16164. *
  16165. * @details
  16166. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16167. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16168. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16169. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16170. * periodically by target even in the absence of any further HTT request
  16171. * messages from host.
  16172. *
  16173. * The message is formatted as follows:
  16174. *
  16175. * |31 16|15 8|7 0|
  16176. * |---------------------------------+----------------+----------------|
  16177. * | payload_size | pdev_id | msg_type |
  16178. * |---------------------------------+----------------+----------------|
  16179. * | reserved0 |
  16180. * |-------------------------------------------------------------------|
  16181. * | reserved1 |
  16182. * |-------------------------------------------------------------------|
  16183. * | reserved2 |
  16184. * |-------------------------------------------------------------------|
  16185. * | |
  16186. * | VDEV specific Tx Rx stats info |
  16187. * | |
  16188. * |-------------------------------------------------------------------|
  16189. *
  16190. * The message is interpreted as follows:
  16191. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16192. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16193. * b'8:15 - pdev_id
  16194. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16195. * message header fields (msg_type through reserved2)
  16196. * dword1 - b'0:31 - reserved0.
  16197. * dword2 - b'0:31 - reserved1.
  16198. * dword3 - b'0:31 - reserved2.
  16199. */
  16200. typedef struct {
  16201. A_UINT32 msg_type: 8,
  16202. pdev_id: 8,
  16203. payload_size: 16;
  16204. A_UINT32 reserved0;
  16205. A_UINT32 reserved1;
  16206. A_UINT32 reserved2;
  16207. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16208. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16209. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16210. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16211. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16212. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16213. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16214. do { \
  16215. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16216. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16217. } while (0)
  16218. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16219. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16220. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16221. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16222. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16223. do { \
  16224. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16225. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16226. } while (0)
  16227. /* SOC related stats */
  16228. typedef struct {
  16229. htt_tlv_hdr_t tlv_hdr;
  16230. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16231. * This can be due to either the peer is deleted or deletion is ongoing
  16232. * */
  16233. A_UINT32 inv_peers_msdu_drop_count_lo;
  16234. A_UINT32 inv_peers_msdu_drop_count_hi;
  16235. } htt_t2h_soc_txrx_stats_common_tlv;
  16236. /* VDEV HW Tx/Rx stats */
  16237. typedef struct {
  16238. htt_tlv_hdr_t tlv_hdr;
  16239. A_UINT32 vdev_id;
  16240. /* Rx msdu byte cnt */
  16241. A_UINT32 rx_msdu_byte_cnt_lo;
  16242. A_UINT32 rx_msdu_byte_cnt_hi;
  16243. /* Rx msdu cnt */
  16244. A_UINT32 rx_msdu_cnt_lo;
  16245. A_UINT32 rx_msdu_cnt_hi;
  16246. /* tx msdu byte cnt */
  16247. A_UINT32 tx_msdu_byte_cnt_lo;
  16248. A_UINT32 tx_msdu_byte_cnt_hi;
  16249. /* tx msdu cnt */
  16250. A_UINT32 tx_msdu_cnt_lo;
  16251. A_UINT32 tx_msdu_cnt_hi;
  16252. /* tx excessive retry discarded msdu cnt */
  16253. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16254. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16255. /* TX congestion ctrl msdu drop cnt */
  16256. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16257. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16258. /* discarded tx msdus cnt coz of time to live expiry */
  16259. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16260. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16261. /* tx excessive retry discarded msdu byte cnt */
  16262. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16263. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16264. /* TX congestion ctrl msdu drop byte cnt */
  16265. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16266. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16267. /* discarded tx msdus byte cnt coz of time to live expiry */
  16268. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16269. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16270. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16271. /*
  16272. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16273. *
  16274. * @details
  16275. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16276. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16277. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16278. * the default MSDU queues of each of the specified TIDs for the peer
  16279. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16280. * If the default MSDU queues of a given TID within the peer are not linked
  16281. * to a service class, the svc_class_id field for that TID will have a
  16282. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16283. * queues for that TID are not mapped to any service class.
  16284. *
  16285. * |31 16|15 8|7 0|
  16286. * |------------------------------+--------------+--------------|
  16287. * | peer ID | reserved | msg type |
  16288. * |------------------------------+--------------+------+-------|
  16289. * | reserved | svc class ID | TID |
  16290. * |------------------------------------------------------------|
  16291. * ...
  16292. * |------------------------------------------------------------|
  16293. * | reserved | svc class ID | TID |
  16294. * |------------------------------------------------------------|
  16295. * Header fields:
  16296. * dword0 - b'7:0 - msg_type: This will be set to
  16297. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16298. * b'31:16 - peer ID
  16299. * dword1 - b'7:0 - TID
  16300. * b'15:8 - svc class ID
  16301. * (dword2, etc. same format as dword1)
  16302. */
  16303. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16304. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16305. A_UINT32 msg_type :8,
  16306. reserved0 :8,
  16307. peer_id :16;
  16308. struct {
  16309. A_UINT32 tid :8,
  16310. svc_class_id :8,
  16311. reserved1 :16;
  16312. } tid_reports[1/*or more*/];
  16313. } POSTPACK;
  16314. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16315. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16316. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16317. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16318. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16319. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16320. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16321. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16322. do { \
  16323. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16324. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16325. } while (0)
  16326. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16327. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16328. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16329. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16330. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16331. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16332. do { \
  16333. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16334. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16335. } while (0)
  16336. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16337. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16338. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16339. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16340. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16341. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16342. do { \
  16343. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16344. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16345. } while (0)
  16346. /*
  16347. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16348. *
  16349. * @details
  16350. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16351. * flow if the flow is seen the associated service class is conveyed to the
  16352. * target via TCL Data Command. Target on the other hand internally creates the
  16353. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16354. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16355. * the newly created MSDUQ
  16356. *
  16357. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16358. * |------------------------------+------------------------+--------------|
  16359. * | peer ID | HTT qtype | msg type |
  16360. * |---------------------------------+--------------+--+---+-------+------|
  16361. * | reserved |AST list index|FO|WC | HLOS | remap|
  16362. * | | | | | TID | TID |
  16363. * |---------------------+------------------------------------------------|
  16364. * | reserved1 | tgt_opaque_id |
  16365. * |---------------------+------------------------------------------------|
  16366. *
  16367. * Header fields:
  16368. *
  16369. * dword0 - b'7:0 - msg_type: This will be set to
  16370. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16371. * b'15:8 - HTT qtype
  16372. * b'31:16 - peer ID
  16373. *
  16374. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16375. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16376. * hlos_tid : Common to Lithium and Beryllium
  16377. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16378. * TCL Data Command : Beryllium
  16379. * b10 - flow_override (FO), as sent by host in
  16380. * TCL Data Command: Beryllium
  16381. * b11:14 - ast_list_idx
  16382. * Array index into the list of extension AST entries
  16383. * (not the actual AST 16-bit index).
  16384. * The ast_list_idx is one-based, with the following
  16385. * range of values:
  16386. * - legacy targets supporting 16 user-defined
  16387. * MSDU queues: 1-2
  16388. * - legacy targets supporting 48 user-defined
  16389. * MSDU queues: 1-6
  16390. * - new targets: 0 (peer_id is used instead)
  16391. * Note that since ast_list_idx is one-based,
  16392. * the host will need to subtract 1 to use it as an
  16393. * index into a list of extension AST entries.
  16394. * b15:31 - reserved
  16395. *
  16396. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16397. * unique MSDUQ id in firmware
  16398. * b'24:31 - reserved1
  16399. */
  16400. PREPACK struct htt_t2h_sawf_msduq_event {
  16401. A_UINT32 msg_type : 8,
  16402. htt_qtype : 8,
  16403. peer_id :16;
  16404. A_UINT32 remap_tid : 4,
  16405. hlos_tid : 4,
  16406. who_classify_info_sel : 2,
  16407. flow_override : 1,
  16408. ast_list_idx : 4,
  16409. reserved :17;
  16410. A_UINT32 tgt_opaque_id :24,
  16411. reserved1 : 8;
  16412. } POSTPACK;
  16413. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16414. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16415. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16416. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16417. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16418. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16419. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16420. do { \
  16421. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16422. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16423. } while (0)
  16424. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16425. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16426. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16427. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16428. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16429. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16430. do { \
  16431. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16432. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16433. } while (0)
  16434. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16435. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16436. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16437. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16438. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16439. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16440. do { \
  16441. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16442. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16443. } while (0)
  16444. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16445. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16446. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16447. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16448. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16449. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16450. do { \
  16451. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16452. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16453. } while (0)
  16454. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16455. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16456. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16457. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16458. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16459. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16460. do { \
  16461. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16462. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16463. } while (0)
  16464. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16465. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16466. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16467. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16468. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16469. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16470. do { \
  16471. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16472. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16473. } while (0)
  16474. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16475. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16476. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16477. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16478. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  16479. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  16480. do { \
  16481. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  16482. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  16483. } while (0)
  16484. #endif