htt.h 900 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466
  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. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. */
  236. #define HTT_CURRENT_VERSION_MAJOR 3
  237. #define HTT_CURRENT_VERSION_MINOR 114
  238. #define HTT_NUM_TX_FRAG_DESC 1024
  239. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  240. #define HTT_CHECK_SET_VAL(field, val) \
  241. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  242. /* macros to assist in sign-extending fields from HTT messages */
  243. #define HTT_SIGN_BIT_MASK(field) \
  244. ((field ## _M + (1 << field ## _S)) >> 1)
  245. #define HTT_SIGN_BIT(_val, field) \
  246. (_val & HTT_SIGN_BIT_MASK(field))
  247. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  248. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  249. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  250. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  251. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  252. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  253. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  254. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  255. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  256. /*
  257. * TEMPORARY:
  258. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  259. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  260. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  261. * updated.
  262. */
  263. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  264. /*
  265. * TEMPORARY:
  266. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  267. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  268. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  269. * updated.
  270. */
  271. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  272. /**
  273. * htt_dbg_stats_type -
  274. * bit positions for each stats type within a stats type bitmask
  275. * The bitmask contains 24 bits.
  276. */
  277. enum htt_dbg_stats_type {
  278. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  279. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  280. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  281. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  282. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  283. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  284. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  285. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  286. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  287. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  288. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  289. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  290. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  291. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  292. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  293. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  294. /* bits 16-23 currently reserved */
  295. /* keep this last */
  296. HTT_DBG_NUM_STATS
  297. };
  298. /*=== HTT option selection TLVs ===
  299. * Certain HTT messages have alternatives or options.
  300. * For such cases, the host and target need to agree on which option to use.
  301. * Option specification TLVs can be appended to the VERSION_REQ and
  302. * VERSION_CONF messages to select options other than the default.
  303. * These TLVs are entirely optional - if they are not provided, there is a
  304. * well-defined default for each option. If they are provided, they can be
  305. * provided in any order. Each TLV can be present or absent independent of
  306. * the presence / absence of other TLVs.
  307. *
  308. * The HTT option selection TLVs use the following format:
  309. * |31 16|15 8|7 0|
  310. * |---------------------------------+----------------+----------------|
  311. * | value (payload) | length | tag |
  312. * |-------------------------------------------------------------------|
  313. * The value portion need not be only 2 bytes; it can be extended by any
  314. * integer number of 4-byte units. The total length of the TLV, including
  315. * the tag and length fields, must be a multiple of 4 bytes. The length
  316. * field specifies the total TLV size in 4-byte units. Thus, the typical
  317. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  318. * field, would store 0x1 in its length field, to show that the TLV occupies
  319. * a single 4-byte unit.
  320. */
  321. /*--- TLV header format - applies to all HTT option TLVs ---*/
  322. enum HTT_OPTION_TLV_TAGS {
  323. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  324. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  325. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  326. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  327. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  328. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  329. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  330. };
  331. #define HTT_TCL_METADATA_VER_SZ 4
  332. PREPACK struct htt_option_tlv_header_t {
  333. A_UINT8 tag;
  334. A_UINT8 length;
  335. } POSTPACK;
  336. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  337. #define HTT_OPTION_TLV_TAG_S 0
  338. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  339. #define HTT_OPTION_TLV_LENGTH_S 8
  340. /*
  341. * value0 - 16 bit value field stored in word0
  342. * The TLV's value field may be longer than 2 bytes, in which case
  343. * the remainder of the value is stored in word1, word2, etc.
  344. */
  345. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  346. #define HTT_OPTION_TLV_VALUE0_S 16
  347. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_TAG_GET(word) \
  353. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  354. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  355. do { \
  356. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  357. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  358. } while (0)
  359. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  360. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  361. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  362. do { \
  363. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  364. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  365. } while (0)
  366. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  367. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  368. /*--- format of specific HTT option TLVs ---*/
  369. /*
  370. * HTT option TLV for specifying LL bus address size
  371. * Some chips require bus addresses used by the target to access buffers
  372. * within the host's memory to be 32 bits; others require bus addresses
  373. * used by the target to access buffers within the host's memory to be
  374. * 64 bits.
  375. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  376. * a suffix to the VERSION_CONF message to specify which bus address format
  377. * the target requires.
  378. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  379. * default to providing bus addresses to the target in 32-bit format.
  380. */
  381. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  382. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  383. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  384. };
  385. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  386. struct htt_option_tlv_header_t hdr;
  387. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  388. } POSTPACK;
  389. /*
  390. * HTT option TLV for specifying whether HL systems should indicate
  391. * over-the-air tx completion for individual frames, or should instead
  392. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  393. * requests an OTA tx completion for a particular tx frame.
  394. * This option does not apply to LL systems, where the TX_COMPL_IND
  395. * is mandatory.
  396. * This option is primarily intended for HL systems in which the tx frame
  397. * downloads over the host --> target bus are as slow as or slower than
  398. * the transmissions over the WLAN PHY. For cases where the bus is faster
  399. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  400. * and consequently will send one TX_COMPL_IND message that covers several
  401. * tx frames. For cases where the WLAN PHY is faster than the bus,
  402. * the target will end up transmitting very short A-MPDUs, and consequently
  403. * sending many TX_COMPL_IND messages, which each cover a very small number
  404. * of tx frames.
  405. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  406. * a suffix to the VERSION_REQ message to request whether the host desires to
  407. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  408. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  409. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  410. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  411. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  412. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  413. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  414. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  415. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  416. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  417. * TLV.
  418. */
  419. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  420. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  421. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  422. };
  423. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  424. struct htt_option_tlv_header_t hdr;
  425. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  426. } POSTPACK;
  427. /*
  428. * HTT option TLV for specifying how many tx queue groups the target
  429. * may establish.
  430. * This TLV specifies the maximum value the target may send in the
  431. * txq_group_id field of any TXQ_GROUP information elements sent by
  432. * the target to the host. This allows the host to pre-allocate an
  433. * appropriate number of tx queue group structs.
  434. *
  435. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  436. * a suffix to the VERSION_REQ message to specify whether the host supports
  437. * tx queue groups at all, and if so if there is any limit on the number of
  438. * tx queue groups that the host supports.
  439. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  440. * a suffix to the VERSION_CONF message. If the host has specified in the
  441. * VER_REQ message a limit on the number of tx queue groups the host can
  442. * support, the target shall limit its specification of the maximum tx groups
  443. * to be no larger than this host-specified limit.
  444. *
  445. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  446. * shall preallocate 4 tx queue group structs, and the target shall not
  447. * specify a txq_group_id larger than 3.
  448. */
  449. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  451. /*
  452. * values 1 through N specify the max number of tx queue groups
  453. * the sender supports
  454. */
  455. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  456. };
  457. /* TEMPORARY backwards-compatibility alias for a typo fix -
  458. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  459. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  460. * to support the old name (with the typo) until all references to the
  461. * old name are replaced with the new name.
  462. */
  463. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  464. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  465. struct htt_option_tlv_header_t hdr;
  466. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  467. } POSTPACK;
  468. /*
  469. * HTT option TLV for specifying whether the target supports an extended
  470. * version of the HTT tx descriptor. If the target provides this TLV
  471. * and specifies in the TLV that the target supports an extended version
  472. * of the HTT tx descriptor, the target must check the "extension" bit in
  473. * the HTT tx descriptor, and if the extension bit is set, to expect a
  474. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  475. * descriptor. Furthermore, the target must provide room for the HTT
  476. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  477. * This option is intended for systems where the host needs to explicitly
  478. * control the transmission parameters such as tx power for individual
  479. * tx frames.
  480. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  481. * as a suffix to the VERSION_CONF message to explicitly specify whether
  482. * the target supports the HTT tx MSDU extension descriptor.
  483. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  484. * by the host as lack of target support for the HTT tx MSDU extension
  485. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  486. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  487. * the HTT tx MSDU extension descriptor.
  488. * The host is not required to provide the HTT tx MSDU extension descriptor
  489. * just because the target supports it; the target must check the
  490. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  491. * extension descriptor is present.
  492. */
  493. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  494. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  495. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  496. };
  497. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  498. struct htt_option_tlv_header_t hdr;
  499. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  500. } POSTPACK;
  501. /*
  502. * For the tcl data command V2 and higher support added a new
  503. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  504. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  505. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  506. * HTT option TLV for specifying which version of the TCL metadata struct
  507. * should be used:
  508. * V1 -> use htt_tx_tcl_metadata struct
  509. * V2 -> use htt_tx_tcl_metadata_v2 struct
  510. * Old FW will only support V1.
  511. * New FW will support V2. New FW will still support V1, at least during
  512. * a transition period.
  513. * Similarly, old host will only support V1, and new host will support V1 + V2.
  514. *
  515. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  517. * of TCL metadata the host supports. If the host doesn't provide a
  518. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  519. * is implicitly understood that the host only supports V1.
  520. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  521. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  522. * the host shall use. The target shall only select one of the versions
  523. * supported by the host. If the target doesn't provide a
  524. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  525. * is implicitly understood that the V1 TCL metadata shall be used.
  526. */
  527. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  528. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  529. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  530. };
  531. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  532. struct htt_option_tlv_header_t hdr;
  533. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  534. } POSTPACK;
  535. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  536. HTT_OPTION_TLV_VALUE0_SET(word, value)
  537. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  538. HTT_OPTION_TLV_VALUE0_GET(word)
  539. typedef struct {
  540. union {
  541. /* BIT [11 : 0] :- tag
  542. * BIT [23 : 12] :- length
  543. * BIT [31 : 24] :- reserved
  544. */
  545. A_UINT32 tag__length;
  546. /*
  547. * The following struct is not endian-portable.
  548. * It is suitable for use within the target, which is known to be
  549. * little-endian.
  550. * The host should use the above endian-portable macros to access
  551. * the tag and length bitfields in an endian-neutral manner.
  552. */
  553. struct {
  554. A_UINT32 tag : 12, /* BIT [11 : 0] */
  555. length : 12, /* BIT [23 : 12] */
  556. reserved : 8; /* BIT [31 : 24] */
  557. };
  558. };
  559. } htt_tlv_hdr_t;
  560. /** HTT stats TLV tag values */
  561. typedef enum {
  562. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  563. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  564. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  565. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  566. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  567. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  568. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  569. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  570. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  571. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  572. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  573. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  574. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  575. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  576. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  577. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  578. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  579. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  580. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  581. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  582. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  583. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  584. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  585. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  586. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  587. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  588. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  589. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  590. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  591. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  592. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  593. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  594. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  595. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  596. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  597. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  598. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  599. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  600. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  602. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  603. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  604. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  605. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  606. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  607. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  608. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  609. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  610. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  612. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  613. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  614. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  615. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  616. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  617. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  618. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  619. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  620. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  621. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  622. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  623. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  624. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  625. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  626. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  627. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  628. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  629. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  630. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  631. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  632. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  633. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  634. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  635. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  636. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  637. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  638. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  639. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  640. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  641. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  642. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  643. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  644. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  645. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  646. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  647. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  648. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  649. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  650. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  651. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  652. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  653. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  654. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  655. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  656. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  657. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  658. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  659. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  660. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  661. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  662. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  663. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  664. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  665. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  666. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  667. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  668. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  669. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  670. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  671. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  672. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  673. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  674. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  675. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  676. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  677. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  678. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  679. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  680. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  681. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  682. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  683. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  684. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  685. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  686. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  687. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  688. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  689. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  690. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  691. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  692. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  693. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  694. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  695. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  696. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  697. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  698. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  699. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  700. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  701. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  702. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  703. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  704. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  705. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  706. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  707. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  708. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  709. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  717. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  718. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  719. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  720. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  721. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  722. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  723. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  724. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  725. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  726. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  727. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  728. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  729. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  730. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  731. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  732. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  733. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  734. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  735. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  736. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  737. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  738. HTT_STATS_MAX_TAG,
  739. } htt_stats_tlv_tag_t;
  740. /* retain deprecated enum name as an alias for the current enum name */
  741. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  742. #define HTT_STATS_TLV_TAG_M 0x00000fff
  743. #define HTT_STATS_TLV_TAG_S 0
  744. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  745. #define HTT_STATS_TLV_LENGTH_S 12
  746. #define HTT_STATS_TLV_TAG_GET(_var) \
  747. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  748. HTT_STATS_TLV_TAG_S)
  749. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  750. do { \
  751. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  752. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  753. } while (0)
  754. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  755. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  756. HTT_STATS_TLV_LENGTH_S)
  757. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  758. do { \
  759. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  760. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  761. } while (0)
  762. /*=== host -> target messages ===============================================*/
  763. enum htt_h2t_msg_type {
  764. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  765. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  766. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  767. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  768. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  769. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  770. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  771. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  772. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  773. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  774. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  775. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  776. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  777. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  778. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  779. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  780. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  781. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  782. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  783. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  784. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  785. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  786. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  787. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  788. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  789. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  790. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  791. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  792. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  793. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  794. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  795. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  796. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  797. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  798. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  799. /* keep this last */
  800. HTT_H2T_NUM_MSGS
  801. };
  802. /*
  803. * HTT host to target message type -
  804. * stored in bits 7:0 of the first word of the message
  805. */
  806. #define HTT_H2T_MSG_TYPE_M 0xff
  807. #define HTT_H2T_MSG_TYPE_S 0
  808. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  809. do { \
  810. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  811. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  812. } while (0)
  813. #define HTT_H2T_MSG_TYPE_GET(word) \
  814. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  815. /**
  816. * @brief host -> target version number request message definition
  817. *
  818. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  819. *
  820. *
  821. * |31 24|23 16|15 8|7 0|
  822. * |----------------+----------------+----------------+----------------|
  823. * | reserved | msg type |
  824. * |-------------------------------------------------------------------|
  825. * : option request TLV (optional) |
  826. * :...................................................................:
  827. *
  828. * The VER_REQ message may consist of a single 4-byte word, or may be
  829. * extended with TLVs that specify which HTT options the host is requesting
  830. * from the target.
  831. * The following option TLVs may be appended to the VER_REQ message:
  832. * - HL_SUPPRESS_TX_COMPL_IND
  833. * - HL_MAX_TX_QUEUE_GROUPS
  834. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  835. * may be appended to the VER_REQ message (but only one TLV of each type).
  836. *
  837. * Header fields:
  838. * - MSG_TYPE
  839. * Bits 7:0
  840. * Purpose: identifies this as a version number request message
  841. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  842. */
  843. #define HTT_VER_REQ_BYTES 4
  844. /* TBDXXX: figure out a reasonable number */
  845. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  846. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  847. /**
  848. * @brief HTT tx MSDU descriptor
  849. *
  850. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  851. *
  852. * @details
  853. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  854. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  855. * the target firmware needs for the FW's tx processing, particularly
  856. * for creating the HW msdu descriptor.
  857. * The same HTT tx descriptor is used for HL and LL systems, though
  858. * a few fields within the tx descriptor are used only by LL or
  859. * only by HL.
  860. * The HTT tx descriptor is defined in two manners: by a struct with
  861. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  862. * definitions.
  863. * The target should use the struct def, for simplicitly and clarity,
  864. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  865. * neutral. Specifically, the host shall use the get/set macros built
  866. * around the mask + shift defs.
  867. */
  868. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  869. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  870. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  871. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  872. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  873. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  874. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  875. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  876. #define HTT_TX_VDEV_ID_WORD 0
  877. #define HTT_TX_VDEV_ID_MASK 0x3f
  878. #define HTT_TX_VDEV_ID_SHIFT 16
  879. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  880. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  881. #define HTT_TX_MSDU_LEN_DWORD 1
  882. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  883. /*
  884. * HTT_VAR_PADDR macros
  885. * Allow physical / bus addresses to be either a single 32-bit value,
  886. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  887. */
  888. #define HTT_VAR_PADDR32(var_name) \
  889. A_UINT32 var_name
  890. #define HTT_VAR_PADDR64_LE(var_name) \
  891. struct { \
  892. /* little-endian: lo precedes hi */ \
  893. A_UINT32 lo; \
  894. A_UINT32 hi; \
  895. } var_name
  896. /*
  897. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  898. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  899. * addresses are stored in a XXX-bit field.
  900. * This macro is used to define both htt_tx_msdu_desc32_t and
  901. * htt_tx_msdu_desc64_t structs.
  902. */
  903. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  904. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  905. { \
  906. /* DWORD 0: flags and meta-data */ \
  907. A_UINT32 \
  908. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  909. \
  910. /* pkt_subtype - \
  911. * Detailed specification of the tx frame contents, extending the \
  912. * general specification provided by pkt_type. \
  913. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  914. * pkt_type | pkt_subtype \
  915. * ============================================================== \
  916. * 802.3 | bit 0:3 - Reserved \
  917. * | bit 4: 0x0 - Copy-Engine Classification Results \
  918. * | not appended to the HTT message \
  919. * | 0x1 - Copy-Engine Classification Results \
  920. * | appended to the HTT message in the \
  921. * | format: \
  922. * | [HTT tx desc, frame header, \
  923. * | CE classification results] \
  924. * | The CE classification results begin \
  925. * | at the next 4-byte boundary after \
  926. * | the frame header. \
  927. * ------------+------------------------------------------------- \
  928. * Eth2 | bit 0:3 - Reserved \
  929. * | bit 4: 0x0 - Copy-Engine Classification Results \
  930. * | not appended to the HTT message \
  931. * | 0x1 - Copy-Engine Classification Results \
  932. * | appended to the HTT message. \
  933. * | See the above specification of the \
  934. * | CE classification results location. \
  935. * ------------+------------------------------------------------- \
  936. * native WiFi | bit 0:3 - Reserved \
  937. * | bit 4: 0x0 - Copy-Engine Classification Results \
  938. * | not appended to the HTT message \
  939. * | 0x1 - Copy-Engine Classification Results \
  940. * | appended to the HTT message. \
  941. * | See the above specification of the \
  942. * | CE classification results location. \
  943. * ------------+------------------------------------------------- \
  944. * mgmt | 0x0 - 802.11 MAC header absent \
  945. * | 0x1 - 802.11 MAC header present \
  946. * ------------+------------------------------------------------- \
  947. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  948. * | 0x1 - 802.11 MAC header present \
  949. * | bit 1: 0x0 - allow aggregation \
  950. * | 0x1 - don't allow aggregation \
  951. * | bit 2: 0x0 - perform encryption \
  952. * | 0x1 - don't perform encryption \
  953. * | bit 3: 0x0 - perform tx classification / queuing \
  954. * | 0x1 - don't perform tx classification; \
  955. * | insert the frame into the "misc" \
  956. * | tx queue \
  957. * | bit 4: 0x0 - Copy-Engine Classification Results \
  958. * | not appended to the HTT message \
  959. * | 0x1 - Copy-Engine Classification Results \
  960. * | appended to the HTT message. \
  961. * | See the above specification of the \
  962. * | CE classification results location. \
  963. */ \
  964. pkt_subtype: 5, \
  965. \
  966. /* pkt_type - \
  967. * General specification of the tx frame contents. \
  968. * The htt_pkt_type enum should be used to specify and check the \
  969. * value of this field. \
  970. */ \
  971. pkt_type: 3, \
  972. \
  973. /* vdev_id - \
  974. * ID for the vdev that is sending this tx frame. \
  975. * For certain non-standard packet types, e.g. pkt_type == raw \
  976. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  977. * This field is used primarily for determining where to queue \
  978. * broadcast and multicast frames. \
  979. */ \
  980. vdev_id: 6, \
  981. /* ext_tid - \
  982. * The extended traffic ID. \
  983. * If the TID is unknown, the extended TID is set to \
  984. * HTT_TX_EXT_TID_INVALID. \
  985. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  986. * value of the QoS TID. \
  987. * If the tx frame is non-QoS data, then the extended TID is set to \
  988. * HTT_TX_EXT_TID_NON_QOS. \
  989. * If the tx frame is multicast or broadcast, then the extended TID \
  990. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  991. */ \
  992. ext_tid: 5, \
  993. \
  994. /* postponed - \
  995. * This flag indicates whether the tx frame has been downloaded to \
  996. * the target before but discarded by the target, and now is being \
  997. * downloaded again; or if this is a new frame that is being \
  998. * downloaded for the first time. \
  999. * This flag allows the target to determine the correct order for \
  1000. * transmitting new vs. old frames. \
  1001. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1002. * This flag only applies to HL systems, since in LL systems, \
  1003. * the tx flow control is handled entirely within the target. \
  1004. */ \
  1005. postponed: 1, \
  1006. \
  1007. /* extension - \
  1008. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1009. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1010. * \
  1011. * 0x0 - no extension MSDU descriptor is present \
  1012. * 0x1 - an extension MSDU descriptor immediately follows the \
  1013. * regular MSDU descriptor \
  1014. */ \
  1015. extension: 1, \
  1016. \
  1017. /* cksum_offload - \
  1018. * This flag indicates whether checksum offload is enabled or not \
  1019. * for this frame. Target FW use this flag to turn on HW checksumming \
  1020. * 0x0 - No checksum offload \
  1021. * 0x1 - L3 header checksum only \
  1022. * 0x2 - L4 checksum only \
  1023. * 0x3 - L3 header checksum + L4 checksum \
  1024. */ \
  1025. cksum_offload: 2, \
  1026. \
  1027. /* tx_comp_req - \
  1028. * This flag indicates whether Tx Completion \
  1029. * from fw is required or not. \
  1030. * This flag is only relevant if tx completion is not \
  1031. * universally enabled. \
  1032. * For all LL systems, tx completion is mandatory, \
  1033. * so this flag will be irrelevant. \
  1034. * For HL systems tx completion is optional, but HL systems in which \
  1035. * the bus throughput exceeds the WLAN throughput will \
  1036. * probably want to always use tx completion, and thus \
  1037. * would not check this flag. \
  1038. * This flag is required when tx completions are not used universally, \
  1039. * but are still required for certain tx frames for which \
  1040. * an OTA delivery acknowledgment is needed by the host. \
  1041. * In practice, this would be for HL systems in which the \
  1042. * bus throughput is less than the WLAN throughput. \
  1043. * \
  1044. * 0x0 - Tx Completion Indication from Fw not required \
  1045. * 0x1 - Tx Completion Indication from Fw is required \
  1046. */ \
  1047. tx_compl_req: 1; \
  1048. \
  1049. \
  1050. /* DWORD 1: MSDU length and ID */ \
  1051. A_UINT32 \
  1052. len: 16, /* MSDU length, in bytes */ \
  1053. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1054. * and this id is used to calculate fragmentation \
  1055. * descriptor pointer inside the target based on \
  1056. * the base address, configured inside the target. \
  1057. */ \
  1058. \
  1059. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1060. /* frags_desc_ptr - \
  1061. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1062. * where the tx frame's fragments reside in memory. \
  1063. * This field only applies to LL systems, since in HL systems the \
  1064. * (degenerate single-fragment) fragmentation descriptor is created \
  1065. * within the target. \
  1066. */ \
  1067. _paddr__frags_desc_ptr_; \
  1068. \
  1069. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1070. /* \
  1071. * Peer ID : Target can use this value to know which peer-id packet \
  1072. * destined to. \
  1073. * It's intended to be specified by host in case of NAWDS. \
  1074. */ \
  1075. A_UINT16 peerid; \
  1076. \
  1077. /* \
  1078. * Channel frequency: This identifies the desired channel \
  1079. * frequency (in mhz) for tx frames. This is used by FW to help \
  1080. * determine when it is safe to transmit or drop frames for \
  1081. * off-channel operation. \
  1082. * The default value of zero indicates to FW that the corresponding \
  1083. * VDEV's home channel (if there is one) is the desired channel \
  1084. * frequency. \
  1085. */ \
  1086. A_UINT16 chanfreq; \
  1087. \
  1088. /* Reason reserved is commented is increasing the htt structure size \
  1089. * leads to some weird issues. \
  1090. * A_UINT32 reserved_dword3_bits0_31; \
  1091. */ \
  1092. } POSTPACK
  1093. /* define a htt_tx_msdu_desc32_t type */
  1094. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1095. /* define a htt_tx_msdu_desc64_t type */
  1096. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1097. /*
  1098. * Make htt_tx_msdu_desc_t be an alias for either
  1099. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1100. */
  1101. #if HTT_PADDR64
  1102. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1103. #else
  1104. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1105. #endif
  1106. /* decriptor information for Management frame*/
  1107. /*
  1108. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1109. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1110. */
  1111. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1112. extern A_UINT32 mgmt_hdr_len;
  1113. PREPACK struct htt_mgmt_tx_desc_t {
  1114. A_UINT32 msg_type;
  1115. #if HTT_PADDR64
  1116. A_UINT64 frag_paddr; /* DMAble address of the data */
  1117. #else
  1118. A_UINT32 frag_paddr; /* DMAble address of the data */
  1119. #endif
  1120. A_UINT32 desc_id; /* returned to host during completion
  1121. * to free the meory*/
  1122. A_UINT32 len; /* Fragment length */
  1123. A_UINT32 vdev_id; /* virtual device ID*/
  1124. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1125. } POSTPACK;
  1126. PREPACK struct htt_mgmt_tx_compl_ind {
  1127. A_UINT32 desc_id;
  1128. A_UINT32 status;
  1129. } POSTPACK;
  1130. /*
  1131. * This SDU header size comes from the summation of the following:
  1132. * 1. Max of:
  1133. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1134. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1135. * b. 802.11 header, for raw frames: 36 bytes
  1136. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1137. * QoS header, HT header)
  1138. * c. 802.3 header, for ethernet frames: 14 bytes
  1139. * (destination address, source address, ethertype / length)
  1140. * 2. Max of:
  1141. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1142. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1143. * 3. 802.1Q VLAN header: 4 bytes
  1144. * 4. LLC/SNAP header: 8 bytes
  1145. */
  1146. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1147. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1148. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1149. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1150. A_COMPILE_TIME_ASSERT(
  1151. htt_encap_hdr_size_max_check_nwifi,
  1152. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1153. A_COMPILE_TIME_ASSERT(
  1154. htt_encap_hdr_size_max_check_enet,
  1155. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1156. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1157. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1158. #define HTT_TX_HDR_SIZE_802_1Q 4
  1159. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1160. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1161. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1162. HTT_TX_HDR_SIZE_802_1Q + \
  1163. HTT_TX_HDR_SIZE_LLC_SNAP)
  1164. #define HTT_HL_TX_FRM_HDR_LEN \
  1165. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1166. #define HTT_LL_TX_FRM_HDR_LEN \
  1167. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1168. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1169. /* dword 0 */
  1170. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1171. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1172. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1173. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1174. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1175. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1176. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1177. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1178. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1179. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1180. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1181. #define HTT_TX_DESC_PKT_TYPE_S 13
  1182. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1183. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1184. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1185. #define HTT_TX_DESC_VDEV_ID_S 16
  1186. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1187. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1188. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1189. #define HTT_TX_DESC_EXT_TID_S 22
  1190. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1191. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1192. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1193. #define HTT_TX_DESC_POSTPONED_S 27
  1194. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1195. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1196. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1197. #define HTT_TX_DESC_EXTENSION_S 28
  1198. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1199. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1200. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1201. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1202. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1203. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1204. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1205. #define HTT_TX_DESC_TX_COMP_S 31
  1206. /* dword 1 */
  1207. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1208. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1209. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1210. #define HTT_TX_DESC_FRM_LEN_S 0
  1211. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1212. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1213. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1214. #define HTT_TX_DESC_FRM_ID_S 16
  1215. /* dword 2 */
  1216. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1217. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1218. /* for systems using 64-bit format for bus addresses */
  1219. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1220. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1221. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1222. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1223. /* for systems using 32-bit format for bus addresses */
  1224. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1226. /* dword 3 */
  1227. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1229. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1230. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1231. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1232. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1233. #if HTT_PADDR64
  1234. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1236. #else
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1239. #endif
  1240. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1241. #define HTT_TX_DESC_PEER_ID_S 0
  1242. /*
  1243. * TEMPORARY:
  1244. * The original definitions for the PEER_ID fields contained typos
  1245. * (with _DESC_PADDR appended to this PEER_ID field name).
  1246. * Retain deprecated original names for PEER_ID fields until all code that
  1247. * refers to them has been updated.
  1248. */
  1249. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1250. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1251. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1252. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1253. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1254. HTT_TX_DESC_PEER_ID_M
  1255. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1256. HTT_TX_DESC_PEER_ID_S
  1257. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1259. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1260. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1261. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1262. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1263. #if HTT_PADDR64
  1264. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1266. #else
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1269. #endif
  1270. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1271. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1272. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1273. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1274. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1278. } while (0)
  1279. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1281. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1288. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1295. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1299. } while (0)
  1300. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1302. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1309. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1316. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1323. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1330. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1334. } while (0)
  1335. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1336. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1337. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1341. } while (0)
  1342. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1343. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1344. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1348. } while (0)
  1349. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1350. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1351. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1355. } while (0)
  1356. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1357. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1358. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1362. } while (0)
  1363. /* enums used in the HTT tx MSDU extension descriptor */
  1364. enum {
  1365. htt_tx_guard_interval_regular = 0,
  1366. htt_tx_guard_interval_short = 1,
  1367. };
  1368. enum {
  1369. htt_tx_preamble_type_ofdm = 0,
  1370. htt_tx_preamble_type_cck = 1,
  1371. htt_tx_preamble_type_ht = 2,
  1372. htt_tx_preamble_type_vht = 3,
  1373. };
  1374. enum {
  1375. htt_tx_bandwidth_5MHz = 0,
  1376. htt_tx_bandwidth_10MHz = 1,
  1377. htt_tx_bandwidth_20MHz = 2,
  1378. htt_tx_bandwidth_40MHz = 3,
  1379. htt_tx_bandwidth_80MHz = 4,
  1380. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1381. };
  1382. /**
  1383. * @brief HTT tx MSDU extension descriptor
  1384. * @details
  1385. * If the target supports HTT tx MSDU extension descriptors, the host has
  1386. * the option of appending the following struct following the regular
  1387. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1388. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1389. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1390. * tx specs for each frame.
  1391. */
  1392. PREPACK struct htt_tx_msdu_desc_ext_t {
  1393. /* DWORD 0: flags */
  1394. A_UINT32
  1395. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1396. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1397. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1398. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1399. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1400. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1401. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1402. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1403. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1404. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1405. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1406. /* DWORD 1: tx power, tx rate, tx BW */
  1407. A_UINT32
  1408. /* pwr -
  1409. * Specify what power the tx frame needs to be transmitted at.
  1410. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1411. * The value needs to be appropriately sign-extended when extracting
  1412. * the value from the message and storing it in a variable that is
  1413. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1414. * automatically handles this sign-extension.)
  1415. * If the transmission uses multiple tx chains, this power spec is
  1416. * the total transmit power, assuming incoherent combination of
  1417. * per-chain power to produce the total power.
  1418. */
  1419. pwr: 8,
  1420. /* mcs_mask -
  1421. * Specify the allowable values for MCS index (modulation and coding)
  1422. * to use for transmitting the frame.
  1423. *
  1424. * For HT / VHT preamble types, this mask directly corresponds to
  1425. * the HT or VHT MCS indices that are allowed. For each bit N set
  1426. * within the mask, MCS index N is allowed for transmitting the frame.
  1427. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1428. * rates versus OFDM rates, so the host has the option of specifying
  1429. * that the target must transmit the frame with CCK or OFDM rates
  1430. * (not HT or VHT), but leaving the decision to the target whether
  1431. * to use CCK or OFDM.
  1432. *
  1433. * For CCK and OFDM, the bits within this mask are interpreted as
  1434. * follows:
  1435. * bit 0 -> CCK 1 Mbps rate is allowed
  1436. * bit 1 -> CCK 2 Mbps rate is allowed
  1437. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1438. * bit 3 -> CCK 11 Mbps rate is allowed
  1439. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1440. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1441. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1442. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1443. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1444. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1445. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1446. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1447. *
  1448. * The MCS index specification needs to be compatible with the
  1449. * bandwidth mask specification. For example, a MCS index == 9
  1450. * specification is inconsistent with a preamble type == VHT,
  1451. * Nss == 1, and channel bandwidth == 20 MHz.
  1452. *
  1453. * Furthermore, the host has only a limited ability to specify to
  1454. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1455. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1456. */
  1457. mcs_mask: 12,
  1458. /* nss_mask -
  1459. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1460. * Each bit in this mask corresponds to a Nss value:
  1461. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1462. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1463. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1464. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1465. * The values in the Nss mask must be suitable for the recipient, e.g.
  1466. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1467. * recipient which only supports 2x2 MIMO.
  1468. */
  1469. nss_mask: 4,
  1470. /* guard_interval -
  1471. * Specify a htt_tx_guard_interval enum value to indicate whether
  1472. * the transmission should use a regular guard interval or a
  1473. * short guard interval.
  1474. */
  1475. guard_interval: 1,
  1476. /* preamble_type_mask -
  1477. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1478. * may choose from for transmitting this frame.
  1479. * The bits in this mask correspond to the values in the
  1480. * htt_tx_preamble_type enum. For example, to allow the target
  1481. * to transmit the frame as either CCK or OFDM, this field would
  1482. * be set to
  1483. * (1 << htt_tx_preamble_type_ofdm) |
  1484. * (1 << htt_tx_preamble_type_cck)
  1485. */
  1486. preamble_type_mask: 4,
  1487. reserved1_31_29: 3; /* unused, set to 0x0 */
  1488. /* DWORD 2: tx chain mask, tx retries */
  1489. A_UINT32
  1490. /* chain_mask - specify which chains to transmit from */
  1491. chain_mask: 4,
  1492. /* retry_limit -
  1493. * Specify the maximum number of transmissions, including the
  1494. * initial transmission, to attempt before giving up if no ack
  1495. * is received.
  1496. * If the tx rate is specified, then all retries shall use the
  1497. * same rate as the initial transmission.
  1498. * If no tx rate is specified, the target can choose whether to
  1499. * retain the original rate during the retransmissions, or to
  1500. * fall back to a more robust rate.
  1501. */
  1502. retry_limit: 4,
  1503. /* bandwidth_mask -
  1504. * Specify what channel widths may be used for the transmission.
  1505. * A value of zero indicates "don't care" - the target may choose
  1506. * the transmission bandwidth.
  1507. * The bits within this mask correspond to the htt_tx_bandwidth
  1508. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1509. * The bandwidth_mask must be consistent with the preamble_type_mask
  1510. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1511. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1512. */
  1513. bandwidth_mask: 6,
  1514. reserved2_31_14: 18; /* unused, set to 0x0 */
  1515. /* DWORD 3: tx expiry time (TSF) LSBs */
  1516. A_UINT32 expire_tsf_lo;
  1517. /* DWORD 4: tx expiry time (TSF) MSBs */
  1518. A_UINT32 expire_tsf_hi;
  1519. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1520. } POSTPACK;
  1521. /* DWORD 0 */
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1542. /* DWORD 1 */
  1543. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1544. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1545. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1546. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1547. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1548. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1549. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1550. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1551. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1552. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1553. /* DWORD 2 */
  1554. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1555. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1556. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1557. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1558. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1559. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1560. /* DWORD 0 */
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1563. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1567. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL( \
  1583. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1584. ((_var) |= ((_val) \
  1585. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1586. } while (0)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1589. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1591. do { \
  1592. HTT_CHECK_SET_VAL( \
  1593. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1594. ((_var) |= ((_val) \
  1595. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1600. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1603. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1607. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1608. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1611. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1612. } while (0)
  1613. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1615. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1616. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1617. do { \
  1618. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1619. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1623. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1624. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1627. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1628. } while (0)
  1629. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1631. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1632. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1636. } while (0)
  1637. /* DWORD 1 */
  1638. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1642. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1643. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1644. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1645. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1646. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1647. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1649. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1650. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1653. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1657. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1658. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1665. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1666. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1673. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1674. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1678. } while (0)
  1679. /* DWORD 2 */
  1680. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1681. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1682. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1683. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1684. do { \
  1685. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1686. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1687. } while (0)
  1688. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1690. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1691. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1698. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1699. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1703. } while (0)
  1704. typedef enum {
  1705. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1706. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1707. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1708. } htt_11ax_ltf_subtype_t;
  1709. typedef enum {
  1710. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1711. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1712. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1713. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1714. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1715. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1716. } htt_tx_ext2_preamble_type_t;
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1722. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1729. /**
  1730. * @brief HTT tx MSDU extension descriptor v2
  1731. * @details
  1732. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1733. * is received as tcl_exit_base->host_meta_info in firmware.
  1734. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1735. * are already part of tcl_exit_base.
  1736. */
  1737. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1738. /* DWORD 0: flags */
  1739. A_UINT32
  1740. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1741. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1742. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1743. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1744. valid_retries : 1, /* if set, tx retries spec is valid */
  1745. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1746. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1747. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1748. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1749. valid_key_flags : 1, /* if set, key flags is valid */
  1750. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1751. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1752. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1753. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1754. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1755. 1 = ENCRYPT,
  1756. 2 ~ 3 - Reserved */
  1757. /* retry_limit -
  1758. * Specify the maximum number of transmissions, including the
  1759. * initial transmission, to attempt before giving up if no ack
  1760. * is received.
  1761. * If the tx rate is specified, then all retries shall use the
  1762. * same rate as the initial transmission.
  1763. * If no tx rate is specified, the target can choose whether to
  1764. * retain the original rate during the retransmissions, or to
  1765. * fall back to a more robust rate.
  1766. */
  1767. retry_limit : 4,
  1768. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1769. * Valid only for 11ax preamble types HE_SU
  1770. * and HE_EXT_SU
  1771. */
  1772. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1773. * Valid only for 11ax preamble types HE_SU
  1774. * and HE_EXT_SU
  1775. */
  1776. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1777. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1778. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1779. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1780. */
  1781. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1782. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1783. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1784. * Use cases:
  1785. * Any time firmware uses TQM-BYPASS for Data
  1786. * TID, firmware expect host to set this bit.
  1787. */
  1788. /* DWORD 1: tx power, tx rate */
  1789. A_UINT32
  1790. power : 8, /* unit of the power field is 0.5 dbm
  1791. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1792. * signed value ranging from -64dbm to 63.5 dbm
  1793. */
  1794. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1795. * Setting more than one MCS isn't currently
  1796. * supported by the target (but is supported
  1797. * in the interface in case in the future
  1798. * the target supports specifications of
  1799. * a limited set of MCS values.
  1800. */
  1801. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1802. * Setting more than one Nss isn't currently
  1803. * supported by the target (but is supported
  1804. * in the interface in case in the future
  1805. * the target supports specifications of
  1806. * a limited set of Nss values.
  1807. */
  1808. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1809. update_peer_cache : 1; /* When set these custom values will be
  1810. * used for all packets, until the next
  1811. * update via this ext header.
  1812. * This is to make sure not all packets
  1813. * need to include this header.
  1814. */
  1815. /* DWORD 2: tx chain mask, tx retries */
  1816. A_UINT32
  1817. /* chain_mask - specify which chains to transmit from */
  1818. chain_mask : 8,
  1819. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1820. * TODO: Update Enum values for key_flags
  1821. */
  1822. /*
  1823. * Channel frequency: This identifies the desired channel
  1824. * frequency (in MHz) for tx frames. This is used by FW to help
  1825. * determine when it is safe to transmit or drop frames for
  1826. * off-channel operation.
  1827. * The default value of zero indicates to FW that the corresponding
  1828. * VDEV's home channel (if there is one) is the desired channel
  1829. * frequency.
  1830. */
  1831. chanfreq : 16;
  1832. /* DWORD 3: tx expiry time (TSF) LSBs */
  1833. A_UINT32 expire_tsf_lo;
  1834. /* DWORD 4: tx expiry time (TSF) MSBs */
  1835. A_UINT32 expire_tsf_hi;
  1836. /* DWORD 5: flags to control routing / processing of the MSDU */
  1837. A_UINT32
  1838. /* learning_frame
  1839. * When this flag is set, this frame will be dropped by FW
  1840. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1841. */
  1842. learning_frame : 1,
  1843. /* send_as_standalone
  1844. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1845. * i.e. with no A-MSDU or A-MPDU aggregation.
  1846. * The scope is extended to other use-cases.
  1847. */
  1848. send_as_standalone : 1,
  1849. /* is_host_opaque_valid
  1850. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1851. * with valid information.
  1852. */
  1853. is_host_opaque_valid : 1,
  1854. traffic_end_indication: 1,
  1855. rsvd0 : 28;
  1856. /* DWORD 6 : Host opaque cookie for special frames */
  1857. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1858. rsvd1 : 16;
  1859. /*
  1860. * This structure can be expanded further up to 40 bytes
  1861. * by adding further DWORDs as needed.
  1862. */
  1863. } POSTPACK;
  1864. /* DWORD 0 */
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1891. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1892. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1893. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1894. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1895. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1896. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1897. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1898. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1899. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1900. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1901. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1902. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1903. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1904. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1905. /* DWORD 1 */
  1906. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1907. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1908. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1909. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1910. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1911. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1912. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1913. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1914. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1915. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1916. /* DWORD 2 */
  1917. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1918. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1919. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1920. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1921. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1922. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1923. /* DWORD 5 */
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1930. /* DWORD 6 */
  1931. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1932. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1933. /* DWORD 0 */
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1935. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1936. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1938. do { \
  1939. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1940. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1941. } while (0)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1943. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1944. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1948. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL( \
  1964. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1965. ((_var) |= ((_val) \
  1966. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1967. } while (0)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1969. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1970. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1972. do { \
  1973. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1974. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1975. } while (0)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1977. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1978. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1980. do { \
  1981. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1982. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1983. } while (0)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL( \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1991. ((_var) |= ((_val) \
  1992. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1993. } while (0)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1995. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1996. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1997. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2001. } while (0)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2003. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2004. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2009. } while (0)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2011. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2012. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2013. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2016. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2017. } while (0)
  2018. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2019. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2020. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2021. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2025. } while (0)
  2026. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2027. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2028. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2029. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2033. } while (0)
  2034. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2035. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2036. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2037. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2038. do { \
  2039. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2040. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2041. } while (0)
  2042. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2043. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2044. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2045. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2046. do { \
  2047. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2048. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2049. } while (0)
  2050. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2051. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2052. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2053. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2054. do { \
  2055. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2056. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2057. } while (0)
  2058. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2059. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2060. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2061. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2062. do { \
  2063. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2064. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2065. } while (0)
  2066. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2067. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2068. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2069. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2070. do { \
  2071. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2072. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2073. } while (0)
  2074. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2075. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2076. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2077. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2081. } while (0)
  2082. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2083. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2084. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2085. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2089. } while (0)
  2090. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2097. } while (0)
  2098. /* DWORD 1 */
  2099. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2100. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2101. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2102. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2103. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2104. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2105. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2106. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2107. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2108. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2109. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2110. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2111. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2112. do { \
  2113. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2114. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2115. } while (0)
  2116. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2117. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2118. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2119. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2120. do { \
  2121. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2122. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2123. } while (0)
  2124. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2125. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2126. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2127. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2128. do { \
  2129. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2130. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2131. } while (0)
  2132. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2133. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2134. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2135. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2139. } while (0)
  2140. /* DWORD 2 */
  2141. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2142. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2143. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2144. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2145. do { \
  2146. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2147. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2148. } while (0)
  2149. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2150. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2151. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2152. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2156. } while (0)
  2157. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2158. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2159. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2160. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2164. } while (0)
  2165. /* DWORD 5 */
  2166. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2167. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2168. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2169. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2173. } while (0)
  2174. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2175. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2176. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2177. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2181. } while (0)
  2182. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2183. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2184. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2185. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2186. do { \
  2187. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2188. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2189. } while (0)
  2190. /* DWORD 6 */
  2191. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2192. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2193. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2194. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2198. } while (0)
  2199. typedef enum {
  2200. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2201. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2202. } htt_tcl_metadata_type;
  2203. /**
  2204. * @brief HTT TCL command number format
  2205. * @details
  2206. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2207. * available to firmware as tcl_exit_base->tcl_status_number.
  2208. * For regular / multicast packets host will send vdev and mac id and for
  2209. * NAWDS packets, host will send peer id.
  2210. * A_UINT32 is used to avoid endianness conversion problems.
  2211. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2212. */
  2213. typedef struct {
  2214. A_UINT32
  2215. type: 1, /* vdev_id based or peer_id based */
  2216. rsvd: 31;
  2217. } htt_tx_tcl_vdev_or_peer_t;
  2218. typedef struct {
  2219. A_UINT32
  2220. type: 1, /* vdev_id based or peer_id based */
  2221. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2222. vdev_id: 8,
  2223. pdev_id: 2,
  2224. host_inspected:1,
  2225. rsvd: 19;
  2226. } htt_tx_tcl_vdev_metadata;
  2227. typedef struct {
  2228. A_UINT32
  2229. type: 1, /* vdev_id based or peer_id based */
  2230. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2231. peer_id: 14,
  2232. rsvd: 16;
  2233. } htt_tx_tcl_peer_metadata;
  2234. PREPACK struct htt_tx_tcl_metadata {
  2235. union {
  2236. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2237. htt_tx_tcl_vdev_metadata vdev_meta;
  2238. htt_tx_tcl_peer_metadata peer_meta;
  2239. };
  2240. } POSTPACK;
  2241. /* DWORD 0 */
  2242. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2243. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2244. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2245. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2246. /* VDEV metadata */
  2247. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2248. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2249. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2250. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2251. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2252. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2253. /* PEER metadata */
  2254. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2255. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2256. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2257. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2258. HTT_TX_TCL_METADATA_TYPE_S)
  2259. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2260. do { \
  2261. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2262. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2263. } while (0)
  2264. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2265. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2266. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2267. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2268. do { \
  2269. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2270. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2271. } while (0)
  2272. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2273. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2274. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2275. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2276. do { \
  2277. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2278. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2279. } while (0)
  2280. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2281. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2282. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2283. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2284. do { \
  2285. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2286. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2287. } while (0)
  2288. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2289. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2290. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2291. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2292. do { \
  2293. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2294. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2295. } while (0)
  2296. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2297. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2298. HTT_TX_TCL_METADATA_PEER_ID_S)
  2299. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2300. do { \
  2301. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2302. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2303. } while (0)
  2304. /*------------------------------------------------------------------
  2305. * V2 Version of TCL Data Command
  2306. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2307. * MLO global_seq all flavours of TCL Data Cmd.
  2308. *-----------------------------------------------------------------*/
  2309. typedef enum {
  2310. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2311. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2312. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2313. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2314. } htt_tcl_metadata_type_v2;
  2315. /**
  2316. * @brief HTT TCL command number format
  2317. * @details
  2318. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2319. * available to firmware as tcl_exit_base->tcl_status_number.
  2320. * A_UINT32 is used to avoid endianness conversion problems.
  2321. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2322. */
  2323. typedef struct {
  2324. A_UINT32
  2325. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2326. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2327. vdev_id: 8,
  2328. pdev_id: 2,
  2329. host_inspected:1,
  2330. rsvd: 2,
  2331. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2332. } htt_tx_tcl_vdev_metadata_v2;
  2333. typedef struct {
  2334. A_UINT32
  2335. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2336. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2337. peer_id: 13,
  2338. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2339. } htt_tx_tcl_peer_metadata_v2;
  2340. typedef struct {
  2341. A_UINT32
  2342. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2343. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2344. svc_class_id: 8,
  2345. rsvd: 5,
  2346. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2347. } htt_tx_tcl_svc_class_id_metadata;
  2348. typedef struct {
  2349. A_UINT32
  2350. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2351. host_inspected: 1,
  2352. global_seq_no: 12,
  2353. rsvd: 1,
  2354. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2355. } htt_tx_tcl_global_seq_metadata;
  2356. PREPACK struct htt_tx_tcl_metadata_v2 {
  2357. union {
  2358. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2359. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2360. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2361. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2362. };
  2363. } POSTPACK;
  2364. /* DWORD 0 */
  2365. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2366. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2367. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2368. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2369. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2370. /* VDEV V2 metadata */
  2371. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2372. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2373. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2374. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2375. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2376. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2377. /* PEER V2 metadata */
  2378. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2379. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2380. /* SVC_CLASS_ID metadata */
  2381. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2382. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2383. /* Global Seq no metadata */
  2384. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2385. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2386. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2387. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2388. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2389. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2390. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2391. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2392. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2395. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2396. } while (0)
  2397. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2398. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2399. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2400. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2404. } while (0)
  2405. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2406. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2407. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2408. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2409. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2412. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2413. } while (0)
  2414. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2415. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2416. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2417. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2418. do { \
  2419. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2420. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2421. } while (0)
  2422. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2423. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2424. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2425. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2429. } while (0)
  2430. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2431. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2432. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2433. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2434. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2438. } while (0)
  2439. /*----- Get and Set V2 type field in Service Class fields ----*/
  2440. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2441. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2442. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2443. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2447. } while (0)
  2448. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2449. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2450. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2451. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2452. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2456. } while (0)
  2457. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2458. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2459. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2460. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2464. } while (0)
  2465. /*------------------------------------------------------------------
  2466. * End V2 Version of TCL Data Command
  2467. *-----------------------------------------------------------------*/
  2468. typedef enum {
  2469. HTT_TX_FW2WBM_TX_STATUS_OK,
  2470. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2471. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2472. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2473. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2474. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2475. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2476. HTT_TX_FW2WBM_TX_STATUS_MAX
  2477. } htt_tx_fw2wbm_tx_status_t;
  2478. typedef enum {
  2479. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2480. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2481. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2482. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2483. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2484. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2485. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2486. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2487. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2488. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2489. } htt_tx_fw2wbm_reinject_reason_t;
  2490. /**
  2491. * @brief HTT TX WBM Completion from firmware to host
  2492. * @details
  2493. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2494. * DWORD 3 and 4 for software based completions (Exception frames and
  2495. * TQM bypass frames)
  2496. * For software based completions, wbm_release_ring->release_source_module will
  2497. * be set to release_source_fw
  2498. */
  2499. PREPACK struct htt_tx_wbm_completion {
  2500. A_UINT32
  2501. sch_cmd_id: 24,
  2502. exception_frame: 1, /* If set, this packet was queued via exception path */
  2503. rsvd0_31_25: 7;
  2504. A_UINT32
  2505. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2506. * reception of an ACK or BA, this field indicates
  2507. * the RSSI of the received ACK or BA frame.
  2508. * When the frame is removed as result of a direct
  2509. * remove command from the SW, this field is set
  2510. * to 0x0 (which is never a valid value when real
  2511. * RSSI is available).
  2512. * Units: dB w.r.t noise floor
  2513. */
  2514. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2515. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2516. rsvd1_31_16: 16;
  2517. } POSTPACK;
  2518. /* DWORD 0 */
  2519. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2520. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2521. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2522. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2523. /* DWORD 1 */
  2524. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2525. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2526. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2527. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2528. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2529. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2530. /* DWORD 0 */
  2531. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2532. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2533. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2534. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2537. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2538. } while (0)
  2539. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2540. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2541. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2542. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2545. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2546. } while (0)
  2547. /* DWORD 1 */
  2548. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2549. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2550. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2551. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2554. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2555. } while (0)
  2556. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2557. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2558. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2559. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2560. do { \
  2561. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2562. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2563. } while (0)
  2564. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2565. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2566. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2567. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2568. do { \
  2569. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2570. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2571. } while (0)
  2572. /**
  2573. * @brief HTT TX WBM Completion from firmware to host
  2574. * @details
  2575. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2576. * (WBM) offload HW.
  2577. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2578. * For software based completions, release_source_module will
  2579. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2580. * struct wbm_release_ring and then switch to this after looking at
  2581. * release_source_module.
  2582. */
  2583. PREPACK struct htt_tx_wbm_completion_v2 {
  2584. A_UINT32
  2585. used_by_hw0; /* Refer to struct wbm_release_ring */
  2586. A_UINT32
  2587. used_by_hw1; /* Refer to struct wbm_release_ring */
  2588. A_UINT32
  2589. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2590. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2591. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2592. exception_frame: 1,
  2593. rsvd0: 12, /* For future use */
  2594. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2595. rsvd1: 1; /* For future use */
  2596. A_UINT32
  2597. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2598. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2599. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2600. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2601. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2602. */
  2603. A_UINT32
  2604. data1: 32;
  2605. A_UINT32
  2606. data2: 32;
  2607. A_UINT32
  2608. used_by_hw3; /* Refer to struct wbm_release_ring */
  2609. } POSTPACK;
  2610. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2611. /* DWORD 3 */
  2612. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2613. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2614. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2615. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2616. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2617. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2618. /* DWORD 3 */
  2619. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2620. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2621. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2622. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2623. do { \
  2624. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2625. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2626. } while (0)
  2627. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2628. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2629. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2630. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2631. do { \
  2632. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2633. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2634. } while (0)
  2635. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2636. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2637. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2638. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2639. do { \
  2640. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2641. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2642. } while (0)
  2643. /**
  2644. * @brief HTT TX WBM Completion from firmware to host (V3)
  2645. * @details
  2646. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2647. * (WBM) offload HW.
  2648. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2649. * For software based completions, release_source_module will
  2650. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2651. * struct wbm_release_ring and then switch to this after looking at
  2652. * release_source_module.
  2653. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2654. * by new generations of targets.
  2655. */
  2656. PREPACK struct htt_tx_wbm_completion_v3 {
  2657. A_UINT32
  2658. used_by_hw0; /* Refer to struct wbm_release_ring */
  2659. A_UINT32
  2660. used_by_hw1; /* Refer to struct wbm_release_ring */
  2661. A_UINT32
  2662. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2663. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2664. used_by_hw3: 15;
  2665. A_UINT32
  2666. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2667. exception_frame: 1,
  2668. rsvd0: 27; /* For future use */
  2669. A_UINT32
  2670. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2671. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2672. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2673. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2674. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2675. */
  2676. A_UINT32
  2677. data1: 32;
  2678. A_UINT32
  2679. data2: 32;
  2680. A_UINT32
  2681. rsvd1: 20,
  2682. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2683. } POSTPACK;
  2684. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2685. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2686. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2687. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2688. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2689. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2690. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2691. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2692. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2693. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2694. do { \
  2695. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2696. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2697. } while (0)
  2698. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2699. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2700. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2701. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2702. do { \
  2703. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2704. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2705. } while (0)
  2706. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2707. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2708. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2709. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2710. do { \
  2711. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2712. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2713. } while (0)
  2714. typedef enum {
  2715. TX_FRAME_TYPE_UNDEFINED = 0,
  2716. TX_FRAME_TYPE_EAPOL = 1,
  2717. } htt_tx_wbm_status_frame_type;
  2718. /**
  2719. * @brief HTT TX WBM transmit status from firmware to host
  2720. * @details
  2721. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2722. * (WBM) offload HW.
  2723. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2724. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2725. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2726. */
  2727. PREPACK struct htt_tx_wbm_transmit_status {
  2728. A_UINT32
  2729. sch_cmd_id: 24,
  2730. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2731. * reception of an ACK or BA, this field indicates
  2732. * the RSSI of the received ACK or BA frame.
  2733. * When the frame is removed as result of a direct
  2734. * remove command from the SW, this field is set
  2735. * to 0x0 (which is never a valid value when real
  2736. * RSSI is available).
  2737. * Units: dB w.r.t noise floor
  2738. */
  2739. A_UINT32
  2740. sw_peer_id: 16,
  2741. tid_num: 5,
  2742. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2743. * and tid_num fields contain valid data.
  2744. * If this "valid" flag is not set, the
  2745. * sw_peer_id and tid_num fields must be ignored.
  2746. */
  2747. mcast: 1,
  2748. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2749. * contains valid data.
  2750. */
  2751. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2752. reserved: 4;
  2753. A_UINT32
  2754. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2755. * packets in the wbm completion path
  2756. */
  2757. } POSTPACK;
  2758. /* DWORD 4 */
  2759. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2760. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2761. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2762. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2763. /* DWORD 5 */
  2764. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2765. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2766. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2767. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2768. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2769. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2770. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2771. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2772. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2774. /* DWORD 4 */
  2775. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2776. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2777. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2778. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2781. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2782. } while (0)
  2783. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2784. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2785. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2786. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2789. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2790. } while (0)
  2791. /* DWORD 5 */
  2792. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2793. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2794. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2795. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2796. do { \
  2797. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2798. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2799. } while (0)
  2800. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2801. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2802. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2803. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2804. do { \
  2805. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2806. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2807. } while (0)
  2808. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2809. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2810. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2811. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2812. do { \
  2813. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2814. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2815. } while (0)
  2816. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2817. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2818. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2819. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2822. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2823. } while (0)
  2824. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2825. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2826. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2830. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2831. } while (0)
  2832. /**
  2833. * @brief HTT TX WBM reinject status from firmware to host
  2834. * @details
  2835. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2836. * (WBM) offload HW.
  2837. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2838. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2839. */
  2840. PREPACK struct htt_tx_wbm_reinject_status {
  2841. A_UINT32
  2842. reserved0: 32;
  2843. A_UINT32
  2844. reserved1: 32;
  2845. A_UINT32
  2846. reserved2: 32;
  2847. } POSTPACK;
  2848. /**
  2849. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2850. * @details
  2851. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2852. * (WBM) offload HW.
  2853. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2854. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2855. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2856. * STA side.
  2857. */
  2858. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2859. A_UINT32
  2860. mec_sa_addr_31_0;
  2861. A_UINT32
  2862. mec_sa_addr_47_32: 16,
  2863. sa_ast_index: 16;
  2864. A_UINT32
  2865. vdev_id: 8,
  2866. reserved0: 24;
  2867. } POSTPACK;
  2868. /* DWORD 4 - mec_sa_addr_31_0 */
  2869. /* DWORD 5 */
  2870. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2871. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2872. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2873. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2874. /* DWORD 6 */
  2875. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2876. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2877. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2878. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2879. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2880. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2881. do { \
  2882. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2883. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2884. } while (0)
  2885. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2886. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2887. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2888. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2891. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2892. } while (0)
  2893. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2894. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2895. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2896. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2899. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2900. } while (0)
  2901. typedef enum {
  2902. TX_FLOW_PRIORITY_BE,
  2903. TX_FLOW_PRIORITY_HIGH,
  2904. TX_FLOW_PRIORITY_LOW,
  2905. } htt_tx_flow_priority_t;
  2906. typedef enum {
  2907. TX_FLOW_LATENCY_SENSITIVE,
  2908. TX_FLOW_LATENCY_INSENSITIVE,
  2909. } htt_tx_flow_latency_t;
  2910. typedef enum {
  2911. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2912. TX_FLOW_INTERACTIVE_TRAFFIC,
  2913. TX_FLOW_PERIODIC_TRAFFIC,
  2914. TX_FLOW_BURSTY_TRAFFIC,
  2915. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2916. } htt_tx_flow_traffic_pattern_t;
  2917. /**
  2918. * @brief HTT TX Flow search metadata format
  2919. * @details
  2920. * Host will set this metadata in flow table's flow search entry along with
  2921. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2922. * firmware and TQM ring if the flow search entry wins.
  2923. * This metadata is available to firmware in that first MSDU's
  2924. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2925. * to one of the available flows for specific tid and returns the tqm flow
  2926. * pointer as part of htt_tx_map_flow_info message.
  2927. */
  2928. PREPACK struct htt_tx_flow_metadata {
  2929. A_UINT32
  2930. rsvd0_1_0: 2,
  2931. tid: 4,
  2932. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2933. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2934. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2935. * Else choose final tid based on latency, priority.
  2936. */
  2937. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2938. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2939. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2940. } POSTPACK;
  2941. /* DWORD 0 */
  2942. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2943. #define HTT_TX_FLOW_METADATA_TID_S 2
  2944. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2945. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2946. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2947. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2948. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2949. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2950. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2951. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2952. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2953. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2954. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2955. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2956. /* DWORD 0 */
  2957. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2958. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2959. HTT_TX_FLOW_METADATA_TID_S)
  2960. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2961. do { \
  2962. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2963. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2964. } while (0)
  2965. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2966. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2967. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2968. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2969. do { \
  2970. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2971. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2972. } while (0)
  2973. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2974. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2975. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2976. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2977. do { \
  2978. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2979. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2980. } while (0)
  2981. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2982. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2983. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2984. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2987. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2988. } while (0)
  2989. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2990. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2991. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2992. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2995. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2996. } while (0)
  2997. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2998. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2999. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3000. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3001. do { \
  3002. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3003. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3004. } while (0)
  3005. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3006. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3007. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3008. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3009. do { \
  3010. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3011. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3012. } while (0)
  3013. /**
  3014. * @brief host -> target ADD WDS Entry
  3015. *
  3016. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3017. *
  3018. * @brief host -> target DELETE WDS Entry
  3019. *
  3020. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3021. *
  3022. * @details
  3023. * HTT wds entry from source port learning
  3024. * Host will learn wds entries from rx and send this message to firmware
  3025. * to enable firmware to configure/delete AST entries for wds clients.
  3026. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3027. * and when SA's entry is deleted, firmware removes this AST entry
  3028. *
  3029. * The message would appear as follows:
  3030. *
  3031. * |31 30|29 |17 16|15 8|7 0|
  3032. * |----------------+----------------+----------------+----------------|
  3033. * | rsvd0 |PDVID| vdev_id | msg_type |
  3034. * |-------------------------------------------------------------------|
  3035. * | sa_addr_31_0 |
  3036. * |-------------------------------------------------------------------|
  3037. * | | ta_peer_id | sa_addr_47_32 |
  3038. * |-------------------------------------------------------------------|
  3039. * Where PDVID = pdev_id
  3040. *
  3041. * The message is interpreted as follows:
  3042. *
  3043. * dword0 - b'0:7 - msg_type: This will be set to
  3044. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3045. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3046. *
  3047. * dword0 - b'8:15 - vdev_id
  3048. *
  3049. * dword0 - b'16:17 - pdev_id
  3050. *
  3051. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3052. *
  3053. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3054. *
  3055. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3056. *
  3057. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3058. */
  3059. PREPACK struct htt_wds_entry {
  3060. A_UINT32
  3061. msg_type: 8,
  3062. vdev_id: 8,
  3063. pdev_id: 2,
  3064. rsvd0: 14;
  3065. A_UINT32 sa_addr_31_0;
  3066. A_UINT32
  3067. sa_addr_47_32: 16,
  3068. ta_peer_id: 14,
  3069. rsvd2: 2;
  3070. } POSTPACK;
  3071. /* DWORD 0 */
  3072. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3073. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3074. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3075. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3076. /* DWORD 2 */
  3077. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3078. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3079. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3080. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3081. /* DWORD 0 */
  3082. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3083. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3084. HTT_WDS_ENTRY_VDEV_ID_S)
  3085. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3086. do { \
  3087. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3088. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3089. } while (0)
  3090. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3091. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3092. HTT_WDS_ENTRY_PDEV_ID_S)
  3093. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3094. do { \
  3095. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3096. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3097. } while (0)
  3098. /* DWORD 2 */
  3099. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3100. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3101. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3102. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3103. do { \
  3104. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3105. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3106. } while (0)
  3107. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3108. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3109. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3110. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3113. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3114. } while (0)
  3115. /**
  3116. * @brief MAC DMA rx ring setup specification
  3117. *
  3118. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3119. *
  3120. * @details
  3121. * To allow for dynamic rx ring reconfiguration and to avoid race
  3122. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3123. * it uses. Instead, it sends this message to the target, indicating how
  3124. * the rx ring used by the host should be set up and maintained.
  3125. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3126. * specifications.
  3127. *
  3128. * |31 16|15 8|7 0|
  3129. * |---------------------------------------------------------------|
  3130. * header: | reserved | num rings | msg type |
  3131. * |---------------------------------------------------------------|
  3132. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3133. #if HTT_PADDR64
  3134. * | FW_IDX shadow register physical address (bits 63:32) |
  3135. #endif
  3136. * |---------------------------------------------------------------|
  3137. * | rx ring base physical address (bits 31:0) |
  3138. #if HTT_PADDR64
  3139. * | rx ring base physical address (bits 63:32) |
  3140. #endif
  3141. * |---------------------------------------------------------------|
  3142. * | rx ring buffer size | rx ring length |
  3143. * |---------------------------------------------------------------|
  3144. * | FW_IDX initial value | enabled flags |
  3145. * |---------------------------------------------------------------|
  3146. * | MSDU payload offset | 802.11 header offset |
  3147. * |---------------------------------------------------------------|
  3148. * | PPDU end offset | PPDU start offset |
  3149. * |---------------------------------------------------------------|
  3150. * | MPDU end offset | MPDU start offset |
  3151. * |---------------------------------------------------------------|
  3152. * | MSDU end offset | MSDU start offset |
  3153. * |---------------------------------------------------------------|
  3154. * | frag info offset | rx attention offset |
  3155. * |---------------------------------------------------------------|
  3156. * payload 2, if present, has the same format as payload 1
  3157. * Header fields:
  3158. * - MSG_TYPE
  3159. * Bits 7:0
  3160. * Purpose: identifies this as an rx ring configuration message
  3161. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3162. * - NUM_RINGS
  3163. * Bits 15:8
  3164. * Purpose: indicates whether the host is setting up one rx ring or two
  3165. * Value: 1 or 2
  3166. * Payload:
  3167. * for systems using 64-bit format for bus addresses:
  3168. * - IDX_SHADOW_REG_PADDR_LO
  3169. * Bits 31:0
  3170. * Value: lower 4 bytes of physical address of the host's
  3171. * FW_IDX shadow register
  3172. * - IDX_SHADOW_REG_PADDR_HI
  3173. * Bits 31:0
  3174. * Value: upper 4 bytes of physical address of the host's
  3175. * FW_IDX shadow register
  3176. * - RING_BASE_PADDR_LO
  3177. * Bits 31:0
  3178. * Value: lower 4 bytes of physical address of the host's rx ring
  3179. * - RING_BASE_PADDR_HI
  3180. * Bits 31:0
  3181. * Value: uppper 4 bytes of physical address of the host's rx ring
  3182. * for systems using 32-bit format for bus addresses:
  3183. * - IDX_SHADOW_REG_PADDR
  3184. * Bits 31:0
  3185. * Value: physical address of the host's FW_IDX shadow register
  3186. * - RING_BASE_PADDR
  3187. * Bits 31:0
  3188. * Value: physical address of the host's rx ring
  3189. * - RING_LEN
  3190. * Bits 15:0
  3191. * Value: number of elements in the rx ring
  3192. * - RING_BUF_SZ
  3193. * Bits 31:16
  3194. * Value: size of the buffers referenced by the rx ring, in byte units
  3195. * - ENABLED_FLAGS
  3196. * Bits 15:0
  3197. * Value: 1-bit flags to show whether different rx fields are enabled
  3198. * bit 0: 802.11 header enabled (1) or disabled (0)
  3199. * bit 1: MSDU payload enabled (1) or disabled (0)
  3200. * bit 2: PPDU start enabled (1) or disabled (0)
  3201. * bit 3: PPDU end enabled (1) or disabled (0)
  3202. * bit 4: MPDU start enabled (1) or disabled (0)
  3203. * bit 5: MPDU end enabled (1) or disabled (0)
  3204. * bit 6: MSDU start enabled (1) or disabled (0)
  3205. * bit 7: MSDU end enabled (1) or disabled (0)
  3206. * bit 8: rx attention enabled (1) or disabled (0)
  3207. * bit 9: frag info enabled (1) or disabled (0)
  3208. * bit 10: unicast rx enabled (1) or disabled (0)
  3209. * bit 11: multicast rx enabled (1) or disabled (0)
  3210. * bit 12: ctrl rx enabled (1) or disabled (0)
  3211. * bit 13: mgmt rx enabled (1) or disabled (0)
  3212. * bit 14: null rx enabled (1) or disabled (0)
  3213. * bit 15: phy data rx enabled (1) or disabled (0)
  3214. * - IDX_INIT_VAL
  3215. * Bits 31:16
  3216. * Purpose: Specify the initial value for the FW_IDX.
  3217. * Value: the number of buffers initially present in the host's rx ring
  3218. * - OFFSET_802_11_HDR
  3219. * Bits 15:0
  3220. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3221. * - OFFSET_MSDU_PAYLOAD
  3222. * Bits 31:16
  3223. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3224. * - OFFSET_PPDU_START
  3225. * Bits 15:0
  3226. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3227. * - OFFSET_PPDU_END
  3228. * Bits 31:16
  3229. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3230. * - OFFSET_MPDU_START
  3231. * Bits 15:0
  3232. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3233. * - OFFSET_MPDU_END
  3234. * Bits 31:16
  3235. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3236. * - OFFSET_MSDU_START
  3237. * Bits 15:0
  3238. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3239. * - OFFSET_MSDU_END
  3240. * Bits 31:16
  3241. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3242. * - OFFSET_RX_ATTN
  3243. * Bits 15:0
  3244. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3245. * - OFFSET_FRAG_INFO
  3246. * Bits 31:16
  3247. * Value: offset in QUAD-bytes of frag info table
  3248. */
  3249. /* header fields */
  3250. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3251. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3252. /* payload fields */
  3253. /* for systems using a 64-bit format for bus addresses */
  3254. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3255. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3256. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3257. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3258. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3259. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3260. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3261. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3262. /* for systems using a 32-bit format for bus addresses */
  3263. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3265. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3266. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3267. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3268. #define HTT_RX_RING_CFG_LEN_S 0
  3269. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3270. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3271. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3272. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3273. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3275. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3276. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3277. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3278. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3279. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3280. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3281. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3282. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3283. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3284. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3285. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3286. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3287. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3288. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3289. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3290. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3291. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3292. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3293. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3294. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3295. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3296. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3297. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3298. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3299. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3300. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3301. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3302. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3303. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3304. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3305. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3306. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3307. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3309. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3310. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3311. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3312. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3313. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3314. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3315. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3316. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3317. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3318. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3319. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3320. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3321. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3322. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3323. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3324. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3325. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3326. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3327. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3328. #if HTT_PADDR64
  3329. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3330. #else
  3331. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3332. #endif
  3333. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3334. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3335. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3336. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3337. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3338. do { \
  3339. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3340. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3341. } while (0)
  3342. /* degenerate case for 32-bit fields */
  3343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3345. ((_var) = (_val))
  3346. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3347. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3348. ((_var) = (_val))
  3349. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3351. ((_var) = (_val))
  3352. /* degenerate case for 32-bit fields */
  3353. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3354. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3355. ((_var) = (_val))
  3356. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3357. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3358. ((_var) = (_val))
  3359. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3360. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3361. ((_var) = (_val))
  3362. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3363. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3364. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3365. do { \
  3366. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3367. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3368. } while (0)
  3369. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3370. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3371. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3372. do { \
  3373. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3374. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3375. } while (0)
  3376. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3377. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3378. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3379. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3382. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3383. } while (0)
  3384. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3385. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3386. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3387. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3388. do { \
  3389. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3390. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3391. } while (0)
  3392. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3393. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3394. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3395. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3396. do { \
  3397. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3398. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3399. } while (0)
  3400. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3401. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3402. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3403. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3404. do { \
  3405. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3406. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3407. } while (0)
  3408. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3409. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3410. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3411. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3412. do { \
  3413. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3414. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3415. } while (0)
  3416. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3417. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3418. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3419. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3420. do { \
  3421. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3422. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3423. } while (0)
  3424. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3425. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3426. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3427. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3428. do { \
  3429. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3430. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3431. } while (0)
  3432. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3433. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3434. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3435. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3436. do { \
  3437. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3438. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3439. } while (0)
  3440. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3441. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3442. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3443. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3444. do { \
  3445. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3446. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3447. } while (0)
  3448. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3449. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3450. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3451. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3452. do { \
  3453. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3454. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3455. } while (0)
  3456. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3457. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3458. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3459. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3460. do { \
  3461. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3462. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3463. } while (0)
  3464. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3465. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3466. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3467. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3468. do { \
  3469. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3470. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3471. } while (0)
  3472. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3473. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3474. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3475. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3476. do { \
  3477. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3478. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3479. } while (0)
  3480. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3481. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3482. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3483. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3486. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3487. } while (0)
  3488. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3489. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3490. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3491. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3492. do { \
  3493. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3494. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3495. } while (0)
  3496. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3497. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3498. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3499. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3500. do { \
  3501. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3502. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3503. } while (0)
  3504. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3505. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3506. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3507. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3508. do { \
  3509. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3510. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3511. } while (0)
  3512. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3513. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3514. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3515. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3516. do { \
  3517. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3518. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3519. } while (0)
  3520. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3521. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3522. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3523. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3524. do { \
  3525. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3526. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3527. } while (0)
  3528. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3529. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3530. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3531. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3532. do { \
  3533. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3534. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3535. } while (0)
  3536. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3537. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3538. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3539. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3542. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3543. } while (0)
  3544. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3545. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3546. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3547. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3550. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3551. } while (0)
  3552. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3553. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3554. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3555. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3558. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3559. } while (0)
  3560. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3561. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3562. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3563. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3566. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3567. } while (0)
  3568. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3569. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3570. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3571. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3574. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3575. } while (0)
  3576. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3577. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3578. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3579. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3582. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3583. } while (0)
  3584. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3585. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3586. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3587. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3590. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3591. } while (0)
  3592. /**
  3593. * @brief host -> target FW statistics retrieve
  3594. *
  3595. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3596. *
  3597. * @details
  3598. * The following field definitions describe the format of the HTT host
  3599. * to target FW stats retrieve message. The message specifies the type of
  3600. * stats host wants to retrieve.
  3601. *
  3602. * |31 24|23 16|15 8|7 0|
  3603. * |-----------------------------------------------------------|
  3604. * | stats types request bitmask | msg type |
  3605. * |-----------------------------------------------------------|
  3606. * | stats types reset bitmask | reserved |
  3607. * |-----------------------------------------------------------|
  3608. * | stats type | config value |
  3609. * |-----------------------------------------------------------|
  3610. * | cookie LSBs |
  3611. * |-----------------------------------------------------------|
  3612. * | cookie MSBs |
  3613. * |-----------------------------------------------------------|
  3614. * Header fields:
  3615. * - MSG_TYPE
  3616. * Bits 7:0
  3617. * Purpose: identifies this is a stats upload request message
  3618. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3619. * - UPLOAD_TYPES
  3620. * Bits 31:8
  3621. * Purpose: identifies which types of FW statistics to upload
  3622. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3623. * - RESET_TYPES
  3624. * Bits 31:8
  3625. * Purpose: identifies which types of FW statistics to reset
  3626. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3627. * - CFG_VAL
  3628. * Bits 23:0
  3629. * Purpose: give an opaque configuration value to the specified stats type
  3630. * Value: stats-type specific configuration value
  3631. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3632. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3633. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3634. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3635. * - CFG_STAT_TYPE
  3636. * Bits 31:24
  3637. * Purpose: specify which stats type (if any) the config value applies to
  3638. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3639. * a valid configuration specification
  3640. * - COOKIE_LSBS
  3641. * Bits 31:0
  3642. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3643. * message with its preceding host->target stats request message.
  3644. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3645. * - COOKIE_MSBS
  3646. * Bits 31:0
  3647. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3648. * message with its preceding host->target stats request message.
  3649. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3650. */
  3651. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3652. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3653. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3654. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3655. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3656. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3657. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3658. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3659. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3660. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3661. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3662. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3663. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3664. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3665. do { \
  3666. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3667. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3668. } while (0)
  3669. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3670. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3671. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3672. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3675. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3676. } while (0)
  3677. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3678. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3679. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3680. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3683. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3684. } while (0)
  3685. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3686. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3687. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3688. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3691. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3692. } while (0)
  3693. /**
  3694. * @brief host -> target HTT out-of-band sync request
  3695. *
  3696. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3697. *
  3698. * @details
  3699. * The HTT SYNC tells the target to suspend processing of subsequent
  3700. * HTT host-to-target messages until some other target agent locally
  3701. * informs the target HTT FW that the current sync counter is equal to
  3702. * or greater than (in a modulo sense) the sync counter specified in
  3703. * the SYNC message.
  3704. * This allows other host-target components to synchronize their operation
  3705. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3706. * security key has been downloaded to and activated by the target.
  3707. * In the absence of any explicit synchronization counter value
  3708. * specification, the target HTT FW will use zero as the default current
  3709. * sync value.
  3710. *
  3711. * |31 24|23 16|15 8|7 0|
  3712. * |-----------------------------------------------------------|
  3713. * | reserved | sync count | msg type |
  3714. * |-----------------------------------------------------------|
  3715. * Header fields:
  3716. * - MSG_TYPE
  3717. * Bits 7:0
  3718. * Purpose: identifies this as a sync message
  3719. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3720. * - SYNC_COUNT
  3721. * Bits 15:8
  3722. * Purpose: specifies what sync value the HTT FW will wait for from
  3723. * an out-of-band specification to resume its operation
  3724. * Value: in-band sync counter value to compare against the out-of-band
  3725. * counter spec.
  3726. * The HTT target FW will suspend its host->target message processing
  3727. * as long as
  3728. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3729. */
  3730. #define HTT_H2T_SYNC_MSG_SZ 4
  3731. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3732. #define HTT_H2T_SYNC_COUNT_S 8
  3733. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3734. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3735. HTT_H2T_SYNC_COUNT_S)
  3736. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3739. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3740. } while (0)
  3741. /**
  3742. * @brief host -> target HTT aggregation configuration
  3743. *
  3744. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3745. */
  3746. #define HTT_AGGR_CFG_MSG_SZ 4
  3747. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3749. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3750. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3751. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3752. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3753. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3754. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3757. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3758. } while (0)
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3760. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3761. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3762. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3765. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3766. } while (0)
  3767. /**
  3768. * @brief host -> target HTT configure max amsdu info per vdev
  3769. *
  3770. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3771. *
  3772. * @details
  3773. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3774. *
  3775. * |31 21|20 16|15 8|7 0|
  3776. * |-----------------------------------------------------------|
  3777. * | reserved | vdev id | max amsdu | msg type |
  3778. * |-----------------------------------------------------------|
  3779. * Header fields:
  3780. * - MSG_TYPE
  3781. * Bits 7:0
  3782. * Purpose: identifies this as a aggr cfg ex message
  3783. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3784. * - MAX_NUM_AMSDU_SUBFRM
  3785. * Bits 15:8
  3786. * Purpose: max MSDUs per A-MSDU
  3787. * - VDEV_ID
  3788. * Bits 20:16
  3789. * Purpose: ID of the vdev to which this limit is applied
  3790. */
  3791. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3792. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3793. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3794. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3795. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3796. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3797. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3798. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3799. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3800. do { \
  3801. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3802. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3803. } while (0)
  3804. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3805. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3806. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3807. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3808. do { \
  3809. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3810. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3811. } while (0)
  3812. /**
  3813. * @brief HTT WDI_IPA Config Message
  3814. *
  3815. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3816. *
  3817. * @details
  3818. * The HTT WDI_IPA config message is created/sent by host at driver
  3819. * init time. It contains information about data structures used on
  3820. * WDI_IPA TX and RX path.
  3821. * TX CE ring is used for pushing packet metadata from IPA uC
  3822. * to WLAN FW
  3823. * TX Completion ring is used for generating TX completions from
  3824. * WLAN FW to IPA uC
  3825. * RX Indication ring is used for indicating RX packets from FW
  3826. * to IPA uC
  3827. * RX Ring2 is used as either completion ring or as second
  3828. * indication ring. when Ring2 is used as completion ring, IPA uC
  3829. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3830. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3831. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3832. * indicated in RX Indication ring. Please see WDI_IPA specification
  3833. * for more details.
  3834. * |31 24|23 16|15 8|7 0|
  3835. * |----------------+----------------+----------------+----------------|
  3836. * | tx pkt pool size | Rsvd | msg_type |
  3837. * |-------------------------------------------------------------------|
  3838. * | tx comp ring base (bits 31:0) |
  3839. #if HTT_PADDR64
  3840. * | tx comp ring base (bits 63:32) |
  3841. #endif
  3842. * |-------------------------------------------------------------------|
  3843. * | tx comp ring size |
  3844. * |-------------------------------------------------------------------|
  3845. * | tx comp WR_IDX physical address (bits 31:0) |
  3846. #if HTT_PADDR64
  3847. * | tx comp WR_IDX physical address (bits 63:32) |
  3848. #endif
  3849. * |-------------------------------------------------------------------|
  3850. * | tx CE WR_IDX physical address (bits 31:0) |
  3851. #if HTT_PADDR64
  3852. * | tx CE WR_IDX physical address (bits 63:32) |
  3853. #endif
  3854. * |-------------------------------------------------------------------|
  3855. * | rx indication ring base (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | rx indication ring base (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * | rx indication ring size |
  3861. * |-------------------------------------------------------------------|
  3862. * | rx ind RD_IDX physical address (bits 31:0) |
  3863. #if HTT_PADDR64
  3864. * | rx ind RD_IDX physical address (bits 63:32) |
  3865. #endif
  3866. * |-------------------------------------------------------------------|
  3867. * | rx ind WR_IDX physical address (bits 31:0) |
  3868. #if HTT_PADDR64
  3869. * | rx ind WR_IDX physical address (bits 63:32) |
  3870. #endif
  3871. * |-------------------------------------------------------------------|
  3872. * |-------------------------------------------------------------------|
  3873. * | rx ring2 base (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | rx ring2 base (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. * | rx ring2 size |
  3879. * |-------------------------------------------------------------------|
  3880. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3881. #if HTT_PADDR64
  3882. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3883. #endif
  3884. * |-------------------------------------------------------------------|
  3885. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3886. #if HTT_PADDR64
  3887. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3888. #endif
  3889. * |-------------------------------------------------------------------|
  3890. *
  3891. * Header fields:
  3892. * Header fields:
  3893. * - MSG_TYPE
  3894. * Bits 7:0
  3895. * Purpose: Identifies this as WDI_IPA config message
  3896. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3897. * - TX_PKT_POOL_SIZE
  3898. * Bits 15:0
  3899. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3900. * WDI_IPA TX path
  3901. * For systems using 32-bit format for bus addresses:
  3902. * - TX_COMP_RING_BASE_ADDR
  3903. * Bits 31:0
  3904. * Purpose: TX Completion Ring base address in DDR
  3905. * - TX_COMP_RING_SIZE
  3906. * Bits 31:0
  3907. * Purpose: TX Completion Ring size (must be power of 2)
  3908. * - TX_COMP_WR_IDX_ADDR
  3909. * Bits 31:0
  3910. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3911. * updates the Write Index for WDI_IPA TX completion ring
  3912. * - TX_CE_WR_IDX_ADDR
  3913. * Bits 31:0
  3914. * Purpose: DDR address where IPA uC
  3915. * updates the WR Index for TX CE ring
  3916. * (needed for fusion platforms)
  3917. * - RX_IND_RING_BASE_ADDR
  3918. * Bits 31:0
  3919. * Purpose: RX Indication Ring base address in DDR
  3920. * - RX_IND_RING_SIZE
  3921. * Bits 31:0
  3922. * Purpose: RX Indication Ring size
  3923. * - RX_IND_RD_IDX_ADDR
  3924. * Bits 31:0
  3925. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3926. * RX indication ring
  3927. * - RX_IND_WR_IDX_ADDR
  3928. * Bits 31:0
  3929. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3930. * updates the Write Index for WDI_IPA RX indication ring
  3931. * - RX_RING2_BASE_ADDR
  3932. * Bits 31:0
  3933. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3934. * - RX_RING2_SIZE
  3935. * Bits 31:0
  3936. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3937. * - RX_RING2_RD_IDX_ADDR
  3938. * Bits 31:0
  3939. * Purpose: If Second RX ring is Indication ring, DDR address where
  3940. * IPA uC updates the Read Index for Ring2.
  3941. * If Second RX ring is completion ring, this is NOT used
  3942. * - RX_RING2_WR_IDX_ADDR
  3943. * Bits 31:0
  3944. * Purpose: If Second RX ring is Indication ring, DDR address where
  3945. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3946. * If second RX ring is completion ring, DDR address where
  3947. * IPA uC updates the Write Index for Ring 2.
  3948. * For systems using 64-bit format for bus addresses:
  3949. * - TX_COMP_RING_BASE_ADDR_LO
  3950. * Bits 31:0
  3951. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3952. * - TX_COMP_RING_BASE_ADDR_HI
  3953. * Bits 31:0
  3954. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3955. * - TX_COMP_RING_SIZE
  3956. * Bits 31:0
  3957. * Purpose: TX Completion Ring size (must be power of 2)
  3958. * - TX_COMP_WR_IDX_ADDR_LO
  3959. * Bits 31:0
  3960. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3961. * Lower 4 bytes of DDR address where WIFI FW
  3962. * updates the Write Index for WDI_IPA TX completion ring
  3963. * - TX_COMP_WR_IDX_ADDR_HI
  3964. * Bits 31:0
  3965. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3966. * Higher 4 bytes of DDR address where WIFI FW
  3967. * updates the Write Index for WDI_IPA TX completion ring
  3968. * - TX_CE_WR_IDX_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3971. * updates the WR Index for TX CE ring
  3972. * (needed for fusion platforms)
  3973. * - TX_CE_WR_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3976. * updates the WR Index for TX CE ring
  3977. * (needed for fusion platforms)
  3978. * - RX_IND_RING_BASE_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3981. * - RX_IND_RING_BASE_ADDR_HI
  3982. * Bits 31:0
  3983. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3984. * - RX_IND_RING_SIZE
  3985. * Bits 31:0
  3986. * Purpose: RX Indication Ring size
  3987. * - RX_IND_RD_IDX_ADDR_LO
  3988. * Bits 31:0
  3989. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3990. * for WDI_IPA RX indication ring
  3991. * - RX_IND_RD_IDX_ADDR_HI
  3992. * Bits 31:0
  3993. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3994. * for WDI_IPA RX indication ring
  3995. * - RX_IND_WR_IDX_ADDR_LO
  3996. * Bits 31:0
  3997. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3998. * Lower 4 bytes of DDR address where WIFI FW
  3999. * updates the Write Index for WDI_IPA RX indication ring
  4000. * - RX_IND_WR_IDX_ADDR_HI
  4001. * Bits 31:0
  4002. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4003. * Higher 4 bytes of DDR address where WIFI FW
  4004. * updates the Write Index for WDI_IPA RX indication ring
  4005. * - RX_RING2_BASE_ADDR_LO
  4006. * Bits 31:0
  4007. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4008. * - RX_RING2_BASE_ADDR_HI
  4009. * Bits 31:0
  4010. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4011. * - RX_RING2_SIZE
  4012. * Bits 31:0
  4013. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4014. * - RX_RING2_RD_IDX_ADDR_LO
  4015. * Bits 31:0
  4016. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4017. * DDR address where IPA uC updates the Read Index for Ring2.
  4018. * If Second RX ring is completion ring, this is NOT used
  4019. * - RX_RING2_RD_IDX_ADDR_HI
  4020. * Bits 31:0
  4021. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4022. * DDR address where IPA uC updates the Read Index for Ring2.
  4023. * If Second RX ring is completion ring, this is NOT used
  4024. * - RX_RING2_WR_IDX_ADDR_LO
  4025. * Bits 31:0
  4026. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4027. * DDR address where WIFI FW updates the Write Index
  4028. * for WDI_IPA RX ring2
  4029. * If second RX ring is completion ring, lower 4 bytes of
  4030. * DDR address where IPA uC updates the Write Index for Ring 2.
  4031. * - RX_RING2_WR_IDX_ADDR_HI
  4032. * Bits 31:0
  4033. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4034. * DDR address where WIFI FW updates the Write Index
  4035. * for WDI_IPA RX ring2
  4036. * If second RX ring is completion ring, higher 4 bytes of
  4037. * DDR address where IPA uC updates the Write Index for Ring 2.
  4038. */
  4039. #if HTT_PADDR64
  4040. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4041. #else
  4042. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4043. #endif
  4044. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4045. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4062. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4064. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4106. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4107. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4108. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4111. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4112. } while (0)
  4113. /* for systems using 32-bit format for bus addr */
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4115. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4119. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4120. } while (0)
  4121. /* for systems using 64-bit format for bus addr */
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4123. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4127. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4128. } while (0)
  4129. /* for systems using 64-bit format for bus addr */
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4131. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4135. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4136. } while (0)
  4137. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4138. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4139. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4142. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4143. } while (0)
  4144. /* for systems using 32-bit format for bus addr */
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4146. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4147. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4150. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4151. } while (0)
  4152. /* for systems using 64-bit format for bus addr */
  4153. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4154. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4155. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4156. do { \
  4157. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4158. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4159. } while (0)
  4160. /* for systems using 64-bit format for bus addr */
  4161. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4162. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4163. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4164. do { \
  4165. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4166. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4167. } while (0)
  4168. /* for systems using 32-bit format for bus addr */
  4169. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4170. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4171. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4172. do { \
  4173. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4174. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4175. } while (0)
  4176. /* for systems using 64-bit format for bus addr */
  4177. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4178. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4179. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4182. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4183. } while (0)
  4184. /* for systems using 64-bit format for bus addr */
  4185. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4186. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4187. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4190. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4191. } while (0)
  4192. /* for systems using 32-bit format for bus addr */
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4194. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4198. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4199. } while (0)
  4200. /* for systems using 64-bit format for bus addr */
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4202. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4206. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4207. } while (0)
  4208. /* for systems using 64-bit format for bus addr */
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4210. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4214. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4215. } while (0)
  4216. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4217. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4221. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4222. } while (0)
  4223. /* for systems using 32-bit format for bus addr */
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4225. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4226. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4227. do { \
  4228. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4229. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4230. } while (0)
  4231. /* for systems using 64-bit format for bus addr */
  4232. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4233. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4234. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4235. do { \
  4236. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4237. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4238. } while (0)
  4239. /* for systems using 64-bit format for bus addr */
  4240. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4241. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4242. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4243. do { \
  4244. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4245. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4246. } while (0)
  4247. /* for systems using 32-bit format for bus addr */
  4248. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4249. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4250. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4253. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4254. } while (0)
  4255. /* for systems using 64-bit format for bus addr */
  4256. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4257. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4258. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4261. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4262. } while (0)
  4263. /* for systems using 64-bit format for bus addr */
  4264. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4265. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4266. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4269. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4270. } while (0)
  4271. /* for systems using 32-bit format for bus addr */
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4273. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4275. do { \
  4276. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4277. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4278. } while (0)
  4279. /* for systems using 64-bit format for bus addr */
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4281. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4285. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4286. } while (0)
  4287. /* for systems using 64-bit format for bus addr */
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4289. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4294. } while (0)
  4295. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4296. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4298. do { \
  4299. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4300. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4301. } while (0)
  4302. /* for systems using 32-bit format for bus addr */
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4304. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4305. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4308. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4309. } while (0)
  4310. /* for systems using 64-bit format for bus addr */
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4312. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4313. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4316. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4317. } while (0)
  4318. /* for systems using 64-bit format for bus addr */
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4320. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4321. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4324. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4325. } while (0)
  4326. /* for systems using 32-bit format for bus addr */
  4327. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4328. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4329. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4332. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4333. } while (0)
  4334. /* for systems using 64-bit format for bus addr */
  4335. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4336. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4337. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4338. do { \
  4339. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4340. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4341. } while (0)
  4342. /* for systems using 64-bit format for bus addr */
  4343. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4344. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4345. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4348. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4349. } while (0)
  4350. /*
  4351. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4352. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4353. * addresses are stored in a XXX-bit field.
  4354. * This macro is used to define both htt_wdi_ipa_config32_t and
  4355. * htt_wdi_ipa_config64_t structs.
  4356. */
  4357. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4358. _paddr__tx_comp_ring_base_addr_, \
  4359. _paddr__tx_comp_wr_idx_addr_, \
  4360. _paddr__tx_ce_wr_idx_addr_, \
  4361. _paddr__rx_ind_ring_base_addr_, \
  4362. _paddr__rx_ind_rd_idx_addr_, \
  4363. _paddr__rx_ind_wr_idx_addr_, \
  4364. _paddr__rx_ring2_base_addr_,\
  4365. _paddr__rx_ring2_rd_idx_addr_,\
  4366. _paddr__rx_ring2_wr_idx_addr_) \
  4367. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4368. { \
  4369. /* DWORD 0: flags and meta-data */ \
  4370. A_UINT32 \
  4371. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4372. reserved: 8, \
  4373. tx_pkt_pool_size: 16;\
  4374. /* DWORD 1 */\
  4375. _paddr__tx_comp_ring_base_addr_;\
  4376. /* DWORD 2 (or 3)*/\
  4377. A_UINT32 tx_comp_ring_size;\
  4378. /* DWORD 3 (or 4)*/\
  4379. _paddr__tx_comp_wr_idx_addr_;\
  4380. /* DWORD 4 (or 6)*/\
  4381. _paddr__tx_ce_wr_idx_addr_;\
  4382. /* DWORD 5 (or 8)*/\
  4383. _paddr__rx_ind_ring_base_addr_;\
  4384. /* DWORD 6 (or 10)*/\
  4385. A_UINT32 rx_ind_ring_size;\
  4386. /* DWORD 7 (or 11)*/\
  4387. _paddr__rx_ind_rd_idx_addr_;\
  4388. /* DWORD 8 (or 13)*/\
  4389. _paddr__rx_ind_wr_idx_addr_;\
  4390. /* DWORD 9 (or 15)*/\
  4391. _paddr__rx_ring2_base_addr_;\
  4392. /* DWORD 10 (or 17) */\
  4393. A_UINT32 rx_ring2_size;\
  4394. /* DWORD 11 (or 18) */\
  4395. _paddr__rx_ring2_rd_idx_addr_;\
  4396. /* DWORD 12 (or 20) */\
  4397. _paddr__rx_ring2_wr_idx_addr_;\
  4398. } POSTPACK
  4399. /* define a htt_wdi_ipa_config32_t type */
  4400. 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));
  4401. /* define a htt_wdi_ipa_config64_t type */
  4402. 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));
  4403. #if HTT_PADDR64
  4404. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4405. #else
  4406. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4407. #endif
  4408. enum htt_wdi_ipa_op_code {
  4409. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4410. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4411. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4412. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4413. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4414. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4415. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4416. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4417. /* keep this last */
  4418. HTT_WDI_IPA_OPCODE_MAX
  4419. };
  4420. /**
  4421. * @brief HTT WDI_IPA Operation Request Message
  4422. *
  4423. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4424. *
  4425. * @details
  4426. * HTT WDI_IPA Operation Request message is sent by host
  4427. * to either suspend or resume WDI_IPA TX or RX path.
  4428. * |31 24|23 16|15 8|7 0|
  4429. * |----------------+----------------+----------------+----------------|
  4430. * | op_code | Rsvd | msg_type |
  4431. * |-------------------------------------------------------------------|
  4432. *
  4433. * Header fields:
  4434. * - MSG_TYPE
  4435. * Bits 7:0
  4436. * Purpose: Identifies this as WDI_IPA Operation Request message
  4437. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4438. * - OP_CODE
  4439. * Bits 31:16
  4440. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4441. * value: = enum htt_wdi_ipa_op_code
  4442. */
  4443. PREPACK struct htt_wdi_ipa_op_request_t
  4444. {
  4445. /* DWORD 0: flags and meta-data */
  4446. A_UINT32
  4447. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4448. reserved: 8,
  4449. op_code: 16;
  4450. } POSTPACK;
  4451. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4452. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4453. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4454. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4455. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4456. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4457. do { \
  4458. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4459. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4460. } while (0)
  4461. /*
  4462. * @brief host -> target HTT_MSI_SETUP message
  4463. *
  4464. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4465. *
  4466. * @details
  4467. * After target is booted up, host can send MSI setup message so that
  4468. * target sets up HW registers based on setup message.
  4469. *
  4470. * The message would appear as follows:
  4471. * |31 24|23 16|15|14 8|7 0|
  4472. * |---------------+-----------------+-----------------+-----------------|
  4473. * | reserved | msi_type | pdev_id | msg_type |
  4474. * |---------------------------------------------------------------------|
  4475. * | msi_addr_lo |
  4476. * |---------------------------------------------------------------------|
  4477. * | msi_addr_hi |
  4478. * |---------------------------------------------------------------------|
  4479. * | msi_data |
  4480. * |---------------------------------------------------------------------|
  4481. *
  4482. * The message is interpreted as follows:
  4483. * dword0 - b'0:7 - msg_type: This will be set to
  4484. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4485. * b'8:15 - pdev_id:
  4486. * 0 (for rings at SOC/UMAC level),
  4487. * 1/2/3 mac id (for rings at LMAC level)
  4488. * b'16:23 - msi_type: identify which msi registers need to be setup
  4489. * more details can be got from enum htt_msi_setup_type
  4490. * b'24:31 - reserved
  4491. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4492. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4493. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4494. */
  4495. PREPACK struct htt_msi_setup_t {
  4496. A_UINT32 msg_type: 8,
  4497. pdev_id: 8,
  4498. msi_type: 8,
  4499. reserved: 8;
  4500. A_UINT32 msi_addr_lo;
  4501. A_UINT32 msi_addr_hi;
  4502. A_UINT32 msi_data;
  4503. } POSTPACK;
  4504. enum htt_msi_setup_type {
  4505. HTT_PPDU_END_MSI_SETUP_TYPE,
  4506. /* Insert new types here*/
  4507. };
  4508. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4509. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4510. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4511. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4512. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4513. HTT_MSI_SETUP_PDEV_ID_S)
  4514. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4515. do { \
  4516. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4517. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4518. } while (0)
  4519. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4520. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4521. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4522. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4523. HTT_MSI_SETUP_MSI_TYPE_S)
  4524. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4527. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4528. } while (0)
  4529. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4530. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4531. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4532. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4533. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4534. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4537. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4538. } while (0)
  4539. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4540. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4541. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4542. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4543. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4544. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4547. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4548. } while (0)
  4549. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4550. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4551. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4552. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4553. HTT_MSI_SETUP_MSI_DATA_S)
  4554. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4557. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4558. } while (0)
  4559. /*
  4560. * @brief host -> target HTT_SRING_SETUP message
  4561. *
  4562. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4563. *
  4564. * @details
  4565. * After target is booted up, Host can send SRING setup message for
  4566. * each host facing LMAC SRING. Target setups up HW registers based
  4567. * on setup message and confirms back to Host if response_required is set.
  4568. * Host should wait for confirmation message before sending new SRING
  4569. * setup message
  4570. *
  4571. * The message would appear as follows:
  4572. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4573. * |--------------- +-----------------+-----------------+-----------------|
  4574. * | ring_type | ring_id | pdev_id | msg_type |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_base_addr_lo |
  4577. * |----------------------------------------------------------------------|
  4578. * | ring_base_addr_hi |
  4579. * |----------------------------------------------------------------------|
  4580. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4581. * |----------------------------------------------------------------------|
  4582. * | ring_head_offset32_remote_addr_lo |
  4583. * |----------------------------------------------------------------------|
  4584. * | ring_head_offset32_remote_addr_hi |
  4585. * |----------------------------------------------------------------------|
  4586. * | ring_tail_offset32_remote_addr_lo |
  4587. * |----------------------------------------------------------------------|
  4588. * | ring_tail_offset32_remote_addr_hi |
  4589. * |----------------------------------------------------------------------|
  4590. * | ring_msi_addr_lo |
  4591. * |----------------------------------------------------------------------|
  4592. * | ring_msi_addr_hi |
  4593. * |----------------------------------------------------------------------|
  4594. * | ring_msi_data |
  4595. * |----------------------------------------------------------------------|
  4596. * | intr_timer_th |IM| intr_batch_counter_th |
  4597. * |----------------------------------------------------------------------|
  4598. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4599. * |----------------------------------------------------------------------|
  4600. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4601. * |----------------------------------------------------------------------|
  4602. * Where
  4603. * IM = sw_intr_mode
  4604. * RR = response_required
  4605. * PTCF = prefetch_timer_cfg
  4606. * IP = IPA drop flag
  4607. *
  4608. * The message is interpreted as follows:
  4609. * dword0 - b'0:7 - msg_type: This will be set to
  4610. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4611. * b'8:15 - pdev_id:
  4612. * 0 (for rings at SOC/UMAC level),
  4613. * 1/2/3 mac id (for rings at LMAC level)
  4614. * b'16:23 - ring_id: identify which ring is to setup,
  4615. * more details can be got from enum htt_srng_ring_id
  4616. * b'24:31 - ring_type: identify type of host rings,
  4617. * more details can be got from enum htt_srng_ring_type
  4618. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4619. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4620. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4621. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4622. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4623. * SW_TO_HW_RING.
  4624. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4625. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4626. * Lower 32 bits of memory address of the remote variable
  4627. * storing the 4-byte word offset that identifies the head
  4628. * element within the ring.
  4629. * (The head offset variable has type A_UINT32.)
  4630. * Valid for HW_TO_SW and SW_TO_SW rings.
  4631. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4632. * Upper 32 bits of memory address of the remote variable
  4633. * storing the 4-byte word offset that identifies the head
  4634. * element within the ring.
  4635. * (The head offset variable has type A_UINT32.)
  4636. * Valid for HW_TO_SW and SW_TO_SW rings.
  4637. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4638. * Lower 32 bits of memory address of the remote variable
  4639. * storing the 4-byte word offset that identifies the tail
  4640. * element within the ring.
  4641. * (The tail offset variable has type A_UINT32.)
  4642. * Valid for HW_TO_SW and SW_TO_SW rings.
  4643. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4644. * Upper 32 bits of memory address of the remote variable
  4645. * storing the 4-byte word offset that identifies the tail
  4646. * element within the ring.
  4647. * (The tail offset variable has type A_UINT32.)
  4648. * Valid for HW_TO_SW and SW_TO_SW rings.
  4649. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4650. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4651. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4652. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4653. * dword10 - b'0:31 - ring_msi_data: MSI data
  4654. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4655. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4656. * dword11 - b'0:14 - intr_batch_counter_th:
  4657. * batch counter threshold is in units of 4-byte words.
  4658. * HW internally maintains and increments batch count.
  4659. * (see SRING spec for detail description).
  4660. * When batch count reaches threshold value, an interrupt
  4661. * is generated by HW.
  4662. * b'15 - sw_intr_mode:
  4663. * This configuration shall be static.
  4664. * Only programmed at power up.
  4665. * 0: generate pulse style sw interrupts
  4666. * 1: generate level style sw interrupts
  4667. * b'16:31 - intr_timer_th:
  4668. * The timer init value when timer is idle or is
  4669. * initialized to start downcounting.
  4670. * In 8us units (to cover a range of 0 to 524 ms)
  4671. * dword12 - b'0:15 - intr_low_threshold:
  4672. * Used only by Consumer ring to generate ring_sw_int_p.
  4673. * Ring entries low threshold water mark, that is used
  4674. * in combination with the interrupt timer as well as
  4675. * the the clearing of the level interrupt.
  4676. * b'16:18 - prefetch_timer_cfg:
  4677. * Used only by Consumer ring to set timer mode to
  4678. * support Application prefetch handling.
  4679. * The external tail offset/pointer will be updated
  4680. * at following intervals:
  4681. * 3'b000: (Prefetch feature disabled; used only for debug)
  4682. * 3'b001: 1 usec
  4683. * 3'b010: 4 usec
  4684. * 3'b011: 8 usec (default)
  4685. * 3'b100: 16 usec
  4686. * Others: Reserved
  4687. * b'19 - response_required:
  4688. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4689. * b'20 - ipa_drop_flag:
  4690. Indicates that host will config ipa drop threshold percentage
  4691. * b'21:31 - reserved: reserved for future use
  4692. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4693. * b'8:15 - ipa drop high threshold percentage:
  4694. * b'16:31 - Reserved
  4695. */
  4696. PREPACK struct htt_sring_setup_t {
  4697. A_UINT32 msg_type: 8,
  4698. pdev_id: 8,
  4699. ring_id: 8,
  4700. ring_type: 8;
  4701. A_UINT32 ring_base_addr_lo;
  4702. A_UINT32 ring_base_addr_hi;
  4703. A_UINT32 ring_size: 16,
  4704. ring_entry_size: 8,
  4705. ring_misc_cfg_flag: 8;
  4706. A_UINT32 ring_head_offset32_remote_addr_lo;
  4707. A_UINT32 ring_head_offset32_remote_addr_hi;
  4708. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4709. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4710. A_UINT32 ring_msi_addr_lo;
  4711. A_UINT32 ring_msi_addr_hi;
  4712. A_UINT32 ring_msi_data;
  4713. A_UINT32 intr_batch_counter_th: 15,
  4714. sw_intr_mode: 1,
  4715. intr_timer_th: 16;
  4716. A_UINT32 intr_low_threshold: 16,
  4717. prefetch_timer_cfg: 3,
  4718. response_required: 1,
  4719. ipa_drop_flag: 1,
  4720. reserved1: 11;
  4721. A_UINT32 ipa_drop_low_threshold: 8,
  4722. ipa_drop_high_threshold: 8,
  4723. reserved: 16;
  4724. } POSTPACK;
  4725. enum htt_srng_ring_type {
  4726. HTT_HW_TO_SW_RING = 0,
  4727. HTT_SW_TO_HW_RING,
  4728. HTT_SW_TO_SW_RING,
  4729. /* Insert new ring types above this line */
  4730. };
  4731. enum htt_srng_ring_id {
  4732. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4733. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4734. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4735. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4736. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4737. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4738. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4739. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4740. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4741. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4742. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4743. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4744. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4745. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4746. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4747. /* Add Other SRING which can't be directly configured by host software above this line */
  4748. };
  4749. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4750. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4751. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4752. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4753. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4754. HTT_SRING_SETUP_PDEV_ID_S)
  4755. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4756. do { \
  4757. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4758. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4759. } while (0)
  4760. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4761. #define HTT_SRING_SETUP_RING_ID_S 16
  4762. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4763. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4764. HTT_SRING_SETUP_RING_ID_S)
  4765. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4768. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4769. } while (0)
  4770. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4771. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4772. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4773. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4774. HTT_SRING_SETUP_RING_TYPE_S)
  4775. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4776. do { \
  4777. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4778. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4779. } while (0)
  4780. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4782. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4783. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4784. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4785. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4786. do { \
  4787. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4788. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4789. } while (0)
  4790. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4793. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4794. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4795. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4796. do { \
  4797. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4798. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4799. } while (0)
  4800. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4801. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4802. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4803. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4804. HTT_SRING_SETUP_RING_SIZE_S)
  4805. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4808. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4809. } while (0)
  4810. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4811. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4812. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4813. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4814. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4815. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4816. do { \
  4817. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4818. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4819. } while (0)
  4820. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4821. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4822. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4823. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4824. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4825. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4826. do { \
  4827. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4828. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4829. } while (0)
  4830. /* This control bit is applicable to only Producer, which updates Ring ID field
  4831. * of each descriptor before pushing into the ring.
  4832. * 0: updates ring_id(default)
  4833. * 1: ring_id updating disabled */
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4837. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4838. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4840. do { \
  4841. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4842. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4843. } while (0)
  4844. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4845. * of each descriptor before pushing into the ring.
  4846. * 0: updates Loopcnt(default)
  4847. * 1: Loopcnt updating disabled */
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4851. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4852. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4856. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4857. } while (0)
  4858. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4859. * into security_id port of GXI/AXI. */
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4863. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4864. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4866. do { \
  4867. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4868. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4869. } while (0)
  4870. /* During MSI write operation, SRNG drives value of this register bit into
  4871. * swap bit of GXI/AXI. */
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4875. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4876. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4878. do { \
  4879. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4880. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4881. } while (0)
  4882. /* During Pointer write operation, SRNG drives value of this register bit into
  4883. * swap bit of GXI/AXI. */
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4887. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4888. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4892. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4893. } while (0)
  4894. /* During any data or TLV write operation, SRNG drives value of this register
  4895. * bit into swap bit of GXI/AXI. */
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4898. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4899. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4900. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4901. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4904. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4905. } while (0)
  4906. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4908. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4910. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4911. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4912. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4913. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4914. do { \
  4915. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4916. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4917. } while (0)
  4918. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4921. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4922. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4923. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4924. do { \
  4925. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4926. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4927. } while (0)
  4928. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4930. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4931. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4932. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4933. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4936. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4937. } while (0)
  4938. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4941. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4942. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4943. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4944. do { \
  4945. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4946. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4947. } while (0)
  4948. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4950. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4951. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4952. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4953. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4954. do { \
  4955. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4956. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4957. } while (0)
  4958. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4961. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4962. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4963. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4964. do { \
  4965. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4966. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4967. } while (0)
  4968. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4969. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4970. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4971. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4972. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4973. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4974. do { \
  4975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4976. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4977. } while (0)
  4978. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4979. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4980. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4981. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4982. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4983. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4984. do { \
  4985. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4986. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4987. } while (0)
  4988. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4989. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4990. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4991. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4992. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4993. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4994. do { \
  4995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4996. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4997. } while (0)
  4998. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4999. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5000. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5001. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5002. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5003. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5004. do { \
  5005. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5006. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5007. } while (0)
  5008. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5009. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5010. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5011. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5012. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5013. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5014. do { \
  5015. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5016. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5017. } while (0)
  5018. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5019. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5020. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5021. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5022. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5023. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5024. do { \
  5025. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5026. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5027. } while (0)
  5028. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5029. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5030. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5031. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5032. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5033. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5034. do { \
  5035. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5036. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5037. } while (0)
  5038. /**
  5039. * @brief host -> target RX ring selection config message
  5040. *
  5041. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5042. *
  5043. * @details
  5044. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5045. * configure RXDMA rings.
  5046. * The configuration is per ring based and includes both packet subtypes
  5047. * and PPDU/MPDU TLVs.
  5048. *
  5049. * The message would appear as follows:
  5050. *
  5051. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5052. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5053. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5054. * |-----------------------+-----+-----+--------------------------------|
  5055. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5056. * |--------------------------------------------------------------------|
  5057. * | packet_type_enable_flags_0 |
  5058. * |--------------------------------------------------------------------|
  5059. * | packet_type_enable_flags_1 |
  5060. * |--------------------------------------------------------------------|
  5061. * | packet_type_enable_flags_2 |
  5062. * |--------------------------------------------------------------------|
  5063. * | packet_type_enable_flags_3 |
  5064. * |--------------------------------------------------------------------|
  5065. * | tlv_filter_in_flags |
  5066. * |-----------------------------------+--------------------------------|
  5067. * | rx_header_offset | rx_packet_offset |
  5068. * |-----------------------------------+--------------------------------|
  5069. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5070. * |-----------------------------------+--------------------------------|
  5071. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5072. * |-----------------------------------+--------------------------------|
  5073. * | rsvd3 | rx_attention_offset |
  5074. * |--------------------------------------------------------------------|
  5075. * | rsvd4 | mo| fp| rx_drop_threshold |
  5076. * | |ndp|ndp| |
  5077. * |--------------------------------------------------------------------|
  5078. * Where:
  5079. * PS = pkt_swap
  5080. * SS = status_swap
  5081. * OV = rx_offsets_valid
  5082. * DT = drop_thresh_valid
  5083. * CLM = config_length_mgmt
  5084. * CLC = config_length_ctrl
  5085. * CLD = config_length_data
  5086. * RXHDL = rx_hdr_len
  5087. * RX = rxpcu_filter_enable_flag
  5088. * The message is interpreted as follows:
  5089. * dword0 - b'0:7 - msg_type: This will be set to
  5090. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5091. * b'8:15 - pdev_id:
  5092. * 0 (for rings at SOC/UMAC level),
  5093. * 1/2/3 mac id (for rings at LMAC level)
  5094. * b'16:23 - ring_id : Identify the ring to configure.
  5095. * More details can be got from enum htt_srng_ring_id
  5096. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5097. * BUF_RING_CFG_0 defs within HW .h files,
  5098. * e.g. wmac_top_reg_seq_hwioreg.h
  5099. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5100. * BUF_RING_CFG_0 defs within HW .h files,
  5101. * e.g. wmac_top_reg_seq_hwioreg.h
  5102. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5103. * configuration fields are valid
  5104. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5105. * rx_drop_threshold field is valid
  5106. * b'28 - rx_mon_global_en: Enable/Disable global register
  5107. 8 configuration in Rx monitor module.
  5108. * b'29:31 - rsvd1: reserved for future use
  5109. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5110. * in byte units.
  5111. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5112. * b'16:18 - config_length_mgmt (MGMT):
  5113. * Represents the length of mpdu bytes for mgmt pkt.
  5114. * valid values:
  5115. * 001 - 64bytes
  5116. * 010 - 128bytes
  5117. * 100 - 256bytes
  5118. * 111 - Full mpdu bytes
  5119. * b'19:21 - config_length_ctrl (CTRL):
  5120. * Represents the length of mpdu bytes for ctrl pkt.
  5121. * valid values:
  5122. * 001 - 64bytes
  5123. * 010 - 128bytes
  5124. * 100 - 256bytes
  5125. * 111 - Full mpdu bytes
  5126. * b'22:24 - config_length_data (DATA):
  5127. * Represents the length of mpdu bytes for data pkt.
  5128. * valid values:
  5129. * 001 - 64bytes
  5130. * 010 - 128bytes
  5131. * 100 - 256bytes
  5132. * 111 - Full mpdu bytes
  5133. * b'25:26 - rx_hdr_len:
  5134. * Specifies the number of bytes of recvd packet to copy
  5135. * into the rx_hdr tlv.
  5136. * supported values for now by host:
  5137. * 01 - 64bytes
  5138. * 10 - 128bytes
  5139. * 11 - 256bytes
  5140. * default - 128 bytes
  5141. * b'27 - rxpcu_filter_enable_flag
  5142. * For Scan Radio Host CPU utilization is very high.
  5143. * In order to reduce CPU utilization we need to filter out
  5144. * certain configured MAC frames.
  5145. * To filter out configured MAC address frames, RxPCU should
  5146. * be zero which means allow all frames for MD at RxOLE
  5147. * host wil fiter out frames.
  5148. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5149. * b'28:31 - rsvd2: Reserved for future use
  5150. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5151. * Enable MGMT packet from 0b0000 to 0b1001
  5152. * bits from low to high: FP, MD, MO - 3 bits
  5153. * FP: Filter_Pass
  5154. * MD: Monitor_Direct
  5155. * MO: Monitor_Other
  5156. * 10 mgmt subtypes * 3 bits -> 30 bits
  5157. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5158. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5159. * Enable MGMT packet from 0b1010 to 0b1111
  5160. * bits from low to high: FP, MD, MO - 3 bits
  5161. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5162. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5163. * Enable CTRL packet from 0b0000 to 0b1001
  5164. * bits from low to high: FP, MD, MO - 3 bits
  5165. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5166. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5167. * Enable CTRL packet from 0b1010 to 0b1111,
  5168. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5169. * bits from low to high: FP, MD, MO - 3 bits
  5170. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5171. * dword6 - b'0:31 - tlv_filter_in_flags:
  5172. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5173. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5174. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5175. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5176. * A value of 0 will be considered as ignore this config.
  5177. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5178. * e.g. wmac_top_reg_seq_hwioreg.h
  5179. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5180. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5181. * A value of 0 will be considered as ignore this config.
  5182. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5183. * e.g. wmac_top_reg_seq_hwioreg.h
  5184. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5185. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5186. * A value of 0 will be considered as ignore this config.
  5187. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5188. * e.g. wmac_top_reg_seq_hwioreg.h
  5189. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5190. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5191. * A value of 0 will be considered as ignore this config.
  5192. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5193. * e.g. wmac_top_reg_seq_hwioreg.h
  5194. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5195. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5196. * A value of 0 will be considered as ignore this config.
  5197. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5198. * e.g. wmac_top_reg_seq_hwioreg.h
  5199. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5200. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5201. * A value of 0 will be considered as ignore this config.
  5202. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5203. * e.g. wmac_top_reg_seq_hwioreg.h
  5204. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5205. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5206. * A value of 0 will be considered as ignore this config.
  5207. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5208. * e.g. wmac_top_reg_seq_hwioreg.h
  5209. * - b'16:31 - rsvd3 for future use
  5210. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5211. * to source rings. Consumer drops packets if the available
  5212. * words in the ring falls below the configured threshold
  5213. * value.
  5214. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5215. * by host. 1 -> subscribed
  5216. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5217. * by host. 1 -> subscribed
  5218. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5219. * subscribed by host. 1 -> subscribed
  5220. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5221. * selection for the FP PHY ERR status tlv.
  5222. * 0 - wbm2rxdma_buf_source_ring
  5223. * 1 - fw2rxdma_buf_source_ring
  5224. * 2 - sw2rxdma_buf_source_ring
  5225. * 3 - no_buffer_ring
  5226. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5227. * selection for the FP PHY ERR status tlv.
  5228. * 0 - rxdma_release_ring
  5229. * 1 - rxdma2fw_ring
  5230. * 2 - rxdma2sw_ring
  5231. * 3 - rxdma2reo_ring
  5232. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5233. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5234. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5235. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5236. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5237. * 0: MSDU level logging
  5238. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5239. * 0: MSDU level logging
  5240. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5241. * 0: MSDU level logging
  5242. * - b'23 - word_mask_compaction: enable/disable word mask for
  5243. * mpdu/msdu start/end tlvs
  5244. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5245. * manager override
  5246. * - b'25:28 - rbm_override_val: return buffer manager override value
  5247. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5248. * which have to be posted to host from phy.
  5249. * Corresponding to errors defined in
  5250. * phyrx_abort_request_reason enums 0 to 31.
  5251. * Refer to RXPCU register definition header files for the
  5252. * phyrx_abort_request_reason enum definition.
  5253. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5254. * errors which have to be posted to host from phy.
  5255. * Corresponding to errors defined in
  5256. * phyrx_abort_request_reason enums 32 to 63.
  5257. * Refer to RXPCU register definition header files for the
  5258. * phyrx_abort_request_reason enum definition.
  5259. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5260. * applicable if word mask enabled
  5261. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5262. * applicable if word mask enabled
  5263. * - b'19:31 - rsvd7
  5264. * dword15- b'0:16 - rx_msdu_end_word_mask
  5265. * - b'17:31 - rsvd5
  5266. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5267. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5268. * buffer
  5269. * 1: RX_PKT TLV logging at specified offset for the
  5270. * subsequent buffer
  5271. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5272. */
  5273. PREPACK struct htt_rx_ring_selection_cfg_t {
  5274. A_UINT32 msg_type: 8,
  5275. pdev_id: 8,
  5276. ring_id: 8,
  5277. status_swap: 1,
  5278. pkt_swap: 1,
  5279. rx_offsets_valid: 1,
  5280. drop_thresh_valid: 1,
  5281. rx_mon_global_en: 1,
  5282. rsvd1: 3;
  5283. A_UINT32 ring_buffer_size: 16,
  5284. config_length_mgmt:3,
  5285. config_length_ctrl:3,
  5286. config_length_data:3,
  5287. rx_hdr_len: 2,
  5288. rxpcu_filter_enable_flag:1,
  5289. rsvd2: 4;
  5290. A_UINT32 packet_type_enable_flags_0;
  5291. A_UINT32 packet_type_enable_flags_1;
  5292. A_UINT32 packet_type_enable_flags_2;
  5293. A_UINT32 packet_type_enable_flags_3;
  5294. A_UINT32 tlv_filter_in_flags;
  5295. A_UINT32 rx_packet_offset: 16,
  5296. rx_header_offset: 16;
  5297. A_UINT32 rx_mpdu_end_offset: 16,
  5298. rx_mpdu_start_offset: 16;
  5299. A_UINT32 rx_msdu_end_offset: 16,
  5300. rx_msdu_start_offset: 16;
  5301. A_UINT32 rx_attn_offset: 16,
  5302. rsvd3: 16;
  5303. A_UINT32 rx_drop_threshold: 10,
  5304. fp_ndp: 1,
  5305. mo_ndp: 1,
  5306. fp_phy_err: 1,
  5307. fp_phy_err_buf_src: 2,
  5308. fp_phy_err_buf_dest: 2,
  5309. pkt_type_enable_msdu_or_mpdu_logging:3,
  5310. dma_mpdu_mgmt: 1,
  5311. dma_mpdu_ctrl: 1,
  5312. dma_mpdu_data: 1,
  5313. word_mask_compaction_enable:1,
  5314. rbm_override_enable: 1,
  5315. rbm_override_val: 4,
  5316. rsvd4: 3;
  5317. A_UINT32 phy_err_mask;
  5318. A_UINT32 phy_err_mask_cont;
  5319. A_UINT32 rx_mpdu_start_word_mask:16,
  5320. rx_mpdu_end_word_mask: 3,
  5321. rsvd7: 13;
  5322. A_UINT32 rx_msdu_end_word_mask: 17,
  5323. rsvd5: 15;
  5324. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5325. rx_pkt_tlv_offset: 15,
  5326. rsvd6: 16;
  5327. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5328. rx_mpdu_end_word_mask_v2: 8,
  5329. rsvd8: 4;
  5330. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5331. rsvd9: 12;
  5332. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5333. rsvd10: 12;
  5334. A_UINT32 packet_type_enable_fpmo_flags0;
  5335. A_UINT32 packet_type_enable_fpmo_flags1;
  5336. } POSTPACK;
  5337. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5338. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5339. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5340. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5341. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5342. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5343. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5344. do { \
  5345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5346. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5347. } while (0)
  5348. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5349. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5350. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5351. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5352. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5353. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5357. } while (0)
  5358. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5359. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5360. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5361. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5362. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5363. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5364. do { \
  5365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5367. } while (0)
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5371. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5372. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5374. do { \
  5375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5377. } while (0)
  5378. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5379. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5380. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5381. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5382. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5383. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5384. do { \
  5385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5387. } while (0)
  5388. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5389. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5390. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5391. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5392. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5393. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5397. } while (0)
  5398. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5399. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5400. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5401. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5402. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5407. } while (0)
  5408. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5409. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5410. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5411. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5412. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5413. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5417. } while (0)
  5418. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5419. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5420. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5421. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5422. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5423. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5427. } while (0)
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5430. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5431. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5432. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5433. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5437. } while (0)
  5438. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5440. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5441. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5442. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5443. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5447. } while (0)
  5448. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5449. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5450. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5451. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5452. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5453. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5457. } while(0)
  5458. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5459. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5460. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5461. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5462. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5463. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5467. } while(0)
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5471. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5472. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5476. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5477. } while (0)
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5481. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5482. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5486. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5487. } while (0)
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5491. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5492. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5496. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5497. } while (0)
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5501. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5502. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5507. } while (0)
  5508. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5509. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5510. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5511. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5512. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5513. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5517. } while (0)
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5520. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5521. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5522. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5527. } while (0)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5531. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5532. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5537. } while (0)
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5541. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5542. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5547. } while (0)
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5551. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5552. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5557. } while (0)
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5560. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5561. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5562. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5563. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5567. } while (0)
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5570. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5571. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5572. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5573. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5577. } while (0)
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5580. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5581. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5582. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5583. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5587. } while (0)
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5590. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5591. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5592. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5593. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5597. } while (0)
  5598. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5599. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5600. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5601. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5602. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5603. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5607. } while (0)
  5608. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5609. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5610. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5611. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5612. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5613. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5617. } while (0)
  5618. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5619. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5620. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5621. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5622. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5623. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5630. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5631. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5632. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5633. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5637. } while (0)
  5638. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5640. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5641. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5642. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5643. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5647. } while (0)
  5648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5651. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5652. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5657. } while (0)
  5658. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5659. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5660. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5661. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5662. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5663. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5667. } while (0)
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5670. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5671. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5672. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5673. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5676. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5677. } while (0)
  5678. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5680. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5681. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5682. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5683. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5686. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5687. } while (0)
  5688. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5689. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5690. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5691. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5692. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5693. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5697. } while (0)
  5698. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5699. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5700. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5701. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5702. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5703. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5706. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5707. } while (0)
  5708. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5710. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5711. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5712. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5713. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5716. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5717. } while (0)
  5718. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5719. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5720. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5721. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5722. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5723. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5726. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5727. } while (0)
  5728. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5730. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5731. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5732. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5733. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5736. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5737. } while (0)
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5739. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5740. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5741. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5742. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5743. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5746. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5747. } while (0)
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5750. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5751. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5752. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5753. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5754. do { \
  5755. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5756. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5757. } while (0)
  5758. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5760. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5761. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5762. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5763. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5764. do { \
  5765. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5766. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5767. } while (0)
  5768. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5769. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5770. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5771. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5772. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5773. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5774. do { \
  5775. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5776. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5777. } while (0)
  5778. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5779. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5780. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5781. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5782. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5783. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5784. do { \
  5785. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5786. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5787. } while (0)
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5790. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5791. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5792. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5793. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5794. do { \
  5795. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5796. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5797. } while (0)
  5798. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5800. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5801. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5802. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5803. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5804. do { \
  5805. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5806. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5807. } while (0)
  5808. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5810. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5811. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5812. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5813. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5816. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5817. } while (0)
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5820. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5821. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5822. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5823. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5824. do { \
  5825. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5826. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5827. } while (0)
  5828. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5829. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5830. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5831. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5832. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5833. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5834. do { \
  5835. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5836. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5837. } while (0)
  5838. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5840. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5841. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5842. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5843. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5844. do { \
  5845. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5846. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5847. } while (0)
  5848. /*
  5849. * Subtype based MGMT frames enable bits.
  5850. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5851. */
  5852. /* association request */
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5859. /* association response */
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5866. /* Reassociation request */
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5873. /* Reassociation response */
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5880. /* Probe request */
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5887. /* Probe response */
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5894. /* Timing Advertisement */
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5901. /* Reserved */
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5908. /* Beacon */
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5915. /* ATIM */
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5922. /* Disassociation */
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5929. /* Authentication */
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5936. /* Deauthentication */
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5943. /* Action */
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5950. /* Action No Ack */
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5957. /* Reserved */
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5964. /*
  5965. * Subtype based CTRL frames enable bits.
  5966. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5967. */
  5968. /* Reserved */
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5975. /* Reserved */
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5982. /* Reserved */
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5989. /* Reserved */
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5996. /* Reserved */
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6003. /* Reserved */
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6010. /* Reserved */
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6017. /* Control Wrapper */
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6024. /* Block Ack Request */
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6031. /* Block Ack*/
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6038. /* PS-POLL */
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6045. /* RTS */
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6052. /* CTS */
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6059. /* ACK */
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6066. /* CF-END */
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6073. /* CF-END + CF-ACK */
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6080. /* Multicast data */
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6087. /* Unicast data */
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6094. /* NULL data */
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6101. /* FPMO mode flags */
  6102. /* MGMT */
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6135. /* CTRL */
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6168. /* DATA */
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6180. do { \
  6181. HTT_CHECK_SET_VAL(httsym, value); \
  6182. (word) |= (value) << httsym##_S; \
  6183. } while (0)
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6185. (((word) & httsym##_M) >> httsym##_S)
  6186. #define htt_rx_ring_pkt_enable_subtype_set( \
  6187. word, flag, mode, type, subtype, val) \
  6188. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6189. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6190. #define htt_rx_ring_pkt_enable_subtype_get( \
  6191. word, flag, mode, type, subtype) \
  6192. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6193. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6194. /* Definition to filter in TLVs */
  6195. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6196. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6197. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6198. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6199. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6200. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6201. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6202. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6223. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6224. do { \
  6225. HTT_CHECK_SET_VAL(httsym, enable); \
  6226. (word) |= (enable) << httsym##_S; \
  6227. } while (0)
  6228. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6229. (((word) & httsym##_M) >> httsym##_S)
  6230. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6231. HTT_RX_RING_TLV_ENABLE_SET( \
  6232. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6233. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6234. HTT_RX_RING_TLV_ENABLE_GET( \
  6235. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6236. /**
  6237. * @brief host -> target TX monitor config message
  6238. *
  6239. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6240. *
  6241. * @details
  6242. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6243. * configure RXDMA rings.
  6244. * The configuration is per ring based and includes both packet types
  6245. * and PPDU/MPDU TLVs.
  6246. *
  6247. * The message would appear as follows:
  6248. *
  6249. * |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|
  6250. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6251. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6252. * |-----------+--------+--------+-----+------------------------------------|
  6253. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6254. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6255. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6256. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6257. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6258. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6259. * |------------------------------------------------------------------------|
  6260. * | tlv_filter_mask_in0 |
  6261. * |------------------------------------------------------------------------|
  6262. * | tlv_filter_mask_in1 |
  6263. * |------------------------------------------------------------------------|
  6264. * | tlv_filter_mask_in2 |
  6265. * |------------------------------------------------------------------------|
  6266. * | tlv_filter_mask_in3 |
  6267. * |-----------------+-----------------+---------------------+--------------|
  6268. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6269. * |------------------------------------------------------------------------|
  6270. * | pcu_ppdu_setup_word_mask |
  6271. * |--------------------+--+--+--+-----+---------------------+--------------|
  6272. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6273. * |------------------------------------------------------------------------|
  6274. *
  6275. * Where:
  6276. * PS = pkt_swap
  6277. * SS = status_swap
  6278. * The message is interpreted as follows:
  6279. * dword0 - b'0:7 - msg_type: This will be set to
  6280. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6281. * b'8:15 - pdev_id:
  6282. * 0 (for rings at SOC level),
  6283. * 1/2/3 mac id (for rings at LMAC level)
  6284. * b'16:23 - ring_id : Identify the ring to configure.
  6285. * More details can be got from enum htt_srng_ring_id
  6286. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6287. * BUF_RING_CFG_0 defs within HW .h files,
  6288. * e.g. wmac_top_reg_seq_hwioreg.h
  6289. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6290. * BUF_RING_CFG_0 defs within HW .h files,
  6291. * e.g. wmac_top_reg_seq_hwioreg.h
  6292. * b'26 - tx_mon_global_en: Enable/Disable global register
  6293. * configuration in Tx monitor module.
  6294. * b'27:31 - rsvd1: reserved for future use
  6295. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6296. * in byte units.
  6297. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6298. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6299. * 64, 128, 256.
  6300. * If all 3 bits are set config length is > 256.
  6301. * if val is '0', then ignore this field.
  6302. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6303. * 64, 128, 256.
  6304. * If all 3 bits are set config length is > 256.
  6305. * if val is '0', then ignore this field.
  6306. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6307. * 64, 128, 256.
  6308. * If all 3 bits are set config length is > 256.
  6309. * If val is '0', then ignore this field.
  6310. * - b'25:31 - rsvd2: Reserved for future use
  6311. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6312. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6313. * If packet_type_enable_flags is '1' for MGMT type,
  6314. * monitor will ignore this bit and allow this TLV.
  6315. * If packet_type_enable_flags is '0' for MGMT type,
  6316. * monitor will use this bit to enable/disable logging
  6317. * of this TLV.
  6318. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6319. * If packet_type_enable_flags is '1' for CTRL type,
  6320. * monitor will ignore this bit and allow this TLV.
  6321. * If packet_type_enable_flags is '0' for CTRL type,
  6322. * monitor will use this bit to enable/disable logging
  6323. * of this TLV.
  6324. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6325. * If packet_type_enable_flags is '1' for DATA type,
  6326. * monitor will ignore this bit and allow this TLV.
  6327. * If packet_type_enable_flags is '0' for DATA type,
  6328. * monitor will use this bit to enable/disable logging
  6329. * of this TLV.
  6330. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6331. * If packet_type_enable_flags is '1' for MGMT type,
  6332. * monitor will ignore this bit and allow this TLV.
  6333. * If packet_type_enable_flags is '0' for MGMT type,
  6334. * monitor will use this bit to enable/disable logging
  6335. * of this TLV.
  6336. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6337. * If packet_type_enable_flags is '1' for CTRL type,
  6338. * monitor will ignore this bit and allow this TLV.
  6339. * If packet_type_enable_flags is '0' for CTRL type,
  6340. * monitor will use this bit to enable/disable logging
  6341. * of this TLV.
  6342. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6343. * If packet_type_enable_flags is '1' for DATA type,
  6344. * monitor will ignore this bit and allow this TLV.
  6345. * If packet_type_enable_flags is '0' for DATA type,
  6346. * monitor will use this bit to enable/disable logging
  6347. * of this TLV.
  6348. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6349. * If packet_type_enable_flags is '1' for MGMT type,
  6350. * monitor will ignore this bit and allow this TLV.
  6351. * If packet_type_enable_flags is '0' for MGMT type,
  6352. * monitor will use this bit to enable/disable logging
  6353. * of this TLV.
  6354. * If filter_in_TX_MPDU_START = 1 it is recommended
  6355. * to set this bit.
  6356. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6357. * If packet_type_enable_flags is '1' for CTRL type,
  6358. * monitor will ignore this bit and allow this TLV.
  6359. * If packet_type_enable_flags is '0' for CTRL type,
  6360. * monitor will use this bit to enable/disable logging
  6361. * of this TLV.
  6362. * If filter_in_TX_MPDU_START = 1 it is recommended
  6363. * to set this bit.
  6364. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6365. * If packet_type_enable_flags is '1' for DATA type,
  6366. * monitor will ignore this bit and allow this TLV.
  6367. * If packet_type_enable_flags is '0' for DATA type,
  6368. * monitor will use this bit to enable/disable logging
  6369. * of this TLV.
  6370. * If filter_in_TX_MPDU_START = 1 it is recommended
  6371. * to set this bit.
  6372. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6373. * If packet_type_enable_flags is '1' for MGMT type,
  6374. * monitor will ignore this bit and allow this TLV.
  6375. * If packet_type_enable_flags is '0' for MGMT type,
  6376. * monitor will use this bit to enable/disable logging
  6377. * of this TLV.
  6378. * If filter_in_TX_MSDU_START = 1 it is recommended
  6379. * to set this bit.
  6380. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6381. * If packet_type_enable_flags is '1' for CTRL type,
  6382. * monitor will ignore this bit and allow this TLV.
  6383. * If packet_type_enable_flags is '0' for CTRL type,
  6384. * monitor will use this bit to enable/disable logging
  6385. * of this TLV.
  6386. * If filter_in_TX_MSDU_START = 1 it is recommended
  6387. * to set this bit.
  6388. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6389. * If packet_type_enable_flags is '1' for DATA type,
  6390. * monitor will ignore this bit and allow this TLV.
  6391. * If packet_type_enable_flags is '0' for DATA type,
  6392. * monitor will use this bit to enable/disable logging
  6393. * of this TLV.
  6394. * If filter_in_TX_MSDU_START = 1 it is recommended
  6395. * to set this bit.
  6396. * b'15:31 - rsvd3: Reserved for future use
  6397. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6398. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6399. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6400. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6401. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6402. * - b'8:15 - tx_peer_entry_word_mask:
  6403. * - b'16:23 - tx_queue_ext_word_mask:
  6404. * - b'24:31 - tx_msdu_start_word_mask:
  6405. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6406. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6407. * - b'8:15 - rxpcu_user_setup_word_mask:
  6408. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6409. * MGMT, CTRL, DATA
  6410. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6411. * 0 -> MSDU level logging is enabled
  6412. * (valid only if bit is set in
  6413. * pkt_type_enable_msdu_or_mpdu_logging)
  6414. * 1 -> MPDU level logging is enabled
  6415. * (valid only if bit is set in
  6416. * pkt_type_enable_msdu_or_mpdu_logging)
  6417. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6418. * 0 -> MSDU level logging is enabled
  6419. * (valid only if bit is set in
  6420. * pkt_type_enable_msdu_or_mpdu_logging)
  6421. * 1 -> MPDU level logging is enabled
  6422. * (valid only if bit is set in
  6423. * pkt_type_enable_msdu_or_mpdu_logging)
  6424. * - b'21 - dma_mpdu_data(D) : For DATA
  6425. * 0 -> MSDU level logging is enabled
  6426. * (valid only if bit is set in
  6427. * pkt_type_enable_msdu_or_mpdu_logging)
  6428. * 1 -> MPDU level logging is enabled
  6429. * (valid only if bit is set in
  6430. * pkt_type_enable_msdu_or_mpdu_logging)
  6431. * - b'22:31 - rsvd4 for future use
  6432. */
  6433. PREPACK struct htt_tx_monitor_cfg_t {
  6434. A_UINT32 msg_type: 8,
  6435. pdev_id: 8,
  6436. ring_id: 8,
  6437. status_swap: 1,
  6438. pkt_swap: 1,
  6439. tx_mon_global_en: 1,
  6440. rsvd1: 5;
  6441. A_UINT32 ring_buffer_size: 16,
  6442. config_length_mgmt: 3,
  6443. config_length_ctrl: 3,
  6444. config_length_data: 3,
  6445. rsvd2: 7;
  6446. A_UINT32 pkt_type_enable_flags: 3,
  6447. filter_in_tx_mpdu_start_mgmt: 1,
  6448. filter_in_tx_mpdu_start_ctrl: 1,
  6449. filter_in_tx_mpdu_start_data: 1,
  6450. filter_in_tx_msdu_start_mgmt: 1,
  6451. filter_in_tx_msdu_start_ctrl: 1,
  6452. filter_in_tx_msdu_start_data: 1,
  6453. filter_in_tx_mpdu_end_mgmt: 1,
  6454. filter_in_tx_mpdu_end_ctrl: 1,
  6455. filter_in_tx_mpdu_end_data: 1,
  6456. filter_in_tx_msdu_end_mgmt: 1,
  6457. filter_in_tx_msdu_end_ctrl: 1,
  6458. filter_in_tx_msdu_end_data: 1,
  6459. rsvd3: 17;
  6460. A_UINT32 tlv_filter_mask_in0;
  6461. A_UINT32 tlv_filter_mask_in1;
  6462. A_UINT32 tlv_filter_mask_in2;
  6463. A_UINT32 tlv_filter_mask_in3;
  6464. A_UINT32 tx_fes_setup_word_mask: 8,
  6465. tx_peer_entry_word_mask: 8,
  6466. tx_queue_ext_word_mask: 8,
  6467. tx_msdu_start_word_mask: 8;
  6468. A_UINT32 pcu_ppdu_setup_word_mask;
  6469. A_UINT32 tx_mpdu_start_word_mask: 8,
  6470. rxpcu_user_setup_word_mask: 8,
  6471. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6472. dma_mpdu_mgmt: 1,
  6473. dma_mpdu_ctrl: 1,
  6474. dma_mpdu_data: 1,
  6475. rsvd4: 10;
  6476. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6477. tx_peer_entry_v2_word_mask: 12,
  6478. rsvd5: 10;
  6479. A_UINT32 fes_status_end_word_mask: 16,
  6480. response_end_status_word_mask: 16;
  6481. A_UINT32 fes_status_prot_word_mask: 11,
  6482. rsvd6: 21;
  6483. } POSTPACK;
  6484. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6485. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6486. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6487. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6488. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6489. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6490. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6493. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6494. } while (0)
  6495. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6496. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6497. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6499. HTT_TX_MONITOR_CFG_RING_ID_S)
  6500. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6506. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6507. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6509. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6510. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6516. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6517. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6519. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6520. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6526. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6527. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6529. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6530. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6536. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6537. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6539. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6540. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6546. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6547. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6549. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6550. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6557. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6559. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6560. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6567. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6569. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6570. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6576. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6577. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6579. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6580. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6586. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6587. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6589. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6590. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6597. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6599. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6600. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6607. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6609. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6610. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6619. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6629. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6634. } while (0)
  6635. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6638. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6639. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6643. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6648. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6649. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6653. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6658. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6659. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6663. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6664. } while (0)
  6665. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6668. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6669. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6673. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6674. } while (0)
  6675. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6678. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6679. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6683. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6684. } while (0)
  6685. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6688. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6689. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6691. do { \
  6692. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6693. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6694. } while (0)
  6695. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6698. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6699. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6703. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6704. } while (0)
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6708. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6709. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6713. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6714. } while (0)
  6715. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6716. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6717. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6718. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6719. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6720. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6723. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6724. } while (0)
  6725. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6726. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6727. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6728. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6729. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6730. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6731. do { \
  6732. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6733. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6734. } while (0)
  6735. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6736. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6737. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6738. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6739. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6740. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6743. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6744. } while (0)
  6745. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6746. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6747. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6748. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6749. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6750. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6751. do { \
  6752. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6753. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6754. } while (0)
  6755. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6756. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6757. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6758. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6759. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6760. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6761. do { \
  6762. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6763. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6764. } while (0)
  6765. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6766. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6767. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6768. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6769. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6770. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6771. do { \
  6772. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6773. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6774. } while (0)
  6775. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6776. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6777. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6778. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6779. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6780. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6783. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6784. } while (0)
  6785. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6786. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6787. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6788. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6789. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6790. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6793. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6794. } while (0)
  6795. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6796. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6797. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6798. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6799. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6800. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6803. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6804. } while (0)
  6805. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6806. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6807. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6808. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6809. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6810. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6813. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6814. } while (0)
  6815. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6817. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6818. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6819. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6820. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6821. do { \
  6822. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6823. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6824. } while (0)
  6825. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6826. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6827. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6828. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6829. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6830. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6833. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6834. } while (0)
  6835. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6836. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6837. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6838. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6839. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6840. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6841. do { \
  6842. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6843. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6844. } while (0)
  6845. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6846. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6847. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6848. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6849. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6850. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6851. do { \
  6852. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6853. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6854. } while (0)
  6855. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6856. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6857. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6858. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6859. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6860. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6861. do { \
  6862. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6863. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6864. } while (0)
  6865. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6866. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6867. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6868. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6869. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6870. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6873. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6874. } while (0)
  6875. /*
  6876. * pkt_type_enable_flags
  6877. */
  6878. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6879. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6880. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6881. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6882. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6883. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6884. /*
  6885. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6886. */
  6887. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6888. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6889. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6890. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6891. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6892. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6893. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6894. do { \
  6895. HTT_CHECK_SET_VAL(httsym, value); \
  6896. (word) |= (value) << httsym##_S; \
  6897. } while (0)
  6898. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6899. (((word) & httsym##_M) >> httsym##_S)
  6900. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6901. * type -> MGMT, CTRL, DATA*/
  6902. #define htt_tx_ring_pkt_type_set( \
  6903. word, mode, type, val) \
  6904. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6905. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6906. #define htt_tx_ring_pkt_type_get( \
  6907. word, mode, type) \
  6908. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6909. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6910. /* Definition to filter in TLVs */
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6975. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(httsym, enable); \
  6978. (word) |= (enable) << httsym##_S; \
  6979. } while (0)
  6980. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6981. (((word) & httsym##_M) >> httsym##_S)
  6982. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6983. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6984. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6985. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6986. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6987. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7052. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7053. do { \
  7054. HTT_CHECK_SET_VAL(httsym, enable); \
  7055. (word) |= (enable) << httsym##_S; \
  7056. } while (0)
  7057. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7058. (((word) & httsym##_M) >> httsym##_S)
  7059. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7060. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7061. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7062. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7063. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7064. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7129. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7130. do { \
  7131. HTT_CHECK_SET_VAL(httsym, enable); \
  7132. (word) |= (enable) << httsym##_S; \
  7133. } while (0)
  7134. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7135. (((word) & httsym##_M) >> httsym##_S)
  7136. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7137. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7138. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7139. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7140. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7141. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7186. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7187. do { \
  7188. HTT_CHECK_SET_VAL(httsym, enable); \
  7189. (word) |= (enable) << httsym##_S; \
  7190. } while (0)
  7191. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7192. (((word) & httsym##_M) >> httsym##_S)
  7193. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7194. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7195. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7196. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7197. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7198. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7199. /**
  7200. * @brief host --> target Receive Flow Steering configuration message definition
  7201. *
  7202. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7203. *
  7204. * host --> target Receive Flow Steering configuration message definition.
  7205. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7206. * The reason for this is we want RFS to be configured and ready before MAC
  7207. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7208. *
  7209. * |31 24|23 16|15 9|8|7 0|
  7210. * |----------------+----------------+----------------+----------------|
  7211. * | reserved |E| msg type |
  7212. * |-------------------------------------------------------------------|
  7213. * Where E = RFS enable flag
  7214. *
  7215. * The RFS_CONFIG message consists of a single 4-byte word.
  7216. *
  7217. * Header fields:
  7218. * - MSG_TYPE
  7219. * Bits 7:0
  7220. * Purpose: identifies this as a RFS config msg
  7221. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7222. * - RFS_CONFIG
  7223. * Bit 8
  7224. * Purpose: Tells target whether to enable (1) or disable (0)
  7225. * flow steering feature when sending rx indication messages to host
  7226. */
  7227. #define HTT_H2T_RFS_CONFIG_M 0x100
  7228. #define HTT_H2T_RFS_CONFIG_S 8
  7229. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7230. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7231. HTT_H2T_RFS_CONFIG_S)
  7232. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7235. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7236. } while (0)
  7237. #define HTT_RFS_CFG_REQ_BYTES 4
  7238. /**
  7239. * @brief host -> target FW extended statistics request
  7240. *
  7241. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7242. *
  7243. * @details
  7244. * The following field definitions describe the format of the HTT host
  7245. * to target FW extended stats retrieve message.
  7246. * The message specifies the type of stats the host wants to retrieve.
  7247. *
  7248. * |31 24|23 16|15 8|7 0|
  7249. * |-----------------------------------------------------------|
  7250. * | reserved | stats type | pdev_mask | msg type |
  7251. * |-----------------------------------------------------------|
  7252. * | config param [0] |
  7253. * |-----------------------------------------------------------|
  7254. * | config param [1] |
  7255. * |-----------------------------------------------------------|
  7256. * | config param [2] |
  7257. * |-----------------------------------------------------------|
  7258. * | config param [3] |
  7259. * |-----------------------------------------------------------|
  7260. * | reserved |
  7261. * |-----------------------------------------------------------|
  7262. * | cookie LSBs |
  7263. * |-----------------------------------------------------------|
  7264. * | cookie MSBs |
  7265. * |-----------------------------------------------------------|
  7266. * Header fields:
  7267. * - MSG_TYPE
  7268. * Bits 7:0
  7269. * Purpose: identifies this is a extended stats upload request message
  7270. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7271. * - PDEV_MASK
  7272. * Bits 8:15
  7273. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7274. * Value: This is a overloaded field, refer to usage and interpretation of
  7275. * PDEV in interface document.
  7276. * Bit 8 : Reserved for SOC stats
  7277. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7278. * Indicates MACID_MASK in DBS
  7279. * - STATS_TYPE
  7280. * Bits 23:16
  7281. * Purpose: identifies which FW statistics to upload
  7282. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7283. * - Reserved
  7284. * Bits 31:24
  7285. * - CONFIG_PARAM [0]
  7286. * Bits 31:0
  7287. * Purpose: give an opaque configuration value to the specified stats type
  7288. * Value: stats-type specific configuration value
  7289. * Refer to htt_stats.h for interpretation for each stats sub_type
  7290. * - CONFIG_PARAM [1]
  7291. * Bits 31:0
  7292. * Purpose: give an opaque configuration value to the specified stats type
  7293. * Value: stats-type specific configuration value
  7294. * Refer to htt_stats.h for interpretation for each stats sub_type
  7295. * - CONFIG_PARAM [2]
  7296. * Bits 31:0
  7297. * Purpose: give an opaque configuration value to the specified stats type
  7298. * Value: stats-type specific configuration value
  7299. * Refer to htt_stats.h for interpretation for each stats sub_type
  7300. * - CONFIG_PARAM [3]
  7301. * Bits 31:0
  7302. * Purpose: give an opaque configuration value to the specified stats type
  7303. * Value: stats-type specific configuration value
  7304. * Refer to htt_stats.h for interpretation for each stats sub_type
  7305. * - Reserved [31:0] for future use.
  7306. * - COOKIE_LSBS
  7307. * Bits 31:0
  7308. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7309. * message with its preceding host->target stats request message.
  7310. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7311. * - COOKIE_MSBS
  7312. * Bits 31:0
  7313. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7314. * message with its preceding host->target stats request message.
  7315. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7316. */
  7317. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7318. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7319. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7320. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7321. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7322. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7323. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7324. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7325. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7326. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7327. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7328. do { \
  7329. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7330. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7331. } while (0)
  7332. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7333. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7334. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7335. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7336. do { \
  7337. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7338. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7339. } while (0)
  7340. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7341. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7342. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7343. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7346. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7347. } while (0)
  7348. /**
  7349. * @brief host -> target FW streaming statistics request
  7350. *
  7351. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7352. *
  7353. * @details
  7354. * The following field definitions describe the format of the HTT host
  7355. * to target message that requests the target to start or stop producing
  7356. * ongoing stats of the specified type.
  7357. *
  7358. * |31|30 |23 16|15 8|7 0|
  7359. * |-----------------------------------------------------------|
  7360. * |EN| reserved | stats type | reserved | msg type |
  7361. * |-----------------------------------------------------------|
  7362. * | config param [0] |
  7363. * |-----------------------------------------------------------|
  7364. * | config param [1] |
  7365. * |-----------------------------------------------------------|
  7366. * | config param [2] |
  7367. * |-----------------------------------------------------------|
  7368. * | config param [3] |
  7369. * |-----------------------------------------------------------|
  7370. * Where:
  7371. * - EN is an enable/disable flag
  7372. * Header fields:
  7373. * - MSG_TYPE
  7374. * Bits 7:0
  7375. * Purpose: identifies this is a streaming stats upload request message
  7376. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7377. * - STATS_TYPE
  7378. * Bits 23:16
  7379. * Purpose: identifies which FW statistics to upload
  7380. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7381. * Only the htt_dbg_ext_stats_type values identified as streaming
  7382. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7383. * - ENABLE
  7384. * Bit 31
  7385. * Purpose: enable/disable the target's ongoing stats of the specified type
  7386. * Value:
  7387. * 0 - disable ongoing production of the specified stats type
  7388. * 1 - enable ongoing production of the specified stats type
  7389. * - CONFIG_PARAM [0]
  7390. * Bits 31:0
  7391. * Purpose: give an opaque configuration value to the specified stats type
  7392. * Value: stats-type specific configuration value
  7393. * Refer to htt_stats.h for interpretation for each stats sub_type
  7394. * - CONFIG_PARAM [1]
  7395. * Bits 31:0
  7396. * Purpose: give an opaque configuration value to the specified stats type
  7397. * Value: stats-type specific configuration value
  7398. * Refer to htt_stats.h for interpretation for each stats sub_type
  7399. * - CONFIG_PARAM [2]
  7400. * Bits 31:0
  7401. * Purpose: give an opaque configuration value to the specified stats type
  7402. * Value: stats-type specific configuration value
  7403. * Refer to htt_stats.h for interpretation for each stats sub_type
  7404. * - CONFIG_PARAM [3]
  7405. * Bits 31:0
  7406. * Purpose: give an opaque configuration value to the specified stats type
  7407. * Value: stats-type specific configuration value
  7408. * Refer to htt_stats.h for interpretation for each stats sub_type
  7409. */
  7410. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7411. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7412. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7413. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7414. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7415. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7416. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7417. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7418. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7421. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7422. } while (0)
  7423. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7424. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7425. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7426. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7427. do { \
  7428. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7429. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7430. } while (0)
  7431. /**
  7432. * @brief host -> target FW PPDU_STATS request message
  7433. *
  7434. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7435. *
  7436. * @details
  7437. * The following field definitions describe the format of the HTT host
  7438. * to target FW for PPDU_STATS_CFG msg.
  7439. * The message allows the host to configure the PPDU_STATS_IND messages
  7440. * produced by the target.
  7441. *
  7442. * |31 24|23 16|15 8|7 0|
  7443. * |-----------------------------------------------------------|
  7444. * | REQ bit mask | pdev_mask | msg type |
  7445. * |-----------------------------------------------------------|
  7446. * Header fields:
  7447. * - MSG_TYPE
  7448. * Bits 7:0
  7449. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7450. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7451. * - PDEV_MASK
  7452. * Bits 8:15
  7453. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7454. * Value: This is a overloaded field, refer to usage and interpretation of
  7455. * PDEV in interface document.
  7456. * Bit 8 : Reserved for SOC stats
  7457. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7458. * Indicates MACID_MASK in DBS
  7459. * - REQ_TLV_BIT_MASK
  7460. * Bits 16:31
  7461. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7462. * needs to be included in the target's PPDU_STATS_IND messages.
  7463. * Value: refer htt_ppdu_stats_tlv_tag_t
  7464. *
  7465. */
  7466. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7467. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7468. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7469. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7470. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7471. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7472. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7473. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7474. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7477. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7478. } while (0)
  7479. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7480. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7481. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7482. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7483. do { \
  7484. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7485. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7486. } while (0)
  7487. /**
  7488. * @brief Host-->target HTT RX FSE setup message
  7489. *
  7490. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7491. *
  7492. * @details
  7493. * Through this message, the host will provide details of the flow tables
  7494. * in host DDR along with hash keys.
  7495. * This message can be sent per SOC or per PDEV, which is differentiated
  7496. * by pdev id values.
  7497. * The host will allocate flow search table and sends table size,
  7498. * physical DMA address of flow table, and hash keys to firmware to
  7499. * program into the RXOLE FSE HW block.
  7500. *
  7501. * The following field definitions describe the format of the RX FSE setup
  7502. * message sent from the host to target
  7503. *
  7504. * Header fields:
  7505. * dword0 - b'7:0 - msg_type: This will be set to
  7506. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7507. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7508. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7509. * pdev's LMAC ring.
  7510. * b'31:16 - reserved : Reserved for future use
  7511. * dword1 - b'19:0 - number of records: This field indicates the number of
  7512. * entries in the flow table. For example: 8k number of
  7513. * records is equivalent to
  7514. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7515. * b'27:20 - max search: This field specifies the skid length to FSE
  7516. * parser HW module whenever match is not found at the
  7517. * exact index pointed by hash.
  7518. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7519. * Refer htt_ip_da_sa_prefix below for more details.
  7520. * b'31:30 - reserved: Reserved for future use
  7521. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7522. * table allocated by host in DDR
  7523. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7524. * table allocated by host in DDR
  7525. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7526. * entry hashing
  7527. *
  7528. *
  7529. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7530. * |---------------------------------------------------------------|
  7531. * | reserved | pdev_id | MSG_TYPE |
  7532. * |---------------------------------------------------------------|
  7533. * |resvd|IPDSA| max_search | Number of records |
  7534. * |---------------------------------------------------------------|
  7535. * | base address lo |
  7536. * |---------------------------------------------------------------|
  7537. * | base address high |
  7538. * |---------------------------------------------------------------|
  7539. * | toeplitz key 31_0 |
  7540. * |---------------------------------------------------------------|
  7541. * | toeplitz key 63_32 |
  7542. * |---------------------------------------------------------------|
  7543. * | toeplitz key 95_64 |
  7544. * |---------------------------------------------------------------|
  7545. * | toeplitz key 127_96 |
  7546. * |---------------------------------------------------------------|
  7547. * | toeplitz key 159_128 |
  7548. * |---------------------------------------------------------------|
  7549. * | toeplitz key 191_160 |
  7550. * |---------------------------------------------------------------|
  7551. * | toeplitz key 223_192 |
  7552. * |---------------------------------------------------------------|
  7553. * | toeplitz key 255_224 |
  7554. * |---------------------------------------------------------------|
  7555. * | toeplitz key 287_256 |
  7556. * |---------------------------------------------------------------|
  7557. * | reserved | toeplitz key 314_288(26:0 bits) |
  7558. * |---------------------------------------------------------------|
  7559. * where:
  7560. * IPDSA = ip_da_sa
  7561. */
  7562. /**
  7563. * @brief: htt_ip_da_sa_prefix
  7564. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7565. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7566. * documentation per RFC3849
  7567. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7568. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7569. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7570. */
  7571. enum htt_ip_da_sa_prefix {
  7572. HTT_RX_IPV6_20010db8,
  7573. HTT_RX_IPV4_MAPPED_IPV6,
  7574. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7575. HTT_RX_IPV6_64FF9B,
  7576. };
  7577. /**
  7578. * @brief Host-->target HTT RX FISA configure and enable
  7579. *
  7580. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7581. *
  7582. * @details
  7583. * The host will send this command down to configure and enable the FISA
  7584. * operational params.
  7585. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7586. * register.
  7587. * Should configure both the MACs.
  7588. *
  7589. * dword0 - b'7:0 - msg_type:
  7590. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7591. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7592. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7593. * pdev's LMAC ring.
  7594. * b'31:16 - reserved : Reserved for future use
  7595. *
  7596. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7597. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7598. * packets. 1 flow search will be skipped
  7599. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7600. * tcp,udp packets
  7601. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7602. * calculation
  7603. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7604. * calculation
  7605. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7606. * calculation
  7607. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7608. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7609. * length
  7610. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7611. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7612. * length
  7613. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7614. * num jump
  7615. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7616. * num jump
  7617. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7618. * data type switch has happened for MPDU Sequence num jump
  7619. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7620. * for MPDU Sequence num jump
  7621. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7622. * for decrypt errors
  7623. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7624. * while aggregating a msdu
  7625. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7626. * The aggregation is done until (number of MSDUs aggregated
  7627. * < LIMIT + 1)
  7628. * b'31:18 - Reserved
  7629. *
  7630. * fisa_control_value - 32bit value FW can write to register
  7631. *
  7632. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7633. * Threshold value for FISA timeout (units are microseconds).
  7634. * When the global timestamp exceeds this threshold, FISA
  7635. * aggregation will be restarted.
  7636. * A value of 0 means timeout is disabled.
  7637. * Compare the threshold register with timestamp field in
  7638. * flow entry to generate timeout for the flow.
  7639. *
  7640. * |31 18 |17 16|15 8|7 0|
  7641. * |-------------------------------------------------------------|
  7642. * | reserved | pdev_mask | msg type |
  7643. * |-------------------------------------------------------------|
  7644. * | reserved | FISA_CTRL |
  7645. * |-------------------------------------------------------------|
  7646. * | FISA_TIMEOUT_THRESH |
  7647. * |-------------------------------------------------------------|
  7648. */
  7649. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7650. A_UINT32 msg_type:8,
  7651. pdev_id:8,
  7652. reserved0:16;
  7653. /**
  7654. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7655. * [17:0]
  7656. */
  7657. union {
  7658. /*
  7659. * fisa_control_bits structure is deprecated.
  7660. * Please use fisa_control_bits_v2 going forward.
  7661. */
  7662. struct {
  7663. A_UINT32 fisa_enable: 1,
  7664. ipsec_skip_search: 1,
  7665. nontcp_skip_search: 1,
  7666. add_ipv4_fixed_hdr_len: 1,
  7667. add_ipv6_fixed_hdr_len: 1,
  7668. add_tcp_fixed_hdr_len: 1,
  7669. add_udp_hdr_len: 1,
  7670. chksum_cum_ip_len_en: 1,
  7671. disable_tid_check: 1,
  7672. disable_ta_check: 1,
  7673. disable_qos_check: 1,
  7674. disable_raw_check: 1,
  7675. disable_decrypt_err_check: 1,
  7676. disable_msdu_drop_check: 1,
  7677. fisa_aggr_limit: 4,
  7678. reserved: 14;
  7679. } fisa_control_bits;
  7680. struct {
  7681. A_UINT32 fisa_enable: 1,
  7682. fisa_aggr_limit: 4,
  7683. reserved: 27;
  7684. } fisa_control_bits_v2;
  7685. A_UINT32 fisa_control_value;
  7686. } u_fisa_control;
  7687. /**
  7688. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7689. * timeout threshold for aggregation. Unit in usec.
  7690. * [31:0]
  7691. */
  7692. A_UINT32 fisa_timeout_threshold;
  7693. } POSTPACK;
  7694. /* DWord 0: pdev-ID */
  7695. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7696. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7697. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7698. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7699. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7700. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7701. do { \
  7702. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7703. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7704. } while (0)
  7705. /* Dword 1: fisa_control_value fisa config */
  7706. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7707. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7708. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7709. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7710. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7711. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7712. do { \
  7713. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7714. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7715. } while (0)
  7716. /* Dword 1: fisa_control_value ipsec_skip_search */
  7717. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7718. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7719. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7720. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7721. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7722. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7725. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7726. } while (0)
  7727. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7728. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7729. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7730. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7731. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7732. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7733. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7736. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7737. } while (0)
  7738. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7739. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7740. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7741. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7742. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7743. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7744. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7745. do { \
  7746. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7747. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7748. } while (0)
  7749. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7750. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7751. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7752. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7753. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7754. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7755. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7756. do { \
  7757. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7758. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7759. } while (0)
  7760. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7761. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7762. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7763. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7764. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7765. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7766. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7767. do { \
  7768. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7769. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7770. } while (0)
  7771. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7772. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7773. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7774. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7775. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7776. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7777. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7778. do { \
  7779. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7780. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7781. } while (0)
  7782. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7783. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7784. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7785. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7786. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7787. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7788. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7791. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7792. } while (0)
  7793. /* Dword 1: fisa_control_value disable_tid_check */
  7794. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7795. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7796. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7797. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7798. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7799. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7800. do { \
  7801. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7802. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7803. } while (0)
  7804. /* Dword 1: fisa_control_value disable_ta_check */
  7805. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7806. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7807. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7808. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7809. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7810. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7811. do { \
  7812. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7813. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7814. } while (0)
  7815. /* Dword 1: fisa_control_value disable_qos_check */
  7816. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7817. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7818. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7819. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7820. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7821. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7822. do { \
  7823. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7824. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7825. } while (0)
  7826. /* Dword 1: fisa_control_value disable_raw_check */
  7827. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7828. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7829. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7830. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7831. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7832. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7833. do { \
  7834. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7835. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7836. } while (0)
  7837. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7838. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7840. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7841. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7842. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7843. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7844. do { \
  7845. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7846. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7847. } while (0)
  7848. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7849. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7851. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7852. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7853. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7854. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7855. do { \
  7856. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7857. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7858. } while (0)
  7859. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7860. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7861. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7862. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7863. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7864. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7865. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7866. do { \
  7867. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7868. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7869. } while (0)
  7870. /* Dword 1: fisa_control_value fisa config */
  7871. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7872. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7873. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7874. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7875. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7876. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7877. do { \
  7878. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7879. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7880. } while (0)
  7881. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7882. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7883. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7884. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7885. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7886. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7887. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7890. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7891. } while (0)
  7892. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7893. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7894. pdev_id:8,
  7895. reserved0:16;
  7896. A_UINT32 num_records:20,
  7897. max_search:8,
  7898. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7899. reserved1:2;
  7900. A_UINT32 base_addr_lo;
  7901. A_UINT32 base_addr_hi;
  7902. A_UINT32 toeplitz31_0;
  7903. A_UINT32 toeplitz63_32;
  7904. A_UINT32 toeplitz95_64;
  7905. A_UINT32 toeplitz127_96;
  7906. A_UINT32 toeplitz159_128;
  7907. A_UINT32 toeplitz191_160;
  7908. A_UINT32 toeplitz223_192;
  7909. A_UINT32 toeplitz255_224;
  7910. A_UINT32 toeplitz287_256;
  7911. A_UINT32 toeplitz314_288:27,
  7912. reserved2:5;
  7913. } POSTPACK;
  7914. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7915. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7916. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7917. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7918. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7919. /* DWORD 0: Pdev ID */
  7920. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7921. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7922. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7923. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7924. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7925. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7926. do { \
  7927. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7928. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7929. } while (0)
  7930. /* DWORD 1:num of records */
  7931. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7932. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7933. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7934. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7935. HTT_RX_FSE_SETUP_NUM_REC_S)
  7936. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7937. do { \
  7938. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7939. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7940. } while (0)
  7941. /* DWORD 1:max_search */
  7942. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7943. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7944. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7945. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7946. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7947. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7948. do { \
  7949. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7950. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7951. } while (0)
  7952. /* DWORD 1:ip_da_sa prefix */
  7953. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7954. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7955. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7956. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7957. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7958. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7959. do { \
  7960. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7961. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7962. } while (0)
  7963. /* DWORD 2: Base Address LO */
  7964. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7965. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7966. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7967. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7968. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7969. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7972. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7973. } while (0)
  7974. /* DWORD 3: Base Address High */
  7975. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7976. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7977. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7978. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7979. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7980. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7981. do { \
  7982. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7983. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7984. } while (0)
  7985. /* DWORD 4-12: Hash Value */
  7986. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7987. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7988. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7989. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7990. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7991. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7992. do { \
  7993. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7994. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7995. } while (0)
  7996. /* DWORD 13: Hash Value 314:288 bits */
  7997. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7998. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7999. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8000. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8003. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8004. } while (0)
  8005. /**
  8006. * @brief Host-->target HTT RX FSE operation message
  8007. *
  8008. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8009. *
  8010. * @details
  8011. * The host will send this Flow Search Engine (FSE) operation message for
  8012. * every flow add/delete operation.
  8013. * The FSE operation includes FSE full cache invalidation or individual entry
  8014. * invalidation.
  8015. * This message can be sent per SOC or per PDEV which is differentiated
  8016. * by pdev id values.
  8017. *
  8018. * |31 16|15 8|7 1|0|
  8019. * |-------------------------------------------------------------|
  8020. * | reserved | pdev_id | MSG_TYPE |
  8021. * |-------------------------------------------------------------|
  8022. * | reserved | operation |I|
  8023. * |-------------------------------------------------------------|
  8024. * | ip_src_addr_31_0 |
  8025. * |-------------------------------------------------------------|
  8026. * | ip_src_addr_63_32 |
  8027. * |-------------------------------------------------------------|
  8028. * | ip_src_addr_95_64 |
  8029. * |-------------------------------------------------------------|
  8030. * | ip_src_addr_127_96 |
  8031. * |-------------------------------------------------------------|
  8032. * | ip_dst_addr_31_0 |
  8033. * |-------------------------------------------------------------|
  8034. * | ip_dst_addr_63_32 |
  8035. * |-------------------------------------------------------------|
  8036. * | ip_dst_addr_95_64 |
  8037. * |-------------------------------------------------------------|
  8038. * | ip_dst_addr_127_96 |
  8039. * |-------------------------------------------------------------|
  8040. * | l4_dst_port | l4_src_port |
  8041. * | (32-bit SPI incase of IPsec) |
  8042. * |-------------------------------------------------------------|
  8043. * | reserved | l4_proto |
  8044. * |-------------------------------------------------------------|
  8045. *
  8046. * where I is 1-bit ipsec_valid.
  8047. *
  8048. * The following field definitions describe the format of the RX FSE operation
  8049. * message sent from the host to target for every add/delete flow entry to flow
  8050. * table.
  8051. *
  8052. * Header fields:
  8053. * dword0 - b'7:0 - msg_type: This will be set to
  8054. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8055. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8056. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8057. * specified pdev's LMAC ring.
  8058. * b'31:16 - reserved : Reserved for future use
  8059. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8060. * (Internet Protocol Security).
  8061. * IPsec describes the framework for providing security at
  8062. * IP layer. IPsec is defined for both versions of IP:
  8063. * IPV4 and IPV6.
  8064. * Please refer to htt_rx_flow_proto enumeration below for
  8065. * more info.
  8066. * ipsec_valid = 1 for IPSEC packets
  8067. * ipsec_valid = 0 for IP Packets
  8068. * b'7:1 - operation: This indicates types of FSE operation.
  8069. * Refer to htt_rx_fse_operation enumeration:
  8070. * 0 - No Cache Invalidation required
  8071. * 1 - Cache invalidate only one entry given by IP
  8072. * src/dest address at DWORD[2:9]
  8073. * 2 - Complete FSE Cache Invalidation
  8074. * 3 - FSE Disable
  8075. * 4 - FSE Enable
  8076. * b'31:8 - reserved: Reserved for future use
  8077. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8078. * for per flow addition/deletion
  8079. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8080. * and the subsequent 3 A_UINT32 will be padding bytes.
  8081. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8082. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8083. * from 0 to 65535 but only 0 to 1023 are designated as
  8084. * well-known ports. Refer to [RFC1700] for more details.
  8085. * This field is valid only if
  8086. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8087. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8088. * range from 0 to 65535 but only 0 to 1023 are designated
  8089. * as well-known ports. Refer to [RFC1700] for more details.
  8090. * This field is valid only if
  8091. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8092. * - SPI (31:0): Security Parameters Index is an
  8093. * identification tag added to the header while using IPsec
  8094. * for tunneling the IP traffici.
  8095. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8096. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8097. * Assigned Internet Protocol Numbers.
  8098. * l4_proto numbers for standard protocol like UDP/TCP
  8099. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8100. * l4_proto = 17 for UDP etc.
  8101. * b'31:8 - reserved: Reserved for future use.
  8102. *
  8103. */
  8104. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8105. A_UINT32 msg_type:8,
  8106. pdev_id:8,
  8107. reserved0:16;
  8108. A_UINT32 ipsec_valid:1,
  8109. operation:7,
  8110. reserved1:24;
  8111. A_UINT32 ip_src_addr_31_0;
  8112. A_UINT32 ip_src_addr_63_32;
  8113. A_UINT32 ip_src_addr_95_64;
  8114. A_UINT32 ip_src_addr_127_96;
  8115. A_UINT32 ip_dest_addr_31_0;
  8116. A_UINT32 ip_dest_addr_63_32;
  8117. A_UINT32 ip_dest_addr_95_64;
  8118. A_UINT32 ip_dest_addr_127_96;
  8119. union {
  8120. A_UINT32 spi;
  8121. struct {
  8122. A_UINT32 l4_src_port:16,
  8123. l4_dest_port:16;
  8124. } ip;
  8125. } u;
  8126. A_UINT32 l4_proto:8,
  8127. reserved:24;
  8128. } POSTPACK;
  8129. /**
  8130. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8131. *
  8132. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8133. *
  8134. * @details
  8135. * The host will send this Full monitor mode register configuration message.
  8136. * This message can be sent per SOC or per PDEV which is differentiated
  8137. * by pdev id values.
  8138. *
  8139. * |31 16|15 11|10 8|7 3|2|1|0|
  8140. * |-------------------------------------------------------------|
  8141. * | reserved | pdev_id | MSG_TYPE |
  8142. * |-------------------------------------------------------------|
  8143. * | reserved |Release Ring |N|Z|E|
  8144. * |-------------------------------------------------------------|
  8145. *
  8146. * where E is 1-bit full monitor mode enable/disable.
  8147. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8148. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8149. *
  8150. * The following field definitions describe the format of the full monitor
  8151. * mode configuration message sent from the host to target for each pdev.
  8152. *
  8153. * Header fields:
  8154. * dword0 - b'7:0 - msg_type: This will be set to
  8155. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8156. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8157. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8158. * specified pdev's LMAC ring.
  8159. * b'31:16 - reserved : Reserved for future use.
  8160. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8161. * monitor mode rxdma register is to be enabled or disabled.
  8162. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8163. * additional descriptors at ppdu end for zero mpdus
  8164. * enabled or disabled.
  8165. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8166. * additional descriptors at ppdu end for non zero mpdus
  8167. * enabled or disabled.
  8168. * b'10:3 - release_ring: This indicates the destination ring
  8169. * selection for the descriptor at the end of PPDU
  8170. * 0 - REO ring select
  8171. * 1 - FW ring select
  8172. * 2 - SW ring select
  8173. * 3 - Release ring select
  8174. * Refer to htt_rx_full_mon_release_ring.
  8175. * b'31:11 - reserved for future use
  8176. */
  8177. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8178. A_UINT32 msg_type:8,
  8179. pdev_id:8,
  8180. reserved0:16;
  8181. A_UINT32 full_monitor_mode_enable:1,
  8182. addnl_descs_zero_mpdus_end:1,
  8183. addnl_descs_non_zero_mpdus_end:1,
  8184. release_ring:8,
  8185. reserved1:21;
  8186. } POSTPACK;
  8187. /**
  8188. * Enumeration for full monitor mode destination ring select
  8189. * 0 - REO destination ring select
  8190. * 1 - FW destination ring select
  8191. * 2 - SW destination ring select
  8192. * 3 - Release destination ring select
  8193. */
  8194. enum htt_rx_full_mon_release_ring {
  8195. HTT_RX_MON_RING_REO,
  8196. HTT_RX_MON_RING_FW,
  8197. HTT_RX_MON_RING_SW,
  8198. HTT_RX_MON_RING_RELEASE,
  8199. };
  8200. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8201. /* DWORD 0: Pdev ID */
  8202. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8203. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8204. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8205. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8206. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8207. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8208. do { \
  8209. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8210. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8211. } while (0)
  8212. /* DWORD 1:ENABLE */
  8213. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8214. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8215. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8216. do { \
  8217. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8218. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8219. } while (0)
  8220. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8221. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8222. /* DWORD 1:ZERO_MPDU */
  8223. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8224. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8225. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8226. do { \
  8227. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8228. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8229. } while (0)
  8230. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8231. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8232. /* DWORD 1:NON_ZERO_MPDU */
  8233. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8234. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8235. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8236. do { \
  8237. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8238. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8239. } while (0)
  8240. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8241. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8242. /* DWORD 1:RELEASE_RINGS */
  8243. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8244. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8245. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8246. do { \
  8247. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8248. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8249. } while (0)
  8250. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8251. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8252. /**
  8253. * Enumeration for IP Protocol or IPSEC Protocol
  8254. * IPsec describes the framework for providing security at IP layer.
  8255. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8256. */
  8257. enum htt_rx_flow_proto {
  8258. HTT_RX_FLOW_IP_PROTO,
  8259. HTT_RX_FLOW_IPSEC_PROTO,
  8260. };
  8261. /**
  8262. * Enumeration for FSE Cache Invalidation
  8263. * 0 - No Cache Invalidation required
  8264. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8265. * 2 - Complete FSE Cache Invalidation
  8266. * 3 - FSE Disable
  8267. * 4 - FSE Enable
  8268. */
  8269. enum htt_rx_fse_operation {
  8270. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8271. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8272. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8273. HTT_RX_FSE_DISABLE,
  8274. HTT_RX_FSE_ENABLE,
  8275. };
  8276. /* DWORD 0: Pdev ID */
  8277. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8278. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8279. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8280. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8281. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8282. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8283. do { \
  8284. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8285. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8286. } while (0)
  8287. /* DWORD 1:IP PROTO or IPSEC */
  8288. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8289. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8290. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8293. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8294. } while (0)
  8295. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8296. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8297. /* DWORD 1:FSE Operation */
  8298. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8299. #define HTT_RX_FSE_OPERATION_S 1
  8300. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8301. do { \
  8302. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8303. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8304. } while (0)
  8305. #define HTT_RX_FSE_OPERATION_GET(word) \
  8306. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8307. /* DWORD 2-9:IP Address */
  8308. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8309. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8310. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8311. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8312. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8313. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8314. do { \
  8315. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8316. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8317. } while (0)
  8318. /* DWORD 10:Source Port Number */
  8319. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8320. #define HTT_RX_FSE_SOURCEPORT_S 0
  8321. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8322. do { \
  8323. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8324. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8325. } while (0)
  8326. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8327. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8328. /* DWORD 11:Destination Port Number */
  8329. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8330. #define HTT_RX_FSE_DESTPORT_S 16
  8331. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8334. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8335. } while (0)
  8336. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8337. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8338. /* DWORD 10-11:SPI (In case of IPSEC) */
  8339. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8340. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8341. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8342. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8343. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8344. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8345. do { \
  8346. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8347. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8348. } while (0)
  8349. /* DWORD 12:L4 PROTO */
  8350. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8351. #define HTT_RX_FSE_L4_PROTO_S 0
  8352. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8353. do { \
  8354. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8355. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8356. } while (0)
  8357. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8358. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8359. /**
  8360. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8361. *
  8362. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8363. *
  8364. * |31 24|23 |15 8|7 2|1|0|
  8365. * |----------------+----------------+----------------+----------------|
  8366. * | reserved | pdev_id | msg_type |
  8367. * |---------------------------------+----------------+----------------|
  8368. * | reserved |E|F|
  8369. * |---------------------------------+----------------+----------------|
  8370. * Where E = Configure the target to provide the 3-tuple hash value in
  8371. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8372. * F = Configure the target to provide the 3-tuple hash value in
  8373. * flow_id_toeplitz field of rx_msdu_start tlv
  8374. *
  8375. * The following field definitions describe the format of the 3 tuple hash value
  8376. * message sent from the host to target as part of initialization sequence.
  8377. *
  8378. * Header fields:
  8379. * dword0 - b'7:0 - msg_type: This will be set to
  8380. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8381. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8382. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8383. * specified pdev's LMAC ring.
  8384. * b'31:16 - reserved : Reserved for future use
  8385. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8386. * b'1 - toeplitz_hash_2_or_4_field_enable
  8387. * b'31:2 - reserved : Reserved for future use
  8388. * ---------+------+----------------------------------------------------------
  8389. * bit1 | bit0 | Functionality
  8390. * ---------+------+----------------------------------------------------------
  8391. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8392. * | | in flow_id_toeplitz field
  8393. * ---------+------+----------------------------------------------------------
  8394. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8395. * | | in toeplitz_hash_2_or_4 field
  8396. * ---------+------+----------------------------------------------------------
  8397. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8398. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8399. * ---------+------+----------------------------------------------------------
  8400. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8401. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8402. * | | toeplitz_hash_2_or_4 field
  8403. *----------------------------------------------------------------------------
  8404. */
  8405. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8406. A_UINT32 msg_type :8,
  8407. pdev_id :8,
  8408. reserved0 :16;
  8409. A_UINT32 flow_id_toeplitz_field_enable :1,
  8410. toeplitz_hash_2_or_4_field_enable :1,
  8411. reserved1 :30;
  8412. } POSTPACK;
  8413. /* DWORD0 : pdev_id configuration Macros */
  8414. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8415. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8416. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8417. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8418. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8419. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8420. do { \
  8421. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8422. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8423. } while (0)
  8424. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8425. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8426. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8427. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8428. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8429. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8430. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8433. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8434. } while (0)
  8435. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8436. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8437. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8438. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8439. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8440. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8441. do { \
  8442. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8443. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8444. } while (0)
  8445. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8446. /**
  8447. * @brief host --> target Host PA Address Size
  8448. *
  8449. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8450. *
  8451. * @details
  8452. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8453. * provide the physical start address and size of each of the memory
  8454. * areas within host DDR that the target FW may need to access.
  8455. *
  8456. * For example, the host can use this message to allow the target FW
  8457. * to set up access to the host's pools of TQM link descriptors.
  8458. * The message would appear as follows:
  8459. *
  8460. * |31 24|23 16|15 8|7 0|
  8461. * |----------------+----------------+----------------+----------------|
  8462. * | reserved | num_entries | msg_type |
  8463. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8464. * | mem area 0 size |
  8465. * |----------------+----------------+----------------+----------------|
  8466. * | mem area 0 physical_address_lo |
  8467. * |----------------+----------------+----------------+----------------|
  8468. * | mem area 0 physical_address_hi |
  8469. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8470. * | mem area 1 size |
  8471. * |----------------+----------------+----------------+----------------|
  8472. * | mem area 1 physical_address_lo |
  8473. * |----------------+----------------+----------------+----------------|
  8474. * | mem area 1 physical_address_hi |
  8475. * |----------------+----------------+----------------+----------------|
  8476. * ...
  8477. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8478. * | mem area N size |
  8479. * |----------------+----------------+----------------+----------------|
  8480. * | mem area N physical_address_lo |
  8481. * |----------------+----------------+----------------+----------------|
  8482. * | mem area N physical_address_hi |
  8483. * |----------------+----------------+----------------+----------------|
  8484. *
  8485. * The message is interpreted as follows:
  8486. * dword0 - b'0:7 - msg_type: This will be set to
  8487. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8488. * b'8:15 - number_entries: Indicated the number of host memory
  8489. * areas specified within the remainder of the message
  8490. * b'16:31 - reserved.
  8491. * dword1 - b'0:31 - memory area 0 size in bytes
  8492. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8493. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8494. * and similar for memory area 1 through memory area N.
  8495. */
  8496. PREPACK struct htt_h2t_host_paddr_size {
  8497. A_UINT32 msg_type: 8,
  8498. num_entries: 8,
  8499. reserved: 16;
  8500. } POSTPACK;
  8501. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8502. A_UINT32 size;
  8503. A_UINT32 physical_address_lo;
  8504. A_UINT32 physical_address_hi;
  8505. } POSTPACK;
  8506. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8507. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8508. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8509. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8510. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8511. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8512. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8513. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8514. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8515. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8516. do { \
  8517. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8518. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8519. } while (0)
  8520. /**
  8521. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8522. *
  8523. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8524. *
  8525. * @details
  8526. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8527. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8528. *
  8529. * The message would appear as follows:
  8530. *
  8531. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8532. * |---------------------------------+---+---+----------+-+-----------|
  8533. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8534. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8535. *
  8536. *
  8537. * The message is interpreted as follows:
  8538. * dword0 - b'0:7 - msg_type: This will be set to
  8539. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8540. * b'8 - override bit to drive MSDUs to PPE ring
  8541. * b'9:13 - REO destination ring indication
  8542. * b'14 - Multi buffer msdu override enable bit
  8543. * b'15 - Intra BSS override
  8544. * b'16 - Decap raw override
  8545. * b'17 - Decap Native wifi override
  8546. * b'18 - IP frag override
  8547. * b'19:31 - reserved
  8548. */
  8549. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8550. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8551. override: 1,
  8552. reo_destination_indication: 5,
  8553. multi_buffer_msdu_override_en: 1,
  8554. intra_bss_override: 1,
  8555. decap_raw_override: 1,
  8556. decap_nwifi_override: 1,
  8557. ip_frag_override: 1,
  8558. reserved: 13;
  8559. } POSTPACK;
  8560. /* DWORD 0: Override */
  8561. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8562. #define HTT_PPE_CFG_OVERRIDE_S 8
  8563. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8564. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8565. HTT_PPE_CFG_OVERRIDE_S)
  8566. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8569. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8570. } while (0)
  8571. /* DWORD 0: REO Destination Indication*/
  8572. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8573. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8574. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8575. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8576. HTT_PPE_CFG_REO_DEST_IND_S)
  8577. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8578. do { \
  8579. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8580. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8581. } while (0)
  8582. /* DWORD 0: Multi buffer MSDU override */
  8583. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8584. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8585. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8586. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8587. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8588. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8589. do { \
  8590. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8591. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8592. } while (0)
  8593. /* DWORD 0: Intra BSS override */
  8594. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8595. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8596. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8597. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8598. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8599. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8602. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8603. } while (0)
  8604. /* DWORD 0: Decap RAW override */
  8605. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8606. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8607. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8608. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8609. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8610. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8613. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8614. } while (0)
  8615. /* DWORD 0: Decap NWIFI override */
  8616. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8617. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8618. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8619. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8620. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8621. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8624. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8625. } while (0)
  8626. /* DWORD 0: IP frag override */
  8627. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8628. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8629. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8630. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8631. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8632. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8635. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8636. } while (0)
  8637. /*
  8638. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8639. *
  8640. * @details
  8641. * The following field definitions describe the format of the HTT host
  8642. * to target FW VDEV TX RX stats retrieve message.
  8643. * The message specifies the type of stats the host wants to retrieve.
  8644. *
  8645. * |31 27|26 25|24 17|16|15 8|7 0|
  8646. * |-----------------------------------------------------------|
  8647. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8648. * |-----------------------------------------------------------|
  8649. * | vdev_id lower bitmask |
  8650. * |-----------------------------------------------------------|
  8651. * | vdev_id upper bitmask |
  8652. * |-----------------------------------------------------------|
  8653. * Header fields:
  8654. * Where:
  8655. * dword0 - b'7:0 - msg_type: This will be set to
  8656. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8657. * b'15:8 - pdev id
  8658. * b'16(E) - Enable/Disable the vdev HW stats
  8659. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8660. * b'25:26(R) - Reset stats bits
  8661. * 0: don't reset stats
  8662. * 1: reset stats once
  8663. * 2: reset stats at the start of each periodic interval
  8664. * b'27:31 - reserved for future use
  8665. * dword1 - b'0:31 - vdev_id lower bitmask
  8666. * dword2 - b'0:31 - vdev_id upper bitmask
  8667. */
  8668. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8669. A_UINT32 msg_type :8,
  8670. pdev_id :8,
  8671. enable :1,
  8672. periodic_interval :8,
  8673. reset_stats_bits :2,
  8674. reserved0 :5;
  8675. A_UINT32 vdev_id_lower_bitmask;
  8676. A_UINT32 vdev_id_upper_bitmask;
  8677. } POSTPACK;
  8678. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8679. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8680. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8681. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8682. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8683. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8684. do { \
  8685. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8686. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8687. } while (0)
  8688. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8689. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8690. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8691. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8692. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8693. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8694. do { \
  8695. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8696. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8697. } while (0)
  8698. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8699. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8700. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8701. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8702. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8703. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8706. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8707. } while (0)
  8708. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8709. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8710. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8711. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8712. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8713. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8714. do { \
  8715. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8716. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8717. } while (0)
  8718. /*
  8719. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8720. *
  8721. * @details
  8722. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8723. * the default MSDU queues for one of the TIDs within the specified peer
  8724. * to the specified service class.
  8725. * The TID is indirectly specified - each service class is associated
  8726. * with a TID. All default MSDU queues for this peer-TID will be
  8727. * linked to the service class in question.
  8728. *
  8729. * |31 16|15 8|7 0|
  8730. * |------------------------------+--------------+--------------|
  8731. * | peer ID | svc class ID | msg type |
  8732. * |------------------------------------------------------------|
  8733. * Header fields:
  8734. * dword0 - b'7:0 - msg_type: This will be set to
  8735. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8736. * b'15:8 - service class ID
  8737. * b'31:16 - peer ID
  8738. */
  8739. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8740. A_UINT32 msg_type :8,
  8741. svc_class_id :8,
  8742. peer_id :16;
  8743. } POSTPACK;
  8744. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8745. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8746. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8747. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8748. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8749. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8750. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8751. do { \
  8752. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8753. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8754. } while (0)
  8755. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8756. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8757. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8758. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8759. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8760. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8761. do { \
  8762. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8763. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8764. } while (0)
  8765. /*
  8766. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8767. *
  8768. * @details
  8769. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8770. * remove the linkage of the specified peer-TID's MSDU queues to
  8771. * service classes.
  8772. *
  8773. * |31 16|15 8|7 0|
  8774. * |------------------------------+--------------+--------------|
  8775. * | peer ID | svc class ID | msg type |
  8776. * |------------------------------------------------------------|
  8777. * Header fields:
  8778. * dword0 - b'7:0 - msg_type: This will be set to
  8779. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8780. * b'15:8 - service class ID
  8781. * b'31:16 - peer ID
  8782. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8783. * value for peer ID indicates that the target should
  8784. * apply the UNMAP_REQ to all peers.
  8785. */
  8786. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8787. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8788. A_UINT32 msg_type :8,
  8789. svc_class_id :8,
  8790. peer_id :16;
  8791. } POSTPACK;
  8792. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8793. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8794. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8795. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8796. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8797. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8798. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8799. do { \
  8800. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8801. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8802. } while (0)
  8803. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8804. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8805. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8806. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8807. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8808. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8809. do { \
  8810. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8811. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8812. } while (0)
  8813. /*
  8814. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8815. *
  8816. * @details
  8817. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8818. * request the target to report what service class the default MSDU queues
  8819. * of the specified TIDs within the peer are linked to.
  8820. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8821. * to report what service class (if any) the default MSDU queues for
  8822. * each of the specified TIDs are linked to.
  8823. *
  8824. * |31 16|15 8|7 1| 0|
  8825. * |------------------------------+--------------+--------------|
  8826. * | peer ID | TID mask | msg type |
  8827. * |------------------------------------------------------------|
  8828. * | reserved |ETO|
  8829. * |------------------------------------------------------------|
  8830. * Header fields:
  8831. * dword0 - b'7:0 - msg_type: This will be set to
  8832. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8833. * b'15:8 - TID mask
  8834. * b'31:16 - peer ID
  8835. * dword1 - b'0 - "Existing Tids Only" flag
  8836. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8837. * message generated by this REQ will only show the
  8838. * mapping for TIDs that actually exist in the target's
  8839. * peer object.
  8840. * Any TIDs that are covered by a MAP_REQ but which
  8841. * do not actually exist will be shown as being
  8842. * unmapped (i.e. svc class ID 0xff).
  8843. * If this flag is cleared, the MAP_REPORT_CONF message
  8844. * will consider not only the mapping of TIDs currently
  8845. * existing in the peer, but also the mapping that will
  8846. * be applied for any TID objects created within this
  8847. * peer in the future.
  8848. * b'31:1 - reserved for future use
  8849. */
  8850. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8851. A_UINT32 msg_type :8,
  8852. tid_mask :8,
  8853. peer_id :16;
  8854. A_UINT32 existing_tids_only:1,
  8855. reserved :31;
  8856. } POSTPACK;
  8857. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8858. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8859. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8860. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8861. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8862. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8863. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8864. do { \
  8865. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8866. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8867. } while (0)
  8868. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8869. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8870. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8871. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8872. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8873. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8874. do { \
  8875. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8876. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8877. } while (0)
  8878. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8879. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8880. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8881. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8882. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8883. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8886. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8887. } while (0)
  8888. /**
  8889. * @brief Format of shared memory between Host and Target
  8890. * for UMAC hang recovery feature messaging.
  8891. * @details
  8892. * This is shared memory between Host and Target allocated
  8893. * and used in chips where UMAC hang recovery feature is supported.
  8894. * This shared memory is allocated per SOC level by Host since each
  8895. * SOC's target Q6FW needs to communicate independently to the Host
  8896. * through its own shared memory.
  8897. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8898. * then host interprets it as a new message from target.
  8899. * Host clears that particular read bit in t2h_msg after each read
  8900. * operation. It is vice versa for h2t_msg. At any given point
  8901. * of time there is expected to be only one bit set
  8902. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8903. *
  8904. * The message is interpreted as follows:
  8905. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8906. * added for debuggability purpose.
  8907. * dword1 - b'0 - do_pre_reset
  8908. * b'1 - do_post_reset_start
  8909. * b'2 - do_post_reset_complete
  8910. * b'3 - initiate_umac_recovery
  8911. * b'4:31 - rsvd_t2h
  8912. * dword2 - b'0 - pre_reset_done
  8913. * b'1 - post_reset_start_done
  8914. * b'2 - post_reset_complete_done
  8915. * b'3 - start_pre_reset
  8916. * b'4:31 - rsvd_h2t
  8917. */
  8918. PREPACK typedef struct {
  8919. /** Magic number added for debuggability. */
  8920. A_UINT32 magic_num;
  8921. union {
  8922. /*
  8923. * BIT [0] :- T2H msg to do pre-reset
  8924. * BIT [1] :- T2H msg to do post-reset start
  8925. * BIT [2] :- T2H msg to do post-reset complete
  8926. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8927. * This is needed to synchronize UMAC recovery
  8928. * across all SOCs.
  8929. * BIT [31 : 4] :- reserved
  8930. */
  8931. A_UINT32 t2h_msg;
  8932. struct {
  8933. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8934. do_post_reset_start : 1, /* BIT [1] */
  8935. do_post_reset_complete : 1, /* BIT [2] */
  8936. initiate_umac_recovery : 1, /* BIT [3] */
  8937. rsvd_t2h : 28; /* BIT [31 : 4] */
  8938. };
  8939. };
  8940. union {
  8941. /*
  8942. * BIT [0] :- H2T msg to send pre-reset done
  8943. * BIT [1] :- H2T msg to send post-reset start done
  8944. * BIT [2] :- H2T msg to send post-reset complete done
  8945. * BIT [3] :- H2T msg to start pre-reset.
  8946. * This is expected only after T2H
  8947. * initiate_umac_recovery was received by Host
  8948. * from one of the SOCs.
  8949. * BIT [31 : 4] :- reserved
  8950. */
  8951. A_UINT32 h2t_msg;
  8952. struct {
  8953. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8954. post_reset_start_done : 1, /* BIT [1] */
  8955. post_reset_complete_done : 1, /* BIT [2] */
  8956. start_pre_reset : 1, /* BIT [3] */
  8957. rsvd_h2t : 28; /* BIT [31 : 4] */
  8958. };
  8959. };
  8960. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8961. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8962. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8963. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8964. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8965. /* dword1 - b'0 - do_pre_reset */
  8966. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8967. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8968. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8969. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8970. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8971. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8974. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8975. } while (0)
  8976. /* dword1 - b'1 - do_post_reset_start */
  8977. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8978. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8979. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8980. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8981. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8982. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8983. do { \
  8984. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8985. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8986. } while (0)
  8987. /* dword1 - b'2 - do_post_reset_complete */
  8988. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8989. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8990. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8991. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8992. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8993. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8996. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8997. } while (0)
  8998. /* dword1 - b'3 - initiate_umac_recovery */
  8999. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9000. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9001. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9002. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9003. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9004. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9005. do { \
  9006. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9007. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9008. } while (0)
  9009. /* dword2 - b'0 - pre_reset_done */
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9012. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9013. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9014. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9015. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9016. do { \
  9017. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9018. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9019. } while (0)
  9020. /* dword2 - b'1 - post_reset_start_done */
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9023. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9024. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9025. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9026. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9029. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9030. } while (0)
  9031. /* dword2 - b'2 - post_reset_complete_done */
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9034. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9035. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9036. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9037. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9038. do { \
  9039. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9040. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9041. } while (0)
  9042. /* dword2 - b'3 - start_pre_reset */
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9045. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9046. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9047. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9048. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9049. do { \
  9050. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9051. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9052. } while (0)
  9053. /**
  9054. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9055. *
  9056. * @details
  9057. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9058. * by the host to provide prerequisite info to target for the UMAC hang
  9059. * recovery feature.
  9060. * The info sent in this H2T message are T2H message method, H2T message
  9061. * method, T2H MSI interrupt number and physical start address, size of
  9062. * the shared memory (refers to the shared memory dedicated for messaging
  9063. * between host and target when the DUT is in UMAC hang recovery mode).
  9064. * This H2T message is expected to be only sent if the WMI service bit
  9065. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9066. *
  9067. * |31 16|15 12|11 8|7 0|
  9068. * |-------------------------------+--------------+--------------+------------|
  9069. * | reserved |h2t msg method|t2h msg method| msg_type |
  9070. * |--------------------------------------------------------------------------|
  9071. * | t2h msi interrupt number |
  9072. * |--------------------------------------------------------------------------|
  9073. * | shared memory area size |
  9074. * |--------------------------------------------------------------------------|
  9075. * | shared memory area physical address low |
  9076. * |--------------------------------------------------------------------------|
  9077. * | shared memory area physical address high |
  9078. * |--------------------------------------------------------------------------|
  9079. *
  9080. * The message is interpreted as follows:
  9081. * dword0 - b'0:7 - msg_type
  9082. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9083. * b'8:11 - t2h_msg_method: indicates method to be used for
  9084. * T2H communication in UMAC hang recovery mode.
  9085. * Value zero indicates MSI interrupt (default method).
  9086. * Refer to htt_umac_hang_recovery_msg_method enum.
  9087. * b'12:15 - h2t_msg_method: indicates method to be used for
  9088. * H2T communication in UMAC hang recovery mode.
  9089. * Value zero indicates polling by target for this h2t msg
  9090. * during UMAC hang recovery mode.
  9091. * Refer to htt_umac_hang_recovery_msg_method enum.
  9092. * b'16:31 - reserved.
  9093. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9094. * T2H communication in UMAC hang recovery mode.
  9095. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9096. * only when in UMAC hang recovery mode.
  9097. * This refers to size in bytes.
  9098. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9099. * of the shared memory dedicated for messaging only when
  9100. * in UMAC hang recovery mode.
  9101. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9102. * of the shared memory dedicated for messaging only when
  9103. * in UMAC hang recovery mode.
  9104. */
  9105. /* t2h_msg_method and h2t_msg_method */
  9106. enum htt_umac_hang_recovery_msg_method {
  9107. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9108. };
  9109. PREPACK typedef struct {
  9110. A_UINT32 msg_type : 8,
  9111. t2h_msg_method : 4,
  9112. h2t_msg_method : 4,
  9113. reserved : 16;
  9114. A_UINT32 t2h_msi_data;
  9115. /* size bytes and physical address of shared memory. */
  9116. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9117. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9118. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9119. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9120. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9121. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9122. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9123. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9124. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9125. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9126. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9127. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9128. do { \
  9129. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9130. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9131. } while (0)
  9132. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9133. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9134. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9135. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9136. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9137. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9138. do { \
  9139. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9140. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9141. } while (0)
  9142. /**
  9143. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9144. *
  9145. * @details
  9146. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9147. * HTT message sent by the host to indicate that the target needs to start the
  9148. * UMAC hang recovery feature from the point of pre-reset routine.
  9149. * The purpose of this H2T message is to have host synchronize and trigger
  9150. * UMAC recovery across all targets.
  9151. * The info sent in this H2T message is the flag to indicate whether the
  9152. * target needs to execute UMAC-recovery in context of the Initiator or
  9153. * Non-Initiator.
  9154. * This H2T message is expected to be sent as response to the
  9155. * initiate_umac_recovery indication from the Initiator target attached to
  9156. * this same host.
  9157. * This H2T message is expected to be only sent if the WMI service bit
  9158. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9159. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9160. * beforehand.
  9161. *
  9162. * |31 9|8|7 0|
  9163. * |-----------------------------------------------------------|
  9164. * | reserved |I| msg_type |
  9165. * |-----------------------------------------------------------|
  9166. * Where:
  9167. * I = is_initiator
  9168. *
  9169. * The message is interpreted as follows:
  9170. * dword0 - b'0:7 - msg_type
  9171. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9172. * b'8 - is_initiator: indicates whether the target needs to
  9173. * execute the UMAC-recovery in context of the Initiator or
  9174. * Non-Initiator.
  9175. * The value zero indicates this target is Non-Initiator.
  9176. * b'9:31 - reserved.
  9177. */
  9178. PREPACK typedef struct {
  9179. A_UINT32 msg_type : 8,
  9180. is_initiator : 1,
  9181. reserved : 23;
  9182. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9183. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9184. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9185. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9186. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9187. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9188. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9189. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9190. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9191. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9192. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9193. do { \
  9194. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9195. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9196. } while (0)
  9197. /*=== target -> host messages ===============================================*/
  9198. enum htt_t2h_msg_type {
  9199. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9200. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9201. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9202. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9203. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9204. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9205. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9206. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9207. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9208. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9209. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9210. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9211. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9212. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9213. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9214. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9215. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9216. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9217. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9218. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9219. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9220. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9221. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9222. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9223. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9224. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9225. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9226. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9227. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9228. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9229. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9230. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9231. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9232. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9233. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9234. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9235. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9236. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9237. /* TX_OFFLOAD_DELIVER_IND:
  9238. * Forward the target's locally-generated packets to the host,
  9239. * to provide to the monitor mode interface.
  9240. */
  9241. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9242. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9243. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9244. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9245. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9246. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9247. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9248. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9249. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9250. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9251. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9252. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9253. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9254. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9255. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9256. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9257. HTT_T2H_MSG_TYPE_TEST,
  9258. /* keep this last */
  9259. HTT_T2H_NUM_MSGS
  9260. };
  9261. /*
  9262. * HTT target to host message type -
  9263. * stored in bits 7:0 of the first word of the message
  9264. */
  9265. #define HTT_T2H_MSG_TYPE_M 0xff
  9266. #define HTT_T2H_MSG_TYPE_S 0
  9267. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9268. do { \
  9269. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9270. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9271. } while (0)
  9272. #define HTT_T2H_MSG_TYPE_GET(word) \
  9273. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9274. /**
  9275. * @brief target -> host version number confirmation message definition
  9276. *
  9277. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9278. *
  9279. * |31 24|23 16|15 8|7 0|
  9280. * |----------------+----------------+----------------+----------------|
  9281. * | reserved | major number | minor number | msg type |
  9282. * |-------------------------------------------------------------------|
  9283. * : option request TLV (optional) |
  9284. * :...................................................................:
  9285. *
  9286. * The VER_CONF message may consist of a single 4-byte word, or may be
  9287. * extended with TLVs that specify HTT options selected by the target.
  9288. * The following option TLVs may be appended to the VER_CONF message:
  9289. * - LL_BUS_ADDR_SIZE
  9290. * - HL_SUPPRESS_TX_COMPL_IND
  9291. * - MAX_TX_QUEUE_GROUPS
  9292. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9293. * may be appended to the VER_CONF message (but only one TLV of each type).
  9294. *
  9295. * Header fields:
  9296. * - MSG_TYPE
  9297. * Bits 7:0
  9298. * Purpose: identifies this as a version number confirmation message
  9299. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9300. * - VER_MINOR
  9301. * Bits 15:8
  9302. * Purpose: Specify the minor number of the HTT message library version
  9303. * in use by the target firmware.
  9304. * The minor number specifies the specific revision within a range
  9305. * of fundamentally compatible HTT message definition revisions.
  9306. * Compatible revisions involve adding new messages or perhaps
  9307. * adding new fields to existing messages, in a backwards-compatible
  9308. * manner.
  9309. * Incompatible revisions involve changing the message type values,
  9310. * or redefining existing messages.
  9311. * Value: minor number
  9312. * - VER_MAJOR
  9313. * Bits 15:8
  9314. * Purpose: Specify the major number of the HTT message library version
  9315. * in use by the target firmware.
  9316. * The major number specifies the family of minor revisions that are
  9317. * fundamentally compatible with each other, but not with prior or
  9318. * later families.
  9319. * Value: major number
  9320. */
  9321. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9322. #define HTT_VER_CONF_MINOR_S 8
  9323. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9324. #define HTT_VER_CONF_MAJOR_S 16
  9325. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9326. do { \
  9327. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9328. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9329. } while (0)
  9330. #define HTT_VER_CONF_MINOR_GET(word) \
  9331. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9332. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9333. do { \
  9334. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9335. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9336. } while (0)
  9337. #define HTT_VER_CONF_MAJOR_GET(word) \
  9338. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9339. #define HTT_VER_CONF_BYTES 4
  9340. /**
  9341. * @brief - target -> host HTT Rx In order indication message
  9342. *
  9343. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9344. *
  9345. * @details
  9346. *
  9347. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9348. * |----------------+-------------------+---------------------+---------------|
  9349. * | peer ID | P| F| O| ext TID | msg type |
  9350. * |--------------------------------------------------------------------------|
  9351. * | MSDU count | Reserved | vdev id |
  9352. * |--------------------------------------------------------------------------|
  9353. * | MSDU 0 bus address (bits 31:0) |
  9354. #if HTT_PADDR64
  9355. * | MSDU 0 bus address (bits 63:32) |
  9356. #endif
  9357. * |--------------------------------------------------------------------------|
  9358. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9359. * |--------------------------------------------------------------------------|
  9360. * | MSDU 1 bus address (bits 31:0) |
  9361. #if HTT_PADDR64
  9362. * | MSDU 1 bus address (bits 63:32) |
  9363. #endif
  9364. * |--------------------------------------------------------------------------|
  9365. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9366. * |--------------------------------------------------------------------------|
  9367. */
  9368. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9369. *
  9370. * @details
  9371. * bits
  9372. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9373. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9374. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9375. * | | frag | | | | fail |chksum fail|
  9376. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9377. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9378. */
  9379. struct htt_rx_in_ord_paddr_ind_hdr_t
  9380. {
  9381. A_UINT32 /* word 0 */
  9382. msg_type: 8,
  9383. ext_tid: 5,
  9384. offload: 1,
  9385. frag: 1,
  9386. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9387. peer_id: 16;
  9388. A_UINT32 /* word 1 */
  9389. vap_id: 8,
  9390. /* NOTE:
  9391. * This reserved_1 field is not truly reserved - certain targets use
  9392. * this field internally to store debug information, and do not zero
  9393. * out the contents of the field before uploading the message to the
  9394. * host. Thus, any host-target communication supported by this field
  9395. * is limited to using values that are never used by the debug
  9396. * information stored by certain targets in the reserved_1 field.
  9397. * In particular, the targets in question don't use the value 0x3
  9398. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9399. * so this previously-unused value within these bits is available to
  9400. * use as the host / target PKT_CAPTURE_MODE flag.
  9401. */
  9402. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9403. /* if pkt_capture_mode == 0x3, host should
  9404. * send rx frames to monitor mode interface
  9405. */
  9406. msdu_cnt: 16;
  9407. };
  9408. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9409. {
  9410. A_UINT32 dma_addr;
  9411. A_UINT32
  9412. length: 16,
  9413. fw_desc: 8,
  9414. msdu_info:8;
  9415. };
  9416. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9417. {
  9418. A_UINT32 dma_addr_lo;
  9419. A_UINT32 dma_addr_hi;
  9420. A_UINT32
  9421. length: 16,
  9422. fw_desc: 8,
  9423. msdu_info:8;
  9424. };
  9425. #if HTT_PADDR64
  9426. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9427. #else
  9428. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9429. #endif
  9430. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9431. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9432. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9434. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9435. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9436. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9437. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9438. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9439. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9440. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9441. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9442. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9443. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9444. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9445. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9446. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9447. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9448. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9449. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9450. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9451. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9452. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9453. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9454. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9455. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9456. /* for systems using 64-bit format for bus addresses */
  9457. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9458. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9459. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9460. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9461. /* for systems using 32-bit format for bus addresses */
  9462. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9463. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9464. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9465. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9466. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9467. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9468. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9469. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9470. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9471. do { \
  9472. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9473. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9474. } while (0)
  9475. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9476. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9477. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9478. do { \
  9479. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9480. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9481. } while (0)
  9482. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9483. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9484. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9485. do { \
  9486. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9487. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9488. } while (0)
  9489. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9490. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9491. /*
  9492. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9493. * deliver the rx frames to the monitor mode interface.
  9494. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9495. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9496. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9497. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9498. */
  9499. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9500. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9501. do { \
  9502. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9503. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9504. } while (0)
  9505. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9506. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9507. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9508. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9509. do { \
  9510. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9511. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9512. } while (0)
  9513. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9514. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9515. /* for systems using 64-bit format for bus addresses */
  9516. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9517. do { \
  9518. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9519. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9520. } while (0)
  9521. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9522. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9523. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9524. do { \
  9525. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9526. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9527. } while (0)
  9528. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9529. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9530. /* for systems using 32-bit format for bus addresses */
  9531. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9534. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9535. } while (0)
  9536. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9537. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9538. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9539. do { \
  9540. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9541. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9542. } while (0)
  9543. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9544. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9545. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9546. do { \
  9547. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9548. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9549. } while (0)
  9550. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9551. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9552. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9553. do { \
  9554. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9555. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9556. } while (0)
  9557. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9558. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9559. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9560. do { \
  9561. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9562. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9563. } while (0)
  9564. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9565. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9566. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9569. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9570. } while (0)
  9571. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9572. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9573. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9574. do { \
  9575. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9576. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9577. } while (0)
  9578. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9579. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9580. /* definitions used within target -> host rx indication message */
  9581. PREPACK struct htt_rx_ind_hdr_prefix_t
  9582. {
  9583. A_UINT32 /* word 0 */
  9584. msg_type: 8,
  9585. ext_tid: 5,
  9586. release_valid: 1,
  9587. flush_valid: 1,
  9588. reserved0: 1,
  9589. peer_id: 16;
  9590. A_UINT32 /* word 1 */
  9591. flush_start_seq_num: 6,
  9592. flush_end_seq_num: 6,
  9593. release_start_seq_num: 6,
  9594. release_end_seq_num: 6,
  9595. num_mpdu_ranges: 8;
  9596. } POSTPACK;
  9597. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9598. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9599. #define HTT_TGT_RSSI_INVALID 0x80
  9600. PREPACK struct htt_rx_ppdu_desc_t
  9601. {
  9602. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9603. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9604. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9605. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9606. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9607. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9608. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9609. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9610. A_UINT32 /* word 0 */
  9611. rssi_cmb: 8,
  9612. timestamp_submicrosec: 8,
  9613. phy_err_code: 8,
  9614. phy_err: 1,
  9615. legacy_rate: 4,
  9616. legacy_rate_sel: 1,
  9617. end_valid: 1,
  9618. start_valid: 1;
  9619. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9620. union {
  9621. A_UINT32 /* word 1 */
  9622. rssi0_pri20: 8,
  9623. rssi0_ext20: 8,
  9624. rssi0_ext40: 8,
  9625. rssi0_ext80: 8;
  9626. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9627. } u0;
  9628. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9629. union {
  9630. A_UINT32 /* word 2 */
  9631. rssi1_pri20: 8,
  9632. rssi1_ext20: 8,
  9633. rssi1_ext40: 8,
  9634. rssi1_ext80: 8;
  9635. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9636. } u1;
  9637. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9638. union {
  9639. A_UINT32 /* word 3 */
  9640. rssi2_pri20: 8,
  9641. rssi2_ext20: 8,
  9642. rssi2_ext40: 8,
  9643. rssi2_ext80: 8;
  9644. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9645. } u2;
  9646. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9647. union {
  9648. A_UINT32 /* word 4 */
  9649. rssi3_pri20: 8,
  9650. rssi3_ext20: 8,
  9651. rssi3_ext40: 8,
  9652. rssi3_ext80: 8;
  9653. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9654. } u3;
  9655. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9656. A_UINT32 tsf32; /* word 5 */
  9657. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9658. A_UINT32 timestamp_microsec; /* word 6 */
  9659. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9660. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9661. A_UINT32 /* word 7 */
  9662. vht_sig_a1: 24,
  9663. preamble_type: 8;
  9664. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9665. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9666. A_UINT32 /* word 8 */
  9667. vht_sig_a2: 24,
  9668. /* sa_ant_matrix
  9669. * For cases where a single rx chain has options to be connected to
  9670. * different rx antennas, show which rx antennas were in use during
  9671. * receipt of a given PPDU.
  9672. * This sa_ant_matrix provides a bitmask of the antennas used while
  9673. * receiving this frame.
  9674. */
  9675. sa_ant_matrix: 8;
  9676. } POSTPACK;
  9677. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9678. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9679. PREPACK struct htt_rx_ind_hdr_suffix_t
  9680. {
  9681. A_UINT32 /* word 0 */
  9682. fw_rx_desc_bytes: 16,
  9683. reserved0: 16;
  9684. } POSTPACK;
  9685. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9686. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9687. PREPACK struct htt_rx_ind_hdr_t
  9688. {
  9689. struct htt_rx_ind_hdr_prefix_t prefix;
  9690. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9691. struct htt_rx_ind_hdr_suffix_t suffix;
  9692. } POSTPACK;
  9693. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9694. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9695. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9696. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9697. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9698. /*
  9699. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9700. * the offset into the HTT rx indication message at which the
  9701. * FW rx PPDU descriptor resides
  9702. */
  9703. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9704. /*
  9705. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9706. * the offset into the HTT rx indication message at which the
  9707. * header suffix (FW rx MSDU byte count) resides
  9708. */
  9709. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9710. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9711. /*
  9712. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9713. * the offset into the HTT rx indication message at which the per-MSDU
  9714. * information starts
  9715. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9716. * per-MSDU information portion of the message. The per-MSDU info itself
  9717. * starts at byte 12.
  9718. */
  9719. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9720. /**
  9721. * @brief target -> host rx indication message definition
  9722. *
  9723. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9724. *
  9725. * @details
  9726. * The following field definitions describe the format of the rx indication
  9727. * message sent from the target to the host.
  9728. * The message consists of three major sections:
  9729. * 1. a fixed-length header
  9730. * 2. a variable-length list of firmware rx MSDU descriptors
  9731. * 3. one or more 4-octet MPDU range information elements
  9732. * The fixed length header itself has two sub-sections
  9733. * 1. the message meta-information, including identification of the
  9734. * sender and type of the received data, and a 4-octet flush/release IE
  9735. * 2. the firmware rx PPDU descriptor
  9736. *
  9737. * The format of the message is depicted below.
  9738. * in this depiction, the following abbreviations are used for information
  9739. * elements within the message:
  9740. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9741. * elements associated with the PPDU start are valid.
  9742. * Specifically, the following fields are valid only if SV is set:
  9743. * RSSI (all variants), L, legacy rate, preamble type, service,
  9744. * VHT-SIG-A
  9745. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9746. * elements associated with the PPDU end are valid.
  9747. * Specifically, the following fields are valid only if EV is set:
  9748. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9749. * - L - Legacy rate selector - if legacy rates are used, this flag
  9750. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9751. * (L == 0) PHY.
  9752. * - P - PHY error flag - boolean indication of whether the rx frame had
  9753. * a PHY error
  9754. *
  9755. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9756. * |----------------+-------------------+---------------------+---------------|
  9757. * | peer ID | |RV|FV| ext TID | msg type |
  9758. * |--------------------------------------------------------------------------|
  9759. * | num | release | release | flush | flush |
  9760. * | MPDU | end | start | end | start |
  9761. * | ranges | seq num | seq num | seq num | seq num |
  9762. * |==========================================================================|
  9763. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9764. * |V|V| | rate | | | timestamp | RSSI |
  9765. * |--------------------------------------------------------------------------|
  9766. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9767. * |--------------------------------------------------------------------------|
  9768. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9769. * |--------------------------------------------------------------------------|
  9770. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9771. * |--------------------------------------------------------------------------|
  9772. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9773. * |--------------------------------------------------------------------------|
  9774. * | TSF LSBs |
  9775. * |--------------------------------------------------------------------------|
  9776. * | microsec timestamp |
  9777. * |--------------------------------------------------------------------------|
  9778. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9779. * |--------------------------------------------------------------------------|
  9780. * | service | HT-SIG / VHT-SIG-A2 |
  9781. * |==========================================================================|
  9782. * | reserved | FW rx desc bytes |
  9783. * |--------------------------------------------------------------------------|
  9784. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9785. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9786. * |--------------------------------------------------------------------------|
  9787. * : : :
  9788. * |--------------------------------------------------------------------------|
  9789. * | alignment | MSDU Rx |
  9790. * | padding | desc Bn |
  9791. * |--------------------------------------------------------------------------|
  9792. * | reserved | MPDU range status | MPDU count |
  9793. * |--------------------------------------------------------------------------|
  9794. * : reserved : MPDU range status : MPDU count :
  9795. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9796. *
  9797. * Header fields:
  9798. * - MSG_TYPE
  9799. * Bits 7:0
  9800. * Purpose: identifies this as an rx indication message
  9801. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9802. * - EXT_TID
  9803. * Bits 12:8
  9804. * Purpose: identify the traffic ID of the rx data, including
  9805. * special "extended" TID values for multicast, broadcast, and
  9806. * non-QoS data frames
  9807. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9808. * - FLUSH_VALID (FV)
  9809. * Bit 13
  9810. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9811. * is valid
  9812. * Value:
  9813. * 1 -> flush IE is valid and needs to be processed
  9814. * 0 -> flush IE is not valid and should be ignored
  9815. * - REL_VALID (RV)
  9816. * Bit 13
  9817. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9818. * is valid
  9819. * Value:
  9820. * 1 -> release IE is valid and needs to be processed
  9821. * 0 -> release IE is not valid and should be ignored
  9822. * - PEER_ID
  9823. * Bits 31:16
  9824. * Purpose: Identify, by ID, which peer sent the rx data
  9825. * Value: ID of the peer who sent the rx data
  9826. * - FLUSH_SEQ_NUM_START
  9827. * Bits 5:0
  9828. * Purpose: Indicate the start of a series of MPDUs to flush
  9829. * Not all MPDUs within this series are necessarily valid - the host
  9830. * must check each sequence number within this range to see if the
  9831. * corresponding MPDU is actually present.
  9832. * This field is only valid if the FV bit is set.
  9833. * Value:
  9834. * The sequence number for the first MPDUs to check to flush.
  9835. * The sequence number is masked by 0x3f.
  9836. * - FLUSH_SEQ_NUM_END
  9837. * Bits 11:6
  9838. * Purpose: Indicate the end of a series of MPDUs to flush
  9839. * Value:
  9840. * The sequence number one larger than the sequence number of the
  9841. * last MPDU to check to flush.
  9842. * The sequence number is masked by 0x3f.
  9843. * Not all MPDUs within this series are necessarily valid - the host
  9844. * must check each sequence number within this range to see if the
  9845. * corresponding MPDU is actually present.
  9846. * This field is only valid if the FV bit is set.
  9847. * - REL_SEQ_NUM_START
  9848. * Bits 17:12
  9849. * Purpose: Indicate the start of a series of MPDUs to release.
  9850. * All MPDUs within this series are present and valid - the host
  9851. * need not check each sequence number within this range to see if
  9852. * the corresponding MPDU is actually present.
  9853. * This field is only valid if the RV bit is set.
  9854. * Value:
  9855. * The sequence number for the first MPDUs to check to release.
  9856. * The sequence number is masked by 0x3f.
  9857. * - REL_SEQ_NUM_END
  9858. * Bits 23:18
  9859. * Purpose: Indicate the end of a series of MPDUs to release.
  9860. * Value:
  9861. * The sequence number one larger than the sequence number of the
  9862. * last MPDU to check to release.
  9863. * The sequence number is masked by 0x3f.
  9864. * All MPDUs within this series are present and valid - the host
  9865. * need not check each sequence number within this range to see if
  9866. * the corresponding MPDU is actually present.
  9867. * This field is only valid if the RV bit is set.
  9868. * - NUM_MPDU_RANGES
  9869. * Bits 31:24
  9870. * Purpose: Indicate how many ranges of MPDUs are present.
  9871. * Each MPDU range consists of a series of contiguous MPDUs within the
  9872. * rx frame sequence which all have the same MPDU status.
  9873. * Value: 1-63 (typically a small number, like 1-3)
  9874. *
  9875. * Rx PPDU descriptor fields:
  9876. * - RSSI_CMB
  9877. * Bits 7:0
  9878. * Purpose: Combined RSSI from all active rx chains, across the active
  9879. * bandwidth.
  9880. * Value: RSSI dB units w.r.t. noise floor
  9881. * - TIMESTAMP_SUBMICROSEC
  9882. * Bits 15:8
  9883. * Purpose: high-resolution timestamp
  9884. * Value:
  9885. * Sub-microsecond time of PPDU reception.
  9886. * This timestamp ranges from [0,MAC clock MHz).
  9887. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9888. * to form a high-resolution, large range rx timestamp.
  9889. * - PHY_ERR_CODE
  9890. * Bits 23:16
  9891. * Purpose:
  9892. * If the rx frame processing resulted in a PHY error, indicate what
  9893. * type of rx PHY error occurred.
  9894. * Value:
  9895. * This field is valid if the "P" (PHY_ERR) flag is set.
  9896. * TBD: document/specify the values for this field
  9897. * - PHY_ERR
  9898. * Bit 24
  9899. * Purpose: indicate whether the rx PPDU had a PHY error
  9900. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9901. * - LEGACY_RATE
  9902. * Bits 28:25
  9903. * Purpose:
  9904. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9905. * specify which rate was used.
  9906. * Value:
  9907. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9908. * flag.
  9909. * If LEGACY_RATE_SEL is 0:
  9910. * 0x8: OFDM 48 Mbps
  9911. * 0x9: OFDM 24 Mbps
  9912. * 0xA: OFDM 12 Mbps
  9913. * 0xB: OFDM 6 Mbps
  9914. * 0xC: OFDM 54 Mbps
  9915. * 0xD: OFDM 36 Mbps
  9916. * 0xE: OFDM 18 Mbps
  9917. * 0xF: OFDM 9 Mbps
  9918. * If LEGACY_RATE_SEL is 1:
  9919. * 0x8: CCK 11 Mbps long preamble
  9920. * 0x9: CCK 5.5 Mbps long preamble
  9921. * 0xA: CCK 2 Mbps long preamble
  9922. * 0xB: CCK 1 Mbps long preamble
  9923. * 0xC: CCK 11 Mbps short preamble
  9924. * 0xD: CCK 5.5 Mbps short preamble
  9925. * 0xE: CCK 2 Mbps short preamble
  9926. * - LEGACY_RATE_SEL
  9927. * Bit 29
  9928. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9929. * Value:
  9930. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9931. * used a legacy rate.
  9932. * 0 -> OFDM, 1 -> CCK
  9933. * - END_VALID
  9934. * Bit 30
  9935. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9936. * the start of the PPDU are valid. Specifically, the following
  9937. * fields are only valid if END_VALID is set:
  9938. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9939. * TIMESTAMP_SUBMICROSEC
  9940. * Value:
  9941. * 0 -> rx PPDU desc end fields are not valid
  9942. * 1 -> rx PPDU desc end fields are valid
  9943. * - START_VALID
  9944. * Bit 31
  9945. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9946. * the end of the PPDU are valid. Specifically, the following
  9947. * fields are only valid if START_VALID is set:
  9948. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9949. * VHT-SIG-A
  9950. * Value:
  9951. * 0 -> rx PPDU desc start fields are not valid
  9952. * 1 -> rx PPDU desc start fields are valid
  9953. * - RSSI0_PRI20
  9954. * Bits 7:0
  9955. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9956. * Value: RSSI dB units w.r.t. noise floor
  9957. *
  9958. * - RSSI0_EXT20
  9959. * Bits 7:0
  9960. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9961. * (if the rx bandwidth was >= 40 MHz)
  9962. * Value: RSSI dB units w.r.t. noise floor
  9963. * - RSSI0_EXT40
  9964. * Bits 7:0
  9965. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9966. * (if the rx bandwidth was >= 80 MHz)
  9967. * Value: RSSI dB units w.r.t. noise floor
  9968. * - RSSI0_EXT80
  9969. * Bits 7:0
  9970. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9971. * (if the rx bandwidth was >= 160 MHz)
  9972. * Value: RSSI dB units w.r.t. noise floor
  9973. *
  9974. * - RSSI1_PRI20
  9975. * Bits 7:0
  9976. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9977. * Value: RSSI dB units w.r.t. noise floor
  9978. * - RSSI1_EXT20
  9979. * Bits 7:0
  9980. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9981. * (if the rx bandwidth was >= 40 MHz)
  9982. * Value: RSSI dB units w.r.t. noise floor
  9983. * - RSSI1_EXT40
  9984. * Bits 7:0
  9985. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9986. * (if the rx bandwidth was >= 80 MHz)
  9987. * Value: RSSI dB units w.r.t. noise floor
  9988. * - RSSI1_EXT80
  9989. * Bits 7:0
  9990. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9991. * (if the rx bandwidth was >= 160 MHz)
  9992. * Value: RSSI dB units w.r.t. noise floor
  9993. *
  9994. * - RSSI2_PRI20
  9995. * Bits 7:0
  9996. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9997. * Value: RSSI dB units w.r.t. noise floor
  9998. * - RSSI2_EXT20
  9999. * Bits 7:0
  10000. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10001. * (if the rx bandwidth was >= 40 MHz)
  10002. * Value: RSSI dB units w.r.t. noise floor
  10003. * - RSSI2_EXT40
  10004. * Bits 7:0
  10005. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10006. * (if the rx bandwidth was >= 80 MHz)
  10007. * Value: RSSI dB units w.r.t. noise floor
  10008. * - RSSI2_EXT80
  10009. * Bits 7:0
  10010. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10011. * (if the rx bandwidth was >= 160 MHz)
  10012. * Value: RSSI dB units w.r.t. noise floor
  10013. *
  10014. * - RSSI3_PRI20
  10015. * Bits 7:0
  10016. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10017. * Value: RSSI dB units w.r.t. noise floor
  10018. * - RSSI3_EXT20
  10019. * Bits 7:0
  10020. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10021. * (if the rx bandwidth was >= 40 MHz)
  10022. * Value: RSSI dB units w.r.t. noise floor
  10023. * - RSSI3_EXT40
  10024. * Bits 7:0
  10025. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10026. * (if the rx bandwidth was >= 80 MHz)
  10027. * Value: RSSI dB units w.r.t. noise floor
  10028. * - RSSI3_EXT80
  10029. * Bits 7:0
  10030. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10031. * (if the rx bandwidth was >= 160 MHz)
  10032. * Value: RSSI dB units w.r.t. noise floor
  10033. *
  10034. * - TSF32
  10035. * Bits 31:0
  10036. * Purpose: specify the time the rx PPDU was received, in TSF units
  10037. * Value: 32 LSBs of the TSF
  10038. * - TIMESTAMP_MICROSEC
  10039. * Bits 31:0
  10040. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10041. * Value: PPDU rx time, in microseconds
  10042. * - VHT_SIG_A1
  10043. * Bits 23:0
  10044. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10045. * from the rx PPDU
  10046. * Value:
  10047. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10048. * VHT-SIG-A1 data.
  10049. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10050. * first 24 bits of the HT-SIG data.
  10051. * Otherwise, this field is invalid.
  10052. * Refer to the the 802.11 protocol for the definition of the
  10053. * HT-SIG and VHT-SIG-A1 fields
  10054. * - VHT_SIG_A2
  10055. * Bits 23:0
  10056. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10057. * from the rx PPDU
  10058. * Value:
  10059. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10060. * VHT-SIG-A2 data.
  10061. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10062. * last 24 bits of the HT-SIG data.
  10063. * Otherwise, this field is invalid.
  10064. * Refer to the the 802.11 protocol for the definition of the
  10065. * HT-SIG and VHT-SIG-A2 fields
  10066. * - PREAMBLE_TYPE
  10067. * Bits 31:24
  10068. * Purpose: indicate the PHY format of the received burst
  10069. * Value:
  10070. * 0x4: Legacy (OFDM/CCK)
  10071. * 0x8: HT
  10072. * 0x9: HT with TxBF
  10073. * 0xC: VHT
  10074. * 0xD: VHT with TxBF
  10075. * - SERVICE
  10076. * Bits 31:24
  10077. * Purpose: TBD
  10078. * Value: TBD
  10079. *
  10080. * Rx MSDU descriptor fields:
  10081. * - FW_RX_DESC_BYTES
  10082. * Bits 15:0
  10083. * Purpose: Indicate how many bytes in the Rx indication are used for
  10084. * FW Rx descriptors
  10085. *
  10086. * Payload fields:
  10087. * - MPDU_COUNT
  10088. * Bits 7:0
  10089. * Purpose: Indicate how many sequential MPDUs share the same status.
  10090. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10091. * - MPDU_STATUS
  10092. * Bits 15:8
  10093. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10094. * received successfully.
  10095. * Value:
  10096. * 0x1: success
  10097. * 0x2: FCS error
  10098. * 0x3: duplicate error
  10099. * 0x4: replay error
  10100. * 0x5: invalid peer
  10101. */
  10102. /* header fields */
  10103. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10104. #define HTT_RX_IND_EXT_TID_S 8
  10105. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10106. #define HTT_RX_IND_FLUSH_VALID_S 13
  10107. #define HTT_RX_IND_REL_VALID_M 0x4000
  10108. #define HTT_RX_IND_REL_VALID_S 14
  10109. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10110. #define HTT_RX_IND_PEER_ID_S 16
  10111. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10112. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10113. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10114. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10115. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10116. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10117. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10118. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10119. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10120. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10121. /* rx PPDU descriptor fields */
  10122. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10123. #define HTT_RX_IND_RSSI_CMB_S 0
  10124. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10125. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10126. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10127. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10128. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10129. #define HTT_RX_IND_PHY_ERR_S 24
  10130. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10131. #define HTT_RX_IND_LEGACY_RATE_S 25
  10132. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10133. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10134. #define HTT_RX_IND_END_VALID_M 0x40000000
  10135. #define HTT_RX_IND_END_VALID_S 30
  10136. #define HTT_RX_IND_START_VALID_M 0x80000000
  10137. #define HTT_RX_IND_START_VALID_S 31
  10138. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10139. #define HTT_RX_IND_RSSI_PRI20_S 0
  10140. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10141. #define HTT_RX_IND_RSSI_EXT20_S 8
  10142. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10143. #define HTT_RX_IND_RSSI_EXT40_S 16
  10144. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10145. #define HTT_RX_IND_RSSI_EXT80_S 24
  10146. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10147. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10148. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10149. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10150. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10151. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10152. #define HTT_RX_IND_SERVICE_M 0xff000000
  10153. #define HTT_RX_IND_SERVICE_S 24
  10154. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10155. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10156. /* rx MSDU descriptor fields */
  10157. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10158. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10159. /* payload fields */
  10160. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10161. #define HTT_RX_IND_MPDU_COUNT_S 0
  10162. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10163. #define HTT_RX_IND_MPDU_STATUS_S 8
  10164. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10165. do { \
  10166. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10167. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10168. } while (0)
  10169. #define HTT_RX_IND_EXT_TID_GET(word) \
  10170. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10171. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10172. do { \
  10173. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10174. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10175. } while (0)
  10176. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10177. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10178. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10179. do { \
  10180. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10181. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10182. } while (0)
  10183. #define HTT_RX_IND_REL_VALID_GET(word) \
  10184. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10185. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10186. do { \
  10187. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10188. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10189. } while (0)
  10190. #define HTT_RX_IND_PEER_ID_GET(word) \
  10191. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10192. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10193. do { \
  10194. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10195. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10196. } while (0)
  10197. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10198. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10199. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10200. do { \
  10201. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10202. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10203. } while (0)
  10204. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10205. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10206. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10207. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10208. do { \
  10209. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10210. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10211. } while (0)
  10212. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10213. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10214. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10215. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10216. do { \
  10217. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10218. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10219. } while (0)
  10220. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10221. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10222. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10223. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10224. do { \
  10225. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10226. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10227. } while (0)
  10228. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10229. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10230. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10231. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10232. do { \
  10233. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10234. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10235. } while (0)
  10236. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10237. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10238. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10239. /* FW rx PPDU descriptor fields */
  10240. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10241. do { \
  10242. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10243. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10244. } while (0)
  10245. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10246. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10247. HTT_RX_IND_RSSI_CMB_S)
  10248. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10249. do { \
  10250. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10251. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10252. } while (0)
  10253. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10254. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10255. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10256. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10257. do { \
  10258. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10259. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10260. } while (0)
  10261. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10262. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10263. HTT_RX_IND_PHY_ERR_CODE_S)
  10264. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10265. do { \
  10266. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10267. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10268. } while (0)
  10269. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10270. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10271. HTT_RX_IND_PHY_ERR_S)
  10272. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10273. do { \
  10274. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10275. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10276. } while (0)
  10277. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10278. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10279. HTT_RX_IND_LEGACY_RATE_S)
  10280. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10281. do { \
  10282. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10283. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10284. } while (0)
  10285. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10286. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10287. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10288. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10289. do { \
  10290. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10291. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10292. } while (0)
  10293. #define HTT_RX_IND_END_VALID_GET(word) \
  10294. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10295. HTT_RX_IND_END_VALID_S)
  10296. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10297. do { \
  10298. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10299. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10300. } while (0)
  10301. #define HTT_RX_IND_START_VALID_GET(word) \
  10302. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10303. HTT_RX_IND_START_VALID_S)
  10304. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10305. do { \
  10306. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10307. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10308. } while (0)
  10309. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10310. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10311. HTT_RX_IND_RSSI_PRI20_S)
  10312. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10313. do { \
  10314. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10315. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10316. } while (0)
  10317. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10318. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10319. HTT_RX_IND_RSSI_EXT20_S)
  10320. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10321. do { \
  10322. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10323. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10324. } while (0)
  10325. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10326. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10327. HTT_RX_IND_RSSI_EXT40_S)
  10328. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10329. do { \
  10330. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10331. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10332. } while (0)
  10333. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10334. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10335. HTT_RX_IND_RSSI_EXT80_S)
  10336. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10337. do { \
  10338. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10339. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10340. } while (0)
  10341. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10342. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10343. HTT_RX_IND_VHT_SIG_A1_S)
  10344. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10345. do { \
  10346. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10347. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10348. } while (0)
  10349. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10350. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10351. HTT_RX_IND_VHT_SIG_A2_S)
  10352. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10353. do { \
  10354. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10355. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10356. } while (0)
  10357. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10358. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10359. HTT_RX_IND_PREAMBLE_TYPE_S)
  10360. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10361. do { \
  10362. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10363. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10364. } while (0)
  10365. #define HTT_RX_IND_SERVICE_GET(word) \
  10366. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10367. HTT_RX_IND_SERVICE_S)
  10368. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10369. do { \
  10370. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10371. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10372. } while (0)
  10373. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10374. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10375. HTT_RX_IND_SA_ANT_MATRIX_S)
  10376. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10379. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10380. } while (0)
  10381. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10382. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10383. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10384. do { \
  10385. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10386. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10387. } while (0)
  10388. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10389. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10390. #define HTT_RX_IND_HL_BYTES \
  10391. (HTT_RX_IND_HDR_BYTES + \
  10392. 4 /* single FW rx MSDU descriptor */ + \
  10393. 4 /* single MPDU range information element */)
  10394. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10395. /* Could we use one macro entry? */
  10396. #define HTT_WORD_SET(word, field, value) \
  10397. do { \
  10398. HTT_CHECK_SET_VAL(field, value); \
  10399. (word) |= ((value) << field ## _S); \
  10400. } while (0)
  10401. #define HTT_WORD_GET(word, field) \
  10402. (((word) & field ## _M) >> field ## _S)
  10403. PREPACK struct hl_htt_rx_ind_base {
  10404. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10405. } POSTPACK;
  10406. /*
  10407. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10408. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10409. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10410. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10411. * htt_rx_ind_hl_rx_desc_t.
  10412. */
  10413. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10414. struct htt_rx_ind_hl_rx_desc_t {
  10415. A_UINT8 ver;
  10416. A_UINT8 len;
  10417. struct {
  10418. A_UINT8
  10419. first_msdu: 1,
  10420. last_msdu: 1,
  10421. c3_failed: 1,
  10422. c4_failed: 1,
  10423. ipv6: 1,
  10424. tcp: 1,
  10425. udp: 1,
  10426. reserved: 1;
  10427. } flags;
  10428. /* NOTE: no reserved space - don't append any new fields here */
  10429. };
  10430. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10431. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10432. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10433. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10434. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10435. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10436. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10437. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10438. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10439. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10440. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10441. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10442. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10443. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10444. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10445. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10446. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10447. /* This structure is used in HL, the basic descriptor information
  10448. * used by host. the structure is translated by FW from HW desc
  10449. * or generated by FW. But in HL monitor mode, the host would use
  10450. * the same structure with LL.
  10451. */
  10452. PREPACK struct hl_htt_rx_desc_base {
  10453. A_UINT32
  10454. seq_num:12,
  10455. encrypted:1,
  10456. chan_info_present:1,
  10457. resv0:2,
  10458. mcast_bcast:1,
  10459. fragment:1,
  10460. key_id_oct:8,
  10461. resv1:6;
  10462. A_UINT32
  10463. pn_31_0;
  10464. union {
  10465. struct {
  10466. A_UINT16 pn_47_32;
  10467. A_UINT16 pn_63_48;
  10468. } pn16;
  10469. A_UINT32 pn_63_32;
  10470. } u0;
  10471. A_UINT32
  10472. pn_95_64;
  10473. A_UINT32
  10474. pn_127_96;
  10475. } POSTPACK;
  10476. /*
  10477. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10478. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10479. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10480. * Please see htt_chan_change_t for description of the fields.
  10481. */
  10482. PREPACK struct htt_chan_info_t
  10483. {
  10484. A_UINT32 primary_chan_center_freq_mhz: 16,
  10485. contig_chan1_center_freq_mhz: 16;
  10486. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10487. phy_mode: 8,
  10488. reserved: 8;
  10489. } POSTPACK;
  10490. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10491. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10492. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10493. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10494. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10495. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10496. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10497. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10498. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10499. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10500. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10501. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10502. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10503. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10504. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10505. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10506. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10507. /* Channel information */
  10508. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10509. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10510. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10511. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10512. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10513. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10514. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10515. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10516. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10519. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10520. } while (0)
  10521. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10522. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10523. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10526. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10527. } while (0)
  10528. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10529. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10530. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10533. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10534. } while (0)
  10535. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10536. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10537. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10540. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10541. } while (0)
  10542. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10543. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10544. /*
  10545. * @brief target -> host message definition for FW offloaded pkts
  10546. *
  10547. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10548. *
  10549. * @details
  10550. * The following field definitions describe the format of the firmware
  10551. * offload deliver message sent from the target to the host.
  10552. *
  10553. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10554. *
  10555. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10556. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10557. * | reserved_1 | msg type |
  10558. * |--------------------------------------------------------------------------|
  10559. * | phy_timestamp_l32 |
  10560. * |--------------------------------------------------------------------------|
  10561. * | WORD2 (see below) |
  10562. * |--------------------------------------------------------------------------|
  10563. * | seqno | framectrl |
  10564. * |--------------------------------------------------------------------------|
  10565. * | reserved_3 | vdev_id | tid_num|
  10566. * |--------------------------------------------------------------------------|
  10567. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10568. * |--------------------------------------------------------------------------|
  10569. *
  10570. * where:
  10571. * STAT = status
  10572. * F = format (802.3 vs. 802.11)
  10573. *
  10574. * definition for word 2
  10575. *
  10576. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10577. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10578. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10579. * |--------------------------------------------------------------------------|
  10580. *
  10581. * where:
  10582. * PR = preamble
  10583. * BF = beamformed
  10584. */
  10585. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10586. {
  10587. A_UINT32 /* word 0 */
  10588. msg_type:8, /* [ 7: 0] */
  10589. reserved_1:24; /* [31: 8] */
  10590. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10591. A_UINT32 /* word 2 */
  10592. /* preamble:
  10593. * 0-OFDM,
  10594. * 1-CCk,
  10595. * 2-HT,
  10596. * 3-VHT
  10597. */
  10598. preamble: 2, /* [1:0] */
  10599. /* mcs:
  10600. * In case of HT preamble interpret
  10601. * MCS along with NSS.
  10602. * Valid values for HT are 0 to 7.
  10603. * HT mcs 0 with NSS 2 is mcs 8.
  10604. * Valid values for VHT are 0 to 9.
  10605. */
  10606. mcs: 4, /* [5:2] */
  10607. /* rate:
  10608. * This is applicable only for
  10609. * CCK and OFDM preamble type
  10610. * rate 0: OFDM 48 Mbps,
  10611. * 1: OFDM 24 Mbps,
  10612. * 2: OFDM 12 Mbps
  10613. * 3: OFDM 6 Mbps
  10614. * 4: OFDM 54 Mbps
  10615. * 5: OFDM 36 Mbps
  10616. * 6: OFDM 18 Mbps
  10617. * 7: OFDM 9 Mbps
  10618. * rate 0: CCK 11 Mbps Long
  10619. * 1: CCK 5.5 Mbps Long
  10620. * 2: CCK 2 Mbps Long
  10621. * 3: CCK 1 Mbps Long
  10622. * 4: CCK 11 Mbps Short
  10623. * 5: CCK 5.5 Mbps Short
  10624. * 6: CCK 2 Mbps Short
  10625. */
  10626. rate : 3, /* [ 8: 6] */
  10627. rssi : 8, /* [16: 9] units=dBm */
  10628. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10629. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10630. stbc : 1, /* [22] */
  10631. sgi : 1, /* [23] */
  10632. ldpc : 1, /* [24] */
  10633. beamformed: 1, /* [25] */
  10634. reserved_2: 6; /* [31:26] */
  10635. A_UINT32 /* word 3 */
  10636. framectrl:16, /* [15: 0] */
  10637. seqno:16; /* [31:16] */
  10638. A_UINT32 /* word 4 */
  10639. tid_num:5, /* [ 4: 0] actual TID number */
  10640. vdev_id:8, /* [12: 5] */
  10641. reserved_3:19; /* [31:13] */
  10642. A_UINT32 /* word 5 */
  10643. /* status:
  10644. * 0: tx_ok
  10645. * 1: retry
  10646. * 2: drop
  10647. * 3: filtered
  10648. * 4: abort
  10649. * 5: tid delete
  10650. * 6: sw abort
  10651. * 7: dropped by peer migration
  10652. */
  10653. status:3, /* [2:0] */
  10654. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10655. tx_mpdu_bytes:16, /* [19:4] */
  10656. /* Indicates retry count of offloaded/local generated Data tx frames */
  10657. tx_retry_cnt:6, /* [25:20] */
  10658. reserved_4:6; /* [31:26] */
  10659. } POSTPACK;
  10660. /* FW offload deliver ind message header fields */
  10661. /* DWORD one */
  10662. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10663. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10664. /* DWORD two */
  10665. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10666. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10667. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10668. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10669. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10670. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10671. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10672. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10673. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10674. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10675. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10676. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10677. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10678. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10679. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10680. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10681. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10682. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10683. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10684. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10685. /* DWORD three*/
  10686. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10687. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10688. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10689. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10690. /* DWORD four */
  10691. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10692. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10693. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10694. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10695. /* DWORD five */
  10696. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10697. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10698. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10699. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10700. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10701. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10702. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10703. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10704. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10705. do { \
  10706. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10707. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10708. } while (0)
  10709. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10710. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10711. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10712. do { \
  10713. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10714. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10715. } while (0)
  10716. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10717. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10718. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10719. do { \
  10720. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10721. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10722. } while (0)
  10723. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10724. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10725. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10726. do { \
  10727. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10728. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10729. } while (0)
  10730. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10731. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10732. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10733. do { \
  10734. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10735. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10736. } while (0)
  10737. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10738. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10739. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10740. do { \
  10741. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10742. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10743. } while (0)
  10744. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10745. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10746. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10747. do { \
  10748. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10749. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10750. } while (0)
  10751. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10752. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10753. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10754. do { \
  10755. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10756. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10757. } while (0)
  10758. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10759. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10760. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10761. do { \
  10762. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10763. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10764. } while (0)
  10765. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10766. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10767. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10768. do { \
  10769. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10770. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10771. } while (0)
  10772. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10773. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10774. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10775. do { \
  10776. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10777. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10778. } while (0)
  10779. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10780. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10781. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10782. do { \
  10783. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10784. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10785. } while (0)
  10786. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10787. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10788. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10789. do { \
  10790. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10791. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10792. } while (0)
  10793. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10794. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10795. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10796. do { \
  10797. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10798. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10799. } while (0)
  10800. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10801. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10802. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10803. do { \
  10804. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10805. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10806. } while (0)
  10807. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10808. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10809. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10812. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10813. } while (0)
  10814. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10815. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10816. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10819. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10820. } while (0)
  10821. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10822. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10823. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10826. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10827. } while (0)
  10828. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10829. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10830. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10833. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10834. } while (0)
  10835. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10836. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10837. /*
  10838. * @brief target -> host rx reorder flush message definition
  10839. *
  10840. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10841. *
  10842. * @details
  10843. * The following field definitions describe the format of the rx flush
  10844. * message sent from the target to the host.
  10845. * The message consists of a 4-octet header, followed by one or more
  10846. * 4-octet payload information elements.
  10847. *
  10848. * |31 24|23 8|7 0|
  10849. * |--------------------------------------------------------------|
  10850. * | TID | peer ID | msg type |
  10851. * |--------------------------------------------------------------|
  10852. * | seq num end | seq num start | MPDU status | reserved |
  10853. * |--------------------------------------------------------------|
  10854. * First DWORD:
  10855. * - MSG_TYPE
  10856. * Bits 7:0
  10857. * Purpose: identifies this as an rx flush message
  10858. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10859. * - PEER_ID
  10860. * Bits 23:8 (only bits 18:8 actually used)
  10861. * Purpose: identify which peer's rx data is being flushed
  10862. * Value: (rx) peer ID
  10863. * - TID
  10864. * Bits 31:24 (only bits 27:24 actually used)
  10865. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10866. * Value: traffic identifier
  10867. * Second DWORD:
  10868. * - MPDU_STATUS
  10869. * Bits 15:8
  10870. * Purpose:
  10871. * Indicate whether the flushed MPDUs should be discarded or processed.
  10872. * Value:
  10873. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10874. * stages of rx processing
  10875. * other: discard the MPDUs
  10876. * It is anticipated that flush messages will always have
  10877. * MPDU status == 1, but the status flag is included for
  10878. * flexibility.
  10879. * - SEQ_NUM_START
  10880. * Bits 23:16
  10881. * Purpose:
  10882. * Indicate the start of a series of consecutive MPDUs being flushed.
  10883. * Not all MPDUs within this range are necessarily valid - the host
  10884. * must check each sequence number within this range to see if the
  10885. * corresponding MPDU is actually present.
  10886. * Value:
  10887. * The sequence number for the first MPDU in the sequence.
  10888. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10889. * - SEQ_NUM_END
  10890. * Bits 30:24
  10891. * Purpose:
  10892. * Indicate the end of a series of consecutive MPDUs being flushed.
  10893. * Value:
  10894. * The sequence number one larger than the sequence number of the
  10895. * last MPDU being flushed.
  10896. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10897. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10898. * are to be released for further rx processing.
  10899. * Not all MPDUs within this range are necessarily valid - the host
  10900. * must check each sequence number within this range to see if the
  10901. * corresponding MPDU is actually present.
  10902. */
  10903. /* first DWORD */
  10904. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10905. #define HTT_RX_FLUSH_PEER_ID_S 8
  10906. #define HTT_RX_FLUSH_TID_M 0xff000000
  10907. #define HTT_RX_FLUSH_TID_S 24
  10908. /* second DWORD */
  10909. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10910. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10911. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10912. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10913. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10914. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10915. #define HTT_RX_FLUSH_BYTES 8
  10916. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10917. do { \
  10918. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10919. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10920. } while (0)
  10921. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10922. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10923. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10924. do { \
  10925. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10926. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10927. } while (0)
  10928. #define HTT_RX_FLUSH_TID_GET(word) \
  10929. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10930. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10931. do { \
  10932. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10933. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10934. } while (0)
  10935. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10936. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10937. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10938. do { \
  10939. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10940. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10941. } while (0)
  10942. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10943. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10944. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10945. do { \
  10946. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10947. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10948. } while (0)
  10949. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10950. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10951. /*
  10952. * @brief target -> host rx pn check indication message
  10953. *
  10954. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10955. *
  10956. * @details
  10957. * The following field definitions describe the format of the Rx PN check
  10958. * indication message sent from the target to the host.
  10959. * The message consists of a 4-octet header, followed by the start and
  10960. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10961. * IE is one octet containing the sequence number that failed the PN
  10962. * check.
  10963. *
  10964. * |31 24|23 8|7 0|
  10965. * |--------------------------------------------------------------|
  10966. * | TID | peer ID | msg type |
  10967. * |--------------------------------------------------------------|
  10968. * | Reserved | PN IE count | seq num end | seq num start|
  10969. * |--------------------------------------------------------------|
  10970. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10971. * |--------------------------------------------------------------|
  10972. * First DWORD:
  10973. * - MSG_TYPE
  10974. * Bits 7:0
  10975. * Purpose: Identifies this as an rx pn check indication message
  10976. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10977. * - PEER_ID
  10978. * Bits 23:8 (only bits 18:8 actually used)
  10979. * Purpose: identify which peer
  10980. * Value: (rx) peer ID
  10981. * - TID
  10982. * Bits 31:24 (only bits 27:24 actually used)
  10983. * Purpose: identify traffic identifier
  10984. * Value: traffic identifier
  10985. * Second DWORD:
  10986. * - SEQ_NUM_START
  10987. * Bits 7:0
  10988. * Purpose:
  10989. * Indicates the starting sequence number of the MPDU in this
  10990. * series of MPDUs that went though PN check.
  10991. * Value:
  10992. * The sequence number for the first MPDU in the sequence.
  10993. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10994. * - SEQ_NUM_END
  10995. * Bits 15:8
  10996. * Purpose:
  10997. * Indicates the ending sequence number of the MPDU in this
  10998. * series of MPDUs that went though PN check.
  10999. * Value:
  11000. * The sequence number one larger then the sequence number of the last
  11001. * MPDU being flushed.
  11002. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11003. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11004. * for invalid PN numbers and are ready to be released for further processing.
  11005. * Not all MPDUs within this range are necessarily valid - the host
  11006. * must check each sequence number within this range to see if the
  11007. * corresponding MPDU is actually present.
  11008. * - PN_IE_COUNT
  11009. * Bits 23:16
  11010. * Purpose:
  11011. * Used to determine the variable number of PN information elements in this
  11012. * message
  11013. *
  11014. * PN information elements:
  11015. * - PN_IE_x-
  11016. * Purpose:
  11017. * Each PN information element contains the sequence number of the MPDU that
  11018. * has failed the target PN check.
  11019. * Value:
  11020. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11021. * that failed the PN check.
  11022. */
  11023. /* first DWORD */
  11024. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11025. #define HTT_RX_PN_IND_PEER_ID_S 8
  11026. #define HTT_RX_PN_IND_TID_M 0xff000000
  11027. #define HTT_RX_PN_IND_TID_S 24
  11028. /* second DWORD */
  11029. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11030. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11031. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11032. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11033. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11034. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11035. #define HTT_RX_PN_IND_BYTES 8
  11036. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11037. do { \
  11038. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11039. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11040. } while (0)
  11041. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11042. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11043. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11044. do { \
  11045. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11046. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11047. } while (0)
  11048. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11049. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11050. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11053. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11054. } while (0)
  11055. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11056. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11057. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11058. do { \
  11059. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11060. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11061. } while (0)
  11062. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11063. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11064. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11065. do { \
  11066. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11067. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11068. } while (0)
  11069. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11070. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11071. /*
  11072. * @brief target -> host rx offload deliver message for LL system
  11073. *
  11074. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11075. *
  11076. * @details
  11077. * In a low latency system this message is sent whenever the offload
  11078. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11079. * The DMA of the actual packets into host memory is done before sending out
  11080. * this message. This message indicates only how many MSDUs to reap. The
  11081. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11082. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11083. * DMA'd by the MAC directly into host memory these packets do not contain
  11084. * the MAC descriptors in the header portion of the packet. Instead they contain
  11085. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11086. * message, the packets are delivered directly to the NW stack without going
  11087. * through the regular reorder buffering and PN checking path since it has
  11088. * already been done in target.
  11089. *
  11090. * |31 24|23 16|15 8|7 0|
  11091. * |-----------------------------------------------------------------------|
  11092. * | Total MSDU count | reserved | msg type |
  11093. * |-----------------------------------------------------------------------|
  11094. *
  11095. * @brief target -> host rx offload deliver message for HL system
  11096. *
  11097. * @details
  11098. * In a high latency system this message is sent whenever the offload manager
  11099. * flushes out the packets it has coalesced in its coalescing buffer. The
  11100. * actual packets are also carried along with this message. When the host
  11101. * receives this message, it is expected to deliver these packets to the NW
  11102. * stack directly instead of routing them through the reorder buffering and
  11103. * PN checking path since it has already been done in target.
  11104. *
  11105. * |31 24|23 16|15 8|7 0|
  11106. * |-----------------------------------------------------------------------|
  11107. * | Total MSDU count | reserved | msg type |
  11108. * |-----------------------------------------------------------------------|
  11109. * | peer ID | MSDU length |
  11110. * |-----------------------------------------------------------------------|
  11111. * | MSDU payload | FW Desc | tid | vdev ID |
  11112. * |-----------------------------------------------------------------------|
  11113. * | MSDU payload contd. |
  11114. * |-----------------------------------------------------------------------|
  11115. * | peer ID | MSDU length |
  11116. * |-----------------------------------------------------------------------|
  11117. * | MSDU payload | FW Desc | tid | vdev ID |
  11118. * |-----------------------------------------------------------------------|
  11119. * | MSDU payload contd. |
  11120. * |-----------------------------------------------------------------------|
  11121. *
  11122. */
  11123. /* first DWORD */
  11124. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11125. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11127. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11130. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11131. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11132. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11137. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11138. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11139. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11140. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11141. do { \
  11142. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11143. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11144. } while (0)
  11145. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11146. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11147. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11148. do { \
  11149. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11150. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11151. } while (0)
  11152. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11153. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11154. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11155. do { \
  11156. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11157. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11158. } while (0)
  11159. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11160. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11161. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11164. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11165. } while (0)
  11166. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11167. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11168. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11171. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11172. } while (0)
  11173. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11174. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11175. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11176. do { \
  11177. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11178. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11179. } while (0)
  11180. /**
  11181. * @brief target -> host rx peer map/unmap message definition
  11182. *
  11183. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11184. *
  11185. * @details
  11186. * The following diagram shows the format of the rx peer map message sent
  11187. * from the target to the host. This layout assumes the target operates
  11188. * as little-endian.
  11189. *
  11190. * This message always contains a SW peer ID. The main purpose of the
  11191. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11192. * with, so that the host can use that peer ID to determine which peer
  11193. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11194. * other purposes, such as identifying during tx completions which peer
  11195. * the tx frames in question were transmitted to.
  11196. *
  11197. * In certain generations of chips, the peer map message also contains
  11198. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11199. * to identify which peer the frame needs to be forwarded to (i.e. the
  11200. * peer associated with the Destination MAC Address within the packet),
  11201. * and particularly which vdev needs to transmit the frame (for cases
  11202. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11203. * meaning as AST_INDEX_0.
  11204. * This DA-based peer ID that is provided for certain rx frames
  11205. * (the rx frames that need to be re-transmitted as tx frames)
  11206. * is the ID that the HW uses for referring to the peer in question,
  11207. * rather than the peer ID that the SW+FW use to refer to the peer.
  11208. *
  11209. *
  11210. * |31 24|23 16|15 8|7 0|
  11211. * |-----------------------------------------------------------------------|
  11212. * | SW peer ID | VDEV ID | msg type |
  11213. * |-----------------------------------------------------------------------|
  11214. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11215. * |-----------------------------------------------------------------------|
  11216. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11217. * |-----------------------------------------------------------------------|
  11218. *
  11219. *
  11220. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11221. *
  11222. * The following diagram shows the format of the rx peer unmap message sent
  11223. * from the target to the host.
  11224. *
  11225. * |31 24|23 16|15 8|7 0|
  11226. * |-----------------------------------------------------------------------|
  11227. * | SW peer ID | VDEV ID | msg type |
  11228. * |-----------------------------------------------------------------------|
  11229. *
  11230. * The following field definitions describe the format of the rx peer map
  11231. * and peer unmap messages sent from the target to the host.
  11232. * - MSG_TYPE
  11233. * Bits 7:0
  11234. * Purpose: identifies this as an rx peer map or peer unmap message
  11235. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11236. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11237. * - VDEV_ID
  11238. * Bits 15:8
  11239. * Purpose: Indicates which virtual device the peer is associated
  11240. * with.
  11241. * Value: vdev ID (used in the host to look up the vdev object)
  11242. * - PEER_ID (a.k.a. SW_PEER_ID)
  11243. * Bits 31:16
  11244. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11245. * freeing (unmap)
  11246. * Value: (rx) peer ID
  11247. * - MAC_ADDR_L32 (peer map only)
  11248. * Bits 31:0
  11249. * Purpose: Identifies which peer node the peer ID is for.
  11250. * Value: lower 4 bytes of peer node's MAC address
  11251. * - MAC_ADDR_U16 (peer map only)
  11252. * Bits 15:0
  11253. * Purpose: Identifies which peer node the peer ID is for.
  11254. * Value: upper 2 bytes of peer node's MAC address
  11255. * - HW_PEER_ID
  11256. * Bits 31:16
  11257. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11258. * address, so for rx frames marked for rx --> tx forwarding, the
  11259. * host can determine from the HW peer ID provided as meta-data with
  11260. * the rx frame which peer the frame is supposed to be forwarded to.
  11261. * Value: ID used by the MAC HW to identify the peer
  11262. */
  11263. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11264. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11265. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11266. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11267. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11268. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11269. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11270. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11271. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11272. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11273. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11274. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11275. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11276. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11277. do { \
  11278. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11279. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11280. } while (0)
  11281. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11282. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11283. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11284. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11285. do { \
  11286. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11287. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11288. } while (0)
  11289. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11290. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11291. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11292. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11293. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11296. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11297. } while (0)
  11298. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11299. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11300. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11301. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11302. #define HTT_RX_PEER_MAP_BYTES 12
  11303. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11304. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11305. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11306. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11307. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11308. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11309. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11310. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11311. #define HTT_RX_PEER_UNMAP_BYTES 4
  11312. /**
  11313. * @brief target -> host rx peer map V2 message definition
  11314. *
  11315. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11316. *
  11317. * @details
  11318. * The following diagram shows the format of the rx peer map v2 message sent
  11319. * from the target to the host. This layout assumes the target operates
  11320. * as little-endian.
  11321. *
  11322. * This message always contains a SW peer ID. The main purpose of the
  11323. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11324. * with, so that the host can use that peer ID to determine which peer
  11325. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11326. * other purposes, such as identifying during tx completions which peer
  11327. * the tx frames in question were transmitted to.
  11328. *
  11329. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11330. * is used during rx --> tx frame forwarding to identify which peer the
  11331. * frame needs to be forwarded to (i.e. the peer associated with the
  11332. * Destination MAC Address within the packet), and particularly which vdev
  11333. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11334. * This DA-based peer ID that is provided for certain rx frames
  11335. * (the rx frames that need to be re-transmitted as tx frames)
  11336. * is the ID that the HW uses for referring to the peer in question,
  11337. * rather than the peer ID that the SW+FW use to refer to the peer.
  11338. *
  11339. * The HW peer id here is the same meaning as AST_INDEX_0.
  11340. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11341. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11342. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11343. * AST is valid.
  11344. *
  11345. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11346. * |-------------------------------------------------------------------------|
  11347. * | SW peer ID | VDEV ID | msg type |
  11348. * |-------------------------------------------------------------------------|
  11349. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11350. * |-------------------------------------------------------------------------|
  11351. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11352. * |-------------------------------------------------------------------------|
  11353. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11354. * |-------------------------------------------------------------------------|
  11355. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11356. * |-------------------------------------------------------------------------|
  11357. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11358. * |-------------------------------------------------------------------------|
  11359. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11360. * |-------------------------------------------------------------------------|
  11361. * | Reserved_2 |
  11362. * |-------------------------------------------------------------------------|
  11363. * Where:
  11364. * NH = Next Hop
  11365. * ASTVM = AST valid mask
  11366. * OA = on-chip AST valid bit
  11367. * ASTFM = AST flow mask
  11368. *
  11369. * The following field definitions describe the format of the rx peer map v2
  11370. * messages sent from the target to the host.
  11371. * - MSG_TYPE
  11372. * Bits 7:0
  11373. * Purpose: identifies this as an rx peer map v2 message
  11374. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11375. * - VDEV_ID
  11376. * Bits 15:8
  11377. * Purpose: Indicates which virtual device the peer is associated with.
  11378. * Value: vdev ID (used in the host to look up the vdev object)
  11379. * - SW_PEER_ID
  11380. * Bits 31:16
  11381. * Purpose: The peer ID (index) that WAL is allocating
  11382. * Value: (rx) peer ID
  11383. * - MAC_ADDR_L32
  11384. * Bits 31:0
  11385. * Purpose: Identifies which peer node the peer ID is for.
  11386. * Value: lower 4 bytes of peer node's MAC address
  11387. * - MAC_ADDR_U16
  11388. * Bits 15:0
  11389. * Purpose: Identifies which peer node the peer ID is for.
  11390. * Value: upper 2 bytes of peer node's MAC address
  11391. * - HW_PEER_ID / AST_INDEX_0
  11392. * Bits 31:16
  11393. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11394. * address, so for rx frames marked for rx --> tx forwarding, the
  11395. * host can determine from the HW peer ID provided as meta-data with
  11396. * the rx frame which peer the frame is supposed to be forwarded to.
  11397. * Value: ID used by the MAC HW to identify the peer
  11398. * - AST_HASH_VALUE
  11399. * Bits 15:0
  11400. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11401. * override feature.
  11402. * - NEXT_HOP
  11403. * Bit 16
  11404. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11405. * (Wireless Distribution System).
  11406. * - AST_VALID_MASK
  11407. * Bits 19:17
  11408. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11409. * - ONCHIP_AST_VALID_FLAG
  11410. * Bit 20
  11411. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11412. * is valid.
  11413. * - AST_INDEX_1
  11414. * Bits 15:0
  11415. * Purpose: indicate the second AST index for this peer
  11416. * - AST_0_FLOW_MASK
  11417. * Bits 19:16
  11418. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11419. * - AST_1_FLOW_MASK
  11420. * Bits 23:20
  11421. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11422. * - AST_2_FLOW_MASK
  11423. * Bits 27:24
  11424. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11425. * - AST_3_FLOW_MASK
  11426. * Bits 31:28
  11427. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11428. * - AST_INDEX_2
  11429. * Bits 15:0
  11430. * Purpose: indicate the third AST index for this peer
  11431. * - TID_VALID_HI_PRI
  11432. * Bits 23:16
  11433. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11434. * - TID_VALID_LOW_PRI
  11435. * Bits 31:24
  11436. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11437. * - AST_INDEX_3
  11438. * Bits 15:0
  11439. * Purpose: indicate the fourth AST index for this peer
  11440. * - ONCHIP_AST_IDX / RESERVED
  11441. * Bits 31:16
  11442. * Purpose: This field is valid only when split AST feature is enabled.
  11443. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11444. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11445. * address, this ast_idx is used for LMAC modules for RXPCU.
  11446. * Value: ID used by the LMAC HW to identify the peer
  11447. */
  11448. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11449. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11450. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11451. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11452. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11453. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11454. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11455. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11456. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11457. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11458. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11459. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11460. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11461. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11462. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11463. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11464. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11465. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11466. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11467. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11468. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11469. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11470. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11471. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11472. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11473. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11474. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11475. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11476. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11477. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11478. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11479. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11480. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11481. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11482. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11483. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11484. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11485. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11486. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11487. do { \
  11488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11489. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11490. } while (0)
  11491. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11492. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11493. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11494. do { \
  11495. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11496. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11497. } while (0)
  11498. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11499. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11500. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11503. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11504. } while (0)
  11505. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11506. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11507. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11508. do { \
  11509. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11510. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11511. } while (0)
  11512. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11513. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11514. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11515. do { \
  11516. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11517. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11518. } while (0)
  11519. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11520. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11521. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11524. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11525. } while (0)
  11526. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11527. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11528. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11529. do { \
  11530. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11531. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11532. } while (0)
  11533. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11534. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11535. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11536. do { \
  11537. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11538. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11539. } while (0)
  11540. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11541. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11542. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11543. do { \
  11544. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11545. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11546. } while (0)
  11547. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11548. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11549. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11550. do { \
  11551. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11552. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11553. } while (0)
  11554. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11555. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11556. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11557. do { \
  11558. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11559. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11560. } while (0)
  11561. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11562. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11563. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11564. do { \
  11565. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11566. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11567. } while (0)
  11568. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11569. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11570. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11571. do { \
  11572. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11573. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11574. } while (0)
  11575. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11576. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11577. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11578. do { \
  11579. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11580. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11581. } while (0)
  11582. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11583. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11584. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11585. do { \
  11586. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11587. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11588. } while (0)
  11589. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11590. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11591. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11592. do { \
  11593. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11594. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11595. } while (0)
  11596. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11597. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11598. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11599. do { \
  11600. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11601. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11602. } while (0)
  11603. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11604. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11605. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11606. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11607. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11608. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11609. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11610. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11611. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11612. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11613. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11614. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11615. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11616. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11617. /**
  11618. * @brief target -> host rx peer map V3 message definition
  11619. *
  11620. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11621. *
  11622. * @details
  11623. * The following diagram shows the format of the rx peer map v3 message sent
  11624. * from the target to the host.
  11625. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11626. * This layout assumes the target operates as little-endian.
  11627. *
  11628. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11629. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11630. * | SW peer ID | VDEV ID | msg type |
  11631. * |-----------------+--------------------+-----------------+-----------------|
  11632. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11633. * |-----------------+--------------------+-----------------+-----------------|
  11634. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11635. * |-----------------+--------+-----------+-----------------+-----------------|
  11636. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11637. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11638. * | (8bits) | | (4bits) | |
  11639. * |-----------------+--------+--+--+--+--------------------------------------|
  11640. * | RESERVED |E |O | | |
  11641. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11642. * | |V |V | | |
  11643. * |-----------------+--------------------+-----------------------------------|
  11644. * | HTT_MSDU_IDX_ | RESERVED | |
  11645. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11646. * | (8bits) | | |
  11647. * |-----------------+--------------------+-----------------------------------|
  11648. * | Reserved_2 |
  11649. * |--------------------------------------------------------------------------|
  11650. * | Reserved_3 |
  11651. * |--------------------------------------------------------------------------|
  11652. *
  11653. * Where:
  11654. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11655. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11656. * NH = Next Hop
  11657. * The following field definitions describe the format of the rx peer map v3
  11658. * messages sent from the target to the host.
  11659. * - MSG_TYPE
  11660. * Bits 7:0
  11661. * Purpose: identifies this as a peer map v3 message
  11662. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11663. * - VDEV_ID
  11664. * Bits 15:8
  11665. * Purpose: Indicates which virtual device the peer is associated with.
  11666. * - SW_PEER_ID
  11667. * Bits 31:16
  11668. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11669. * - MAC_ADDR_L32
  11670. * Bits 31:0
  11671. * Purpose: Identifies which peer node the peer ID is for.
  11672. * Value: lower 4 bytes of peer node's MAC address
  11673. * - MAC_ADDR_U16
  11674. * Bits 15:0
  11675. * Purpose: Identifies which peer node the peer ID is for.
  11676. * Value: upper 2 bytes of peer node's MAC address
  11677. * - MULTICAST_SW_PEER_ID
  11678. * Bits 31:16
  11679. * Purpose: The multicast peer ID (index)
  11680. * Value: set to HTT_INVALID_PEER if not valid
  11681. * - HW_PEER_ID / AST_INDEX
  11682. * Bits 15:0
  11683. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11684. * address, so for rx frames marked for rx --> tx forwarding, the
  11685. * host can determine from the HW peer ID provided as meta-data with
  11686. * the rx frame which peer the frame is supposed to be forwarded to.
  11687. * - CACHE_SET_NUM
  11688. * Bits 19:16
  11689. * Purpose: Cache Set Number for AST_INDEX
  11690. * Cache set number that should be used to cache the index based
  11691. * search results, for address and flow search.
  11692. * This value should be equal to LSB 4 bits of the hash value
  11693. * of match data, in case of search index points to an entry which
  11694. * may be used in content based search also. The value can be
  11695. * anything when the entry pointed by search index will not be
  11696. * used for content based search.
  11697. * - HTT_MSDU_IDX_VALID_MASK
  11698. * Bits 31:24
  11699. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11700. * - ONCHIP_AST_IDX / RESERVED
  11701. * Bits 15:0
  11702. * Purpose: This field is valid only when split AST feature is enabled.
  11703. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11704. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11705. * address, this ast_idx is used for LMAC modules for RXPCU.
  11706. * - NEXT_HOP
  11707. * Bits 16
  11708. * Purpose: Flag indicates next_hop AST entry used for WDS
  11709. * (Wireless Distribution System).
  11710. * - ONCHIP_AST_VALID
  11711. * Bits 17
  11712. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11713. * - EXT_AST_VALID
  11714. * Bits 18
  11715. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11716. * - EXT_AST_INDEX
  11717. * Bits 15:0
  11718. * Purpose: This field describes Extended AST index
  11719. * Valid if EXT_AST_VALID flag set
  11720. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11721. * Bits 31:24
  11722. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11723. */
  11724. /* dword 0 */
  11725. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11726. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11727. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11728. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11729. /* dword 1 */
  11730. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11731. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11732. /* dword 2 */
  11733. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11734. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11735. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11736. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11737. /* dword 3 */
  11738. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11739. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11740. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11741. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11742. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11743. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11744. /* dword 4 */
  11745. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11746. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11747. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11748. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11749. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11750. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11751. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11752. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11753. /* dword 5 */
  11754. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11755. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11756. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11757. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11758. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11759. do { \
  11760. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11761. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11762. } while (0)
  11763. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11764. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11765. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11766. do { \
  11767. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11768. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11769. } while (0)
  11770. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11771. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11772. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11773. do { \
  11774. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11775. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11776. } while (0)
  11777. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11778. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11779. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11780. do { \
  11781. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11782. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11783. } while (0)
  11784. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11785. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11786. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11787. do { \
  11788. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11789. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11790. } while (0)
  11791. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11792. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11793. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11794. do { \
  11795. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11796. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11797. } while (0)
  11798. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11799. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11800. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11801. do { \
  11802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11803. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11804. } while (0)
  11805. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11806. (((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)
  11807. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11810. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11811. } while (0)
  11812. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11813. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11814. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11815. do { \
  11816. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11817. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11818. } while (0)
  11819. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11820. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11821. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11822. do { \
  11823. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11824. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11825. } while (0)
  11826. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11827. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11828. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11829. do { \
  11830. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11831. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11832. } while (0)
  11833. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11834. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11835. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11836. do { \
  11837. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11838. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11839. } while (0)
  11840. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11841. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11842. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11843. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11844. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11845. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11846. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11847. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11848. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11849. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11850. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11851. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11852. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11853. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11854. /**
  11855. * @brief target -> host rx peer unmap V2 message definition
  11856. *
  11857. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11858. *
  11859. * The following diagram shows the format of the rx peer unmap message sent
  11860. * from the target to the host.
  11861. *
  11862. * |31 24|23 16|15 8|7 0|
  11863. * |-----------------------------------------------------------------------|
  11864. * | SW peer ID | VDEV ID | msg type |
  11865. * |-----------------------------------------------------------------------|
  11866. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11867. * |-----------------------------------------------------------------------|
  11868. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11869. * |-----------------------------------------------------------------------|
  11870. * | Peer Delete Duration |
  11871. * |-----------------------------------------------------------------------|
  11872. * | Reserved_0 | WDS Free Count |
  11873. * |-----------------------------------------------------------------------|
  11874. * | Reserved_1 |
  11875. * |-----------------------------------------------------------------------|
  11876. * | Reserved_2 |
  11877. * |-----------------------------------------------------------------------|
  11878. *
  11879. *
  11880. * The following field definitions describe the format of the rx peer unmap
  11881. * messages sent from the target to the host.
  11882. * - MSG_TYPE
  11883. * Bits 7:0
  11884. * Purpose: identifies this as an rx peer unmap v2 message
  11885. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11886. * - VDEV_ID
  11887. * Bits 15:8
  11888. * Purpose: Indicates which virtual device the peer is associated
  11889. * with.
  11890. * Value: vdev ID (used in the host to look up the vdev object)
  11891. * - SW_PEER_ID
  11892. * Bits 31:16
  11893. * Purpose: The peer ID (index) that WAL is freeing
  11894. * Value: (rx) peer ID
  11895. * - MAC_ADDR_L32
  11896. * Bits 31:0
  11897. * Purpose: Identifies which peer node the peer ID is for.
  11898. * Value: lower 4 bytes of peer node's MAC address
  11899. * - MAC_ADDR_U16
  11900. * Bits 15:0
  11901. * Purpose: Identifies which peer node the peer ID is for.
  11902. * Value: upper 2 bytes of peer node's MAC address
  11903. * - NEXT_HOP
  11904. * Bits 16
  11905. * Purpose: Bit indicates next_hop AST entry used for WDS
  11906. * (Wireless Distribution System).
  11907. * - PEER_DELETE_DURATION
  11908. * Bits 31:0
  11909. * Purpose: Time taken to delete peer, in msec,
  11910. * Used for monitoring / debugging PEER delete response delay
  11911. * - PEER_WDS_FREE_COUNT
  11912. * Bits 15:0
  11913. * Purpose: Count of WDS entries deleted associated to peer deleted
  11914. */
  11915. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11916. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11917. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11918. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11919. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11920. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11921. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11922. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11923. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11924. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11925. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11926. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11927. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11928. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11929. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11930. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11931. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11932. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11933. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11934. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11935. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11936. do { \
  11937. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11938. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11939. } while (0)
  11940. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11941. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11942. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11943. do { \
  11944. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11945. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11946. } while (0)
  11947. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11948. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11949. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11950. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11951. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11952. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11953. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11954. /**
  11955. * @brief target -> host rx peer mlo map message definition
  11956. *
  11957. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11958. *
  11959. * @details
  11960. * The following diagram shows the format of the rx mlo peer map message sent
  11961. * from the target to the host. This layout assumes the target operates
  11962. * as little-endian.
  11963. *
  11964. * MCC:
  11965. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11966. *
  11967. * WIN:
  11968. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11969. * It will be sent on the Assoc Link.
  11970. *
  11971. * This message always contains a MLO peer ID. The main purpose of the
  11972. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11973. * with, so that the host can use that MLO peer ID to determine which peer
  11974. * transmitted the rx frame.
  11975. *
  11976. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11977. * |-------------------------------------------------------------------------|
  11978. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11979. * |-------------------------------------------------------------------------|
  11980. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11981. * |-------------------------------------------------------------------------|
  11982. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11983. * |-------------------------------------------------------------------------|
  11984. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11985. * |-------------------------------------------------------------------------|
  11986. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11987. * |-------------------------------------------------------------------------|
  11988. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11989. * |-------------------------------------------------------------------------|
  11990. * |RSVD |
  11991. * |-------------------------------------------------------------------------|
  11992. * |RSVD |
  11993. * |-------------------------------------------------------------------------|
  11994. * | htt_tlv_hdr_t |
  11995. * |-------------------------------------------------------------------------|
  11996. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11997. * |-------------------------------------------------------------------------|
  11998. * | htt_tlv_hdr_t |
  11999. * |-------------------------------------------------------------------------|
  12000. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12001. * |-------------------------------------------------------------------------|
  12002. * | htt_tlv_hdr_t |
  12003. * |-------------------------------------------------------------------------|
  12004. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12005. * |-------------------------------------------------------------------------|
  12006. *
  12007. * Where:
  12008. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12009. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12010. * V (valid) - 1 Bit Bit17
  12011. * CHIPID - 3 Bits
  12012. * TIDMASK - 8 Bits
  12013. * CACHE_SET_NUM - 8 Bits
  12014. *
  12015. * The following field definitions describe the format of the rx MLO peer map
  12016. * messages sent from the target to the host.
  12017. * - MSG_TYPE
  12018. * Bits 7:0
  12019. * Purpose: identifies this as an rx mlo peer map message
  12020. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12021. *
  12022. * - MLO_PEER_ID
  12023. * Bits 23:8
  12024. * Purpose: The MLO peer ID (index).
  12025. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12026. * Value: MLO peer ID
  12027. *
  12028. * - NUMLINK
  12029. * Bits: 26:24 (3Bits)
  12030. * Purpose: Indicate the max number of logical links supported per client.
  12031. * Value: number of logical links
  12032. *
  12033. * - PRC
  12034. * Bits: 29:27 (3Bits)
  12035. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12036. * if there is migration of the primary chip.
  12037. * Value: Primary REO CHIPID
  12038. *
  12039. * - MAC_ADDR_L32
  12040. * Bits 31:0
  12041. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12042. * Value: lower 4 bytes of peer node's MAC address
  12043. *
  12044. * - MAC_ADDR_U16
  12045. * Bits 15:0
  12046. * Purpose: Identifies which peer node the peer ID is for.
  12047. * Value: upper 2 bytes of peer node's MAC address
  12048. *
  12049. * - PRIMARY_TCL_AST_IDX
  12050. * Bits 15:0
  12051. * Purpose: Primary TCL AST index for this peer.
  12052. *
  12053. * - V
  12054. * 1 Bit Position 16
  12055. * Purpose: If the ast idx is valid.
  12056. *
  12057. * - CHIPID
  12058. * Bits 19:17
  12059. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12060. *
  12061. * - TIDMASK
  12062. * Bits 27:20
  12063. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12064. *
  12065. * - CACHE_SET_NUM
  12066. * Bits 31:28
  12067. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12068. * Cache set number that should be used to cache the index based
  12069. * search results, for address and flow search.
  12070. * This value should be equal to LSB four bits of the hash value
  12071. * of match data, in case of search index points to an entry which
  12072. * may be used in content based search also. The value can be
  12073. * anything when the entry pointed by search index will not be
  12074. * used for content based search.
  12075. *
  12076. * - htt_tlv_hdr_t
  12077. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12078. *
  12079. * Bits 11:0
  12080. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12081. *
  12082. * Bits 23:12
  12083. * Purpose: Length, Length of the value that follows the header
  12084. *
  12085. * Bits 31:28
  12086. * Purpose: Reserved.
  12087. *
  12088. *
  12089. * - SW_PEER_ID
  12090. * Bits 15:0
  12091. * Purpose: The peer ID (index) that WAL is allocating
  12092. * Value: (rx) peer ID
  12093. *
  12094. * - VDEV_ID
  12095. * Bits 23:16
  12096. * Purpose: Indicates which virtual device the peer is associated with.
  12097. * Value: vdev ID (used in the host to look up the vdev object)
  12098. *
  12099. * - CHIPID
  12100. * Bits 26:24
  12101. * Purpose: Indicates which Chip id the peer is associated with.
  12102. * Value: chip ID (Provided by Host as part of QMI exchange)
  12103. */
  12104. typedef enum {
  12105. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12106. } MLO_PEER_MAP_TLV_TAG_ID;
  12107. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12108. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12109. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12110. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12111. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12112. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12113. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12114. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12115. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12116. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12117. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12118. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12119. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12120. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12121. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12122. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12123. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12124. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12125. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12126. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12127. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12128. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12129. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12130. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12131. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12132. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12133. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12134. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12135. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12136. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12137. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12138. do { \
  12139. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12140. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12141. } while (0)
  12142. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12143. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12144. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12145. do { \
  12146. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12147. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12148. } while (0)
  12149. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12150. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12151. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12152. do { \
  12153. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12154. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12155. } while (0)
  12156. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12157. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12158. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12159. do { \
  12160. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12161. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12162. } while (0)
  12163. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12164. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12165. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12166. do { \
  12167. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12168. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12169. } while (0)
  12170. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12171. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12172. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12173. do { \
  12174. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12175. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12176. } while (0)
  12177. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12178. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12179. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12180. do { \
  12181. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12182. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12183. } while (0)
  12184. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12185. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12186. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12187. do { \
  12188. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12189. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12190. } while (0)
  12191. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12192. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12193. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12194. do { \
  12195. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12196. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12197. } while (0)
  12198. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12199. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12200. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12201. do { \
  12202. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12203. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12204. } while (0)
  12205. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12206. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12207. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12208. do { \
  12209. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12210. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12211. } while (0)
  12212. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12213. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12214. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12215. do { \
  12216. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12217. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12218. } while (0)
  12219. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12220. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12221. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12222. do { \
  12223. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12224. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12225. } while (0)
  12226. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12227. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12228. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12229. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12230. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12231. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12232. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12233. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12234. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12235. *
  12236. * The following diagram shows the format of the rx mlo peer unmap message sent
  12237. * from the target to the host.
  12238. *
  12239. * |31 24|23 16|15 8|7 0|
  12240. * |-----------------------------------------------------------------------|
  12241. * | RSVD_24_31 | MLO peer ID | msg type |
  12242. * |-----------------------------------------------------------------------|
  12243. */
  12244. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12245. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12246. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12247. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12248. /**
  12249. * @brief target -> host message specifying security parameters
  12250. *
  12251. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12252. *
  12253. * @details
  12254. * The following diagram shows the format of the security specification
  12255. * message sent from the target to the host.
  12256. * This security specification message tells the host whether a PN check is
  12257. * necessary on rx data frames, and if so, how large the PN counter is.
  12258. * This message also tells the host about the security processing to apply
  12259. * to defragmented rx frames - specifically, whether a Message Integrity
  12260. * Check is required, and the Michael key to use.
  12261. *
  12262. * |31 24|23 16|15|14 8|7 0|
  12263. * |-----------------------------------------------------------------------|
  12264. * | peer ID | U| security type | msg type |
  12265. * |-----------------------------------------------------------------------|
  12266. * | Michael Key K0 |
  12267. * |-----------------------------------------------------------------------|
  12268. * | Michael Key K1 |
  12269. * |-----------------------------------------------------------------------|
  12270. * | WAPI RSC Low0 |
  12271. * |-----------------------------------------------------------------------|
  12272. * | WAPI RSC Low1 |
  12273. * |-----------------------------------------------------------------------|
  12274. * | WAPI RSC Hi0 |
  12275. * |-----------------------------------------------------------------------|
  12276. * | WAPI RSC Hi1 |
  12277. * |-----------------------------------------------------------------------|
  12278. *
  12279. * The following field definitions describe the format of the security
  12280. * indication message sent from the target to the host.
  12281. * - MSG_TYPE
  12282. * Bits 7:0
  12283. * Purpose: identifies this as a security specification message
  12284. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12285. * - SEC_TYPE
  12286. * Bits 14:8
  12287. * Purpose: specifies which type of security applies to the peer
  12288. * Value: htt_sec_type enum value
  12289. * - UNICAST
  12290. * Bit 15
  12291. * Purpose: whether this security is applied to unicast or multicast data
  12292. * Value: 1 -> unicast, 0 -> multicast
  12293. * - PEER_ID
  12294. * Bits 31:16
  12295. * Purpose: The ID number for the peer the security specification is for
  12296. * Value: peer ID
  12297. * - MICHAEL_KEY_K0
  12298. * Bits 31:0
  12299. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12300. * Value: Michael Key K0 (if security type is TKIP)
  12301. * - MICHAEL_KEY_K1
  12302. * Bits 31:0
  12303. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12304. * Value: Michael Key K1 (if security type is TKIP)
  12305. * - WAPI_RSC_LOW0
  12306. * Bits 31:0
  12307. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12308. * Value: WAPI RSC Low0 (if security type is WAPI)
  12309. * - WAPI_RSC_LOW1
  12310. * Bits 31:0
  12311. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12312. * Value: WAPI RSC Low1 (if security type is WAPI)
  12313. * - WAPI_RSC_HI0
  12314. * Bits 31:0
  12315. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12316. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12317. * - WAPI_RSC_HI1
  12318. * Bits 31:0
  12319. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12320. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12321. */
  12322. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12323. #define HTT_SEC_IND_SEC_TYPE_S 8
  12324. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12325. #define HTT_SEC_IND_UNICAST_S 15
  12326. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12327. #define HTT_SEC_IND_PEER_ID_S 16
  12328. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12329. do { \
  12330. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12331. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12332. } while (0)
  12333. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12334. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12335. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12336. do { \
  12337. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12338. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12339. } while (0)
  12340. #define HTT_SEC_IND_UNICAST_GET(word) \
  12341. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12342. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12343. do { \
  12344. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12345. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12346. } while (0)
  12347. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12348. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12349. #define HTT_SEC_IND_BYTES 28
  12350. /**
  12351. * @brief target -> host rx ADDBA / DELBA message definitions
  12352. *
  12353. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12354. *
  12355. * @details
  12356. * The following diagram shows the format of the rx ADDBA message sent
  12357. * from the target to the host:
  12358. *
  12359. * |31 20|19 16|15 8|7 0|
  12360. * |---------------------------------------------------------------------|
  12361. * | peer ID | TID | window size | msg type |
  12362. * |---------------------------------------------------------------------|
  12363. *
  12364. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12365. *
  12366. * The following diagram shows the format of the rx DELBA message sent
  12367. * from the target to the host:
  12368. *
  12369. * |31 20|19 16|15 10|9 8|7 0|
  12370. * |---------------------------------------------------------------------|
  12371. * | peer ID | TID | window size | IR| msg type |
  12372. * |---------------------------------------------------------------------|
  12373. *
  12374. * The following field definitions describe the format of the rx ADDBA
  12375. * and DELBA messages sent from the target to the host.
  12376. * - MSG_TYPE
  12377. * Bits 7:0
  12378. * Purpose: identifies this as an rx ADDBA or DELBA message
  12379. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12380. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12381. * - IR (initiator / recipient)
  12382. * Bits 9:8 (DELBA only)
  12383. * Purpose: specify whether the DELBA handshake was initiated by the
  12384. * local STA/AP, or by the peer STA/AP
  12385. * Value:
  12386. * 0 - unspecified
  12387. * 1 - initiator (a.k.a. originator)
  12388. * 2 - recipient (a.k.a. responder)
  12389. * 3 - unused / reserved
  12390. * - WIN_SIZE
  12391. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12392. * Purpose: Specifies the length of the block ack window (max = 64).
  12393. * Value:
  12394. * block ack window length specified by the received ADDBA/DELBA
  12395. * management message.
  12396. * - TID
  12397. * Bits 19:16
  12398. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12399. * Value:
  12400. * TID specified by the received ADDBA or DELBA management message.
  12401. * - PEER_ID
  12402. * Bits 31:20
  12403. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12404. * Value:
  12405. * ID (hash value) used by the host for fast, direct lookup of
  12406. * host SW peer info, including rx reorder states.
  12407. */
  12408. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12409. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12410. #define HTT_RX_ADDBA_TID_M 0xf0000
  12411. #define HTT_RX_ADDBA_TID_S 16
  12412. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12413. #define HTT_RX_ADDBA_PEER_ID_S 20
  12414. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12415. do { \
  12416. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12417. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12418. } while (0)
  12419. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12420. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12421. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12422. do { \
  12423. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12424. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12425. } while (0)
  12426. #define HTT_RX_ADDBA_TID_GET(word) \
  12427. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12428. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12429. do { \
  12430. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12431. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12432. } while (0)
  12433. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12434. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12435. #define HTT_RX_ADDBA_BYTES 4
  12436. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12437. #define HTT_RX_DELBA_INITIATOR_S 8
  12438. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12439. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12440. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12441. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12442. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12443. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12444. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12445. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12446. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12447. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12448. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12451. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12452. } while (0)
  12453. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12454. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12455. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12458. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12459. } while (0)
  12460. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12461. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12462. #define HTT_RX_DELBA_BYTES 4
  12463. /**
  12464. * @brief target -> host rx ADDBA / DELBA message definitions
  12465. *
  12466. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12467. *
  12468. * @details
  12469. * The following diagram shows the format of the rx ADDBA extn message sent
  12470. * from the target to the host:
  12471. *
  12472. * |31 20|19 16|15 13|12 8|7 0|
  12473. * |---------------------------------------------------------------------|
  12474. * | peer ID | TID | reserved | msg type |
  12475. * |---------------------------------------------------------------------|
  12476. * | reserved | window size |
  12477. * |---------------------------------------------------------------------|
  12478. *
  12479. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12480. *
  12481. * The following diagram shows the format of the rx DELBA message sent
  12482. * from the target to the host:
  12483. *
  12484. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12485. * |---------------------------------------------------------------------|
  12486. * | peer ID | TID | reserved | IR| msg type |
  12487. * |---------------------------------------------------------------------|
  12488. * | reserved | window size |
  12489. * |---------------------------------------------------------------------|
  12490. *
  12491. * The following field definitions describe the format of the rx ADDBA
  12492. * and DELBA messages sent from the target to the host.
  12493. * - MSG_TYPE
  12494. * Bits 7:0
  12495. * Purpose: identifies this as an rx ADDBA or DELBA message
  12496. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12497. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12498. * - IR (initiator / recipient)
  12499. * Bits 9:8 (DELBA only)
  12500. * Purpose: specify whether the DELBA handshake was initiated by the
  12501. * local STA/AP, or by the peer STA/AP
  12502. * Value:
  12503. * 0 - unspecified
  12504. * 1 - initiator (a.k.a. originator)
  12505. * 2 - recipient (a.k.a. responder)
  12506. * 3 - unused / reserved
  12507. * Value:
  12508. * block ack window length specified by the received ADDBA/DELBA
  12509. * management message.
  12510. * - TID
  12511. * Bits 19:16
  12512. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12513. * Value:
  12514. * TID specified by the received ADDBA or DELBA management message.
  12515. * - PEER_ID
  12516. * Bits 31:20
  12517. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12518. * Value:
  12519. * ID (hash value) used by the host for fast, direct lookup of
  12520. * host SW peer info, including rx reorder states.
  12521. * == DWORD 1
  12522. * - WIN_SIZE
  12523. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12524. * Purpose: Specifies the length of the block ack window (max = 8191).
  12525. */
  12526. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12527. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12528. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12529. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12530. /*--- Dword 0 ---*/
  12531. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12532. do { \
  12533. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12534. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12535. } while (0)
  12536. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12537. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12538. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12539. do { \
  12540. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12541. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12542. } while (0)
  12543. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12544. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12545. /*--- Dword 1 ---*/
  12546. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12547. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12548. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12549. do { \
  12550. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12551. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12552. } while (0)
  12553. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12554. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12555. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12556. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12557. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12558. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12559. #define HTT_RX_DELBA_EXTN_TID_S 16
  12560. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12561. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12562. /*--- Dword 0 ---*/
  12563. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12564. do { \
  12565. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12566. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12567. } while (0)
  12568. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12569. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12570. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12571. do { \
  12572. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12573. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12574. } while (0)
  12575. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12576. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12577. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12578. do { \
  12579. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12580. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12581. } while (0)
  12582. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12583. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12584. /*--- Dword 1 ---*/
  12585. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12586. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12587. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12588. do { \
  12589. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12590. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12591. } while (0)
  12592. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12593. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12594. #define HTT_RX_DELBA_EXTN_BYTES 8
  12595. /**
  12596. * @brief tx queue group information element definition
  12597. *
  12598. * @details
  12599. * The following diagram shows the format of the tx queue group
  12600. * information element, which can be included in target --> host
  12601. * messages to specify the number of tx "credits" (tx descriptors
  12602. * for LL, or tx buffers for HL) available to a particular group
  12603. * of host-side tx queues, and which host-side tx queues belong to
  12604. * the group.
  12605. *
  12606. * |31|30 24|23 16|15|14|13 0|
  12607. * |------------------------------------------------------------------------|
  12608. * | X| reserved | tx queue grp ID | A| S| credit count |
  12609. * |------------------------------------------------------------------------|
  12610. * | vdev ID mask | AC mask |
  12611. * |------------------------------------------------------------------------|
  12612. *
  12613. * The following definitions describe the fields within the tx queue group
  12614. * information element:
  12615. * - credit_count
  12616. * Bits 13:1
  12617. * Purpose: specify how many tx credits are available to the tx queue group
  12618. * Value: An absolute or relative, positive or negative credit value
  12619. * The 'A' bit specifies whether the value is absolute or relative.
  12620. * The 'S' bit specifies whether the value is positive or negative.
  12621. * A negative value can only be relative, not absolute.
  12622. * An absolute value replaces any prior credit value the host has for
  12623. * the tx queue group in question.
  12624. * A relative value is added to the prior credit value the host has for
  12625. * the tx queue group in question.
  12626. * - sign
  12627. * Bit 14
  12628. * Purpose: specify whether the credit count is positive or negative
  12629. * Value: 0 -> positive, 1 -> negative
  12630. * - absolute
  12631. * Bit 15
  12632. * Purpose: specify whether the credit count is absolute or relative
  12633. * Value: 0 -> relative, 1 -> absolute
  12634. * - txq_group_id
  12635. * Bits 23:16
  12636. * Purpose: indicate which tx queue group's credit and/or membership are
  12637. * being specified
  12638. * Value: 0 to max_tx_queue_groups-1
  12639. * - reserved
  12640. * Bits 30:16
  12641. * Value: 0x0
  12642. * - eXtension
  12643. * Bit 31
  12644. * Purpose: specify whether another tx queue group info element follows
  12645. * Value: 0 -> no more tx queue group information elements
  12646. * 1 -> another tx queue group information element immediately follows
  12647. * - ac_mask
  12648. * Bits 15:0
  12649. * Purpose: specify which Access Categories belong to the tx queue group
  12650. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12651. * the tx queue group.
  12652. * The AC bit-mask values are obtained by left-shifting by the
  12653. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12654. * - vdev_id_mask
  12655. * Bits 31:16
  12656. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12657. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12658. * belong to the tx queue group.
  12659. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12660. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12661. */
  12662. PREPACK struct htt_txq_group {
  12663. A_UINT32
  12664. credit_count: 14,
  12665. sign: 1,
  12666. absolute: 1,
  12667. tx_queue_group_id: 8,
  12668. reserved0: 7,
  12669. extension: 1;
  12670. A_UINT32
  12671. ac_mask: 16,
  12672. vdev_id_mask: 16;
  12673. } POSTPACK;
  12674. /* first word */
  12675. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12676. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12677. #define HTT_TXQ_GROUP_SIGN_S 14
  12678. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12679. #define HTT_TXQ_GROUP_ABS_S 15
  12680. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12681. #define HTT_TXQ_GROUP_ID_S 16
  12682. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12683. #define HTT_TXQ_GROUP_EXT_S 31
  12684. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12685. /* second word */
  12686. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12687. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12688. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12689. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12690. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12693. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12694. } while (0)
  12695. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12696. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12697. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12698. do { \
  12699. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12700. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12701. } while (0)
  12702. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12703. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12704. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12705. do { \
  12706. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12707. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12708. } while (0)
  12709. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12710. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12711. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12714. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12715. } while (0)
  12716. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12717. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12718. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12719. do { \
  12720. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12721. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12722. } while (0)
  12723. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12724. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12725. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12726. do { \
  12727. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12728. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12729. } while (0)
  12730. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12731. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12732. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12733. do { \
  12734. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12735. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12736. } while (0)
  12737. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12738. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12739. /**
  12740. * @brief target -> host TX completion indication message definition
  12741. *
  12742. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12743. *
  12744. * @details
  12745. * The following diagram shows the format of the TX completion indication sent
  12746. * from the target to the host
  12747. *
  12748. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12749. * |-------------------------------------------------------------------|
  12750. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12751. * |-------------------------------------------------------------------|
  12752. * payload:| MSDU1 ID | MSDU0 ID |
  12753. * |-------------------------------------------------------------------|
  12754. * : MSDU3 ID | MSDU2 ID :
  12755. * |-------------------------------------------------------------------|
  12756. * | struct htt_tx_compl_ind_append_retries |
  12757. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12758. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12759. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12760. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12761. * |-------------------------------------------------------------------|
  12762. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12763. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12764. * | MSDU0 tx_tsf64_low |
  12765. * |-------------------------------------------------------------------|
  12766. * | MSDU0 tx_tsf64_high |
  12767. * |-------------------------------------------------------------------|
  12768. * | MSDU1 tx_tsf64_low |
  12769. * |-------------------------------------------------------------------|
  12770. * | MSDU1 tx_tsf64_high |
  12771. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12772. * | phy_timestamp |
  12773. * |-------------------------------------------------------------------|
  12774. * | rate specs (see below) |
  12775. * |-------------------------------------------------------------------|
  12776. * | seqctrl | framectrl |
  12777. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12778. * Where:
  12779. * A0 = append (a.k.a. append0)
  12780. * A1 = append1
  12781. * TP = MSDU tx power presence
  12782. * A2 = append2
  12783. * A3 = append3
  12784. * A4 = append4
  12785. *
  12786. * The following field definitions describe the format of the TX completion
  12787. * indication sent from the target to the host
  12788. * Header fields:
  12789. * - msg_type
  12790. * Bits 7:0
  12791. * Purpose: identifies this as HTT TX completion indication
  12792. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12793. * - status
  12794. * Bits 10:8
  12795. * Purpose: the TX completion status of payload fragmentations descriptors
  12796. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12797. * - tid
  12798. * Bits 14:11
  12799. * Purpose: the tid associated with those fragmentation descriptors. It is
  12800. * valid or not, depending on the tid_invalid bit.
  12801. * Value: 0 to 15
  12802. * - tid_invalid
  12803. * Bits 15:15
  12804. * Purpose: this bit indicates whether the tid field is valid or not
  12805. * Value: 0 indicates valid; 1 indicates invalid
  12806. * - num
  12807. * Bits 23:16
  12808. * Purpose: the number of payload in this indication
  12809. * Value: 1 to 255
  12810. * - append (a.k.a. append0)
  12811. * Bits 24:24
  12812. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12813. * the number of tx retries for one MSDU at the end of this message
  12814. * Value: 0 indicates no appending; 1 indicates appending
  12815. * - append1
  12816. * Bits 25:25
  12817. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12818. * contains the timestamp info for each TX msdu id in payload.
  12819. * The order of the timestamps matches the order of the MSDU IDs.
  12820. * Note that a big-endian host needs to account for the reordering
  12821. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12822. * conversion) when determining which tx timestamp corresponds to
  12823. * which MSDU ID.
  12824. * Value: 0 indicates no appending; 1 indicates appending
  12825. * - msdu_tx_power_presence
  12826. * Bits 26:26
  12827. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12828. * for each MSDU referenced by the TX_COMPL_IND message.
  12829. * The tx power is reported in 0.5 dBm units.
  12830. * The order of the per-MSDU tx power reports matches the order
  12831. * of the MSDU IDs.
  12832. * Note that a big-endian host needs to account for the reordering
  12833. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12834. * conversion) when determining which Tx Power corresponds to
  12835. * which MSDU ID.
  12836. * Value: 0 indicates MSDU tx power reports are not appended,
  12837. * 1 indicates MSDU tx power reports are appended
  12838. * - append2
  12839. * Bits 27:27
  12840. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12841. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12842. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12843. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12844. * for each MSDU, for convenience.
  12845. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12846. * this append2 bit is set).
  12847. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12848. * dB above the noise floor.
  12849. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12850. * 1 indicates MSDU ACK RSSI values are appended.
  12851. * - append3
  12852. * Bits 28:28
  12853. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12854. * contains the tx tsf info based on wlan global TSF for
  12855. * each TX msdu id in payload.
  12856. * The order of the tx tsf matches the order of the MSDU IDs.
  12857. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12858. * values to indicate the the lower 32 bits and higher 32 bits of
  12859. * the tx tsf.
  12860. * The tx_tsf64 here represents the time MSDU was acked and the
  12861. * tx_tsf64 has microseconds units.
  12862. * Value: 0 indicates no appending; 1 indicates appending
  12863. * - append4
  12864. * Bits 29:29
  12865. * Purpose: Indicate whether data frame control fields and fields required
  12866. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12867. * message. The order of the this message matches the order of
  12868. * the MSDU IDs.
  12869. * Value: 0 indicates frame control fields and fields required for
  12870. * radio tap header values are not appended,
  12871. * 1 indicates frame control fields and fields required for
  12872. * radio tap header values are appended.
  12873. * Payload fields:
  12874. * - hmsdu_id
  12875. * Bits 15:0
  12876. * Purpose: this ID is used to track the Tx buffer in host
  12877. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12878. */
  12879. PREPACK struct htt_tx_data_hdr_information {
  12880. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12881. A_UINT32 /* word 1 */
  12882. /* preamble:
  12883. * 0-OFDM,
  12884. * 1-CCk,
  12885. * 2-HT,
  12886. * 3-VHT
  12887. */
  12888. preamble: 2, /* [1:0] */
  12889. /* mcs:
  12890. * In case of HT preamble interpret
  12891. * MCS along with NSS.
  12892. * Valid values for HT are 0 to 7.
  12893. * HT mcs 0 with NSS 2 is mcs 8.
  12894. * Valid values for VHT are 0 to 9.
  12895. */
  12896. mcs: 4, /* [5:2] */
  12897. /* rate:
  12898. * This is applicable only for
  12899. * CCK and OFDM preamble type
  12900. * rate 0: OFDM 48 Mbps,
  12901. * 1: OFDM 24 Mbps,
  12902. * 2: OFDM 12 Mbps
  12903. * 3: OFDM 6 Mbps
  12904. * 4: OFDM 54 Mbps
  12905. * 5: OFDM 36 Mbps
  12906. * 6: OFDM 18 Mbps
  12907. * 7: OFDM 9 Mbps
  12908. * rate 0: CCK 11 Mbps Long
  12909. * 1: CCK 5.5 Mbps Long
  12910. * 2: CCK 2 Mbps Long
  12911. * 3: CCK 1 Mbps Long
  12912. * 4: CCK 11 Mbps Short
  12913. * 5: CCK 5.5 Mbps Short
  12914. * 6: CCK 2 Mbps Short
  12915. */
  12916. rate : 3, /* [ 8: 6] */
  12917. rssi : 8, /* [16: 9] units=dBm */
  12918. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12919. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12920. stbc : 1, /* [22] */
  12921. sgi : 1, /* [23] */
  12922. ldpc : 1, /* [24] */
  12923. beamformed: 1, /* [25] */
  12924. /* tx_retry_cnt:
  12925. * Indicates retry count of data tx frames provided by the host.
  12926. */
  12927. tx_retry_cnt: 6; /* [31:26] */
  12928. A_UINT32 /* word 2 */
  12929. framectrl:16, /* [15: 0] */
  12930. seqno:16; /* [31:16] */
  12931. } POSTPACK;
  12932. #define HTT_TX_COMPL_IND_STATUS_S 8
  12933. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12934. #define HTT_TX_COMPL_IND_TID_S 11
  12935. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12936. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12937. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12938. #define HTT_TX_COMPL_IND_NUM_S 16
  12939. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12940. #define HTT_TX_COMPL_IND_APPEND_S 24
  12941. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12942. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12943. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12944. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12945. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12946. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12947. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12948. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12949. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12950. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12951. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12952. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12953. do { \
  12954. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12955. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12956. } while (0)
  12957. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12958. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12959. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12960. do { \
  12961. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12962. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12963. } while (0)
  12964. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12965. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12966. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12967. do { \
  12968. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12969. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12970. } while (0)
  12971. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12972. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12973. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12974. do { \
  12975. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12976. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12977. } while (0)
  12978. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12979. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12980. HTT_TX_COMPL_IND_TID_INV_S)
  12981. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12982. do { \
  12983. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12984. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12985. } while (0)
  12986. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12987. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12988. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12989. do { \
  12990. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12991. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12992. } while (0)
  12993. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12994. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12995. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12996. do { \
  12997. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12998. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12999. } while (0)
  13000. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13001. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13002. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13003. do { \
  13004. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13005. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13006. } while (0)
  13007. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13008. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13009. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13010. do { \
  13011. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13012. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13013. } while (0)
  13014. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13015. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13016. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13017. do { \
  13018. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13019. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13020. } while (0)
  13021. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13022. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13023. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13024. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13025. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13026. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13027. #define HTT_TX_COMPL_IND_STAT_OK 0
  13028. /* DISCARD:
  13029. * current meaning:
  13030. * MSDUs were queued for transmission but filtered by HW or SW
  13031. * without any over the air attempts
  13032. * legacy meaning (HL Rome):
  13033. * MSDUs were discarded by the target FW without any over the air
  13034. * attempts due to lack of space
  13035. */
  13036. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13037. /* NO_ACK:
  13038. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13039. */
  13040. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13041. /* POSTPONE:
  13042. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13043. * be downloaded again later (in the appropriate order), when they are
  13044. * deliverable.
  13045. */
  13046. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13047. /*
  13048. * The PEER_DEL tx completion status is used for HL cases
  13049. * where the peer the frame is for has been deleted.
  13050. * The host has already discarded its copy of the frame, but
  13051. * it still needs the tx completion to restore its credit.
  13052. */
  13053. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13054. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13055. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13056. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13057. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13058. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13059. PREPACK struct htt_tx_compl_ind_base {
  13060. A_UINT32 hdr;
  13061. A_UINT16 payload[1/*or more*/];
  13062. } POSTPACK;
  13063. PREPACK struct htt_tx_compl_ind_append_retries {
  13064. A_UINT16 msdu_id;
  13065. A_UINT8 tx_retries;
  13066. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13067. 0: this is the last append_retries struct */
  13068. } POSTPACK;
  13069. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13070. A_UINT32 timestamp[1/*or more*/];
  13071. } POSTPACK;
  13072. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13073. A_UINT32 tx_tsf64_low;
  13074. A_UINT32 tx_tsf64_high;
  13075. } POSTPACK;
  13076. /* htt_tx_data_hdr_information payload extension fields: */
  13077. /* DWORD zero */
  13078. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13079. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13080. /* DWORD one */
  13081. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13082. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13083. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13084. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13085. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13086. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13087. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13088. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13089. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13090. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13091. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13092. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13093. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13094. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13095. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13096. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13097. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13098. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13099. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13100. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13101. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13102. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13103. /* DWORD two */
  13104. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13105. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13106. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13107. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13108. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13109. do { \
  13110. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13111. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13112. } while (0)
  13113. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13114. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13115. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13116. do { \
  13117. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13118. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13119. } while (0)
  13120. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13121. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13122. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13123. do { \
  13124. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13125. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13126. } while (0)
  13127. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13128. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13129. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13130. do { \
  13131. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13132. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13133. } while (0)
  13134. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13135. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13136. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13137. do { \
  13138. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13139. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13140. } while (0)
  13141. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13142. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13143. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13144. do { \
  13145. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13146. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13147. } while (0)
  13148. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13149. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13150. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13151. do { \
  13152. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13153. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13154. } while (0)
  13155. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13156. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13157. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13158. do { \
  13159. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13160. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13161. } while (0)
  13162. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13163. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13164. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13165. do { \
  13166. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13167. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13168. } while (0)
  13169. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13170. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13171. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13172. do { \
  13173. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13174. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13175. } while (0)
  13176. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13177. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13178. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13179. do { \
  13180. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13181. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13182. } while (0)
  13183. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13184. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13185. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13186. do { \
  13187. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13188. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13189. } while (0)
  13190. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13191. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13192. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13193. do { \
  13194. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13195. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13196. } while (0)
  13197. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13198. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13199. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13200. do { \
  13201. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13202. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13203. } while (0)
  13204. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13205. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13206. /**
  13207. * @brief target -> host rate-control update indication message
  13208. *
  13209. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13210. *
  13211. * @details
  13212. * The following diagram shows the format of the RC Update message
  13213. * sent from the target to the host, while processing the tx-completion
  13214. * of a transmitted PPDU.
  13215. *
  13216. * |31 24|23 16|15 8|7 0|
  13217. * |-------------------------------------------------------------|
  13218. * | peer ID | vdev ID | msg_type |
  13219. * |-------------------------------------------------------------|
  13220. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13221. * |-------------------------------------------------------------|
  13222. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13223. * |-------------------------------------------------------------|
  13224. * | : |
  13225. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13226. * | : |
  13227. * |-------------------------------------------------------------|
  13228. * | : |
  13229. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13230. * | : |
  13231. * |-------------------------------------------------------------|
  13232. * : :
  13233. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13234. *
  13235. */
  13236. typedef struct {
  13237. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13238. A_UINT32 rate_code_flags;
  13239. A_UINT32 flags; /* Encodes information such as excessive
  13240. retransmission, aggregate, some info
  13241. from .11 frame control,
  13242. STBC, LDPC, (SGI and Tx Chain Mask
  13243. are encoded in ptx_rc->flags field),
  13244. AMPDU truncation (BT/time based etc.),
  13245. RTS/CTS attempt */
  13246. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13247. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13248. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13249. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13250. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13251. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13252. } HTT_RC_TX_DONE_PARAMS;
  13253. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13254. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13255. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13256. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13257. #define HTT_RC_UPDATE_VDEVID_S 8
  13258. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13259. #define HTT_RC_UPDATE_PEERID_S 16
  13260. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13261. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13262. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13263. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13264. do { \
  13265. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13266. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13267. } while (0)
  13268. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13269. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13270. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13271. do { \
  13272. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13273. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13274. } while (0)
  13275. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13276. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13277. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13278. do { \
  13279. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13280. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13281. } while (0)
  13282. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13283. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13284. /**
  13285. * @brief target -> host rx fragment indication message definition
  13286. *
  13287. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13288. *
  13289. * @details
  13290. * The following field definitions describe the format of the rx fragment
  13291. * indication message sent from the target to the host.
  13292. * The rx fragment indication message shares the format of the
  13293. * rx indication message, but not all fields from the rx indication message
  13294. * are relevant to the rx fragment indication message.
  13295. *
  13296. *
  13297. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13298. * |-----------+-------------------+---------------------+-------------|
  13299. * | peer ID | |FV| ext TID | msg type |
  13300. * |-------------------------------------------------------------------|
  13301. * | | flush | flush |
  13302. * | | end | start |
  13303. * | | seq num | seq num |
  13304. * |-------------------------------------------------------------------|
  13305. * | reserved | FW rx desc bytes |
  13306. * |-------------------------------------------------------------------|
  13307. * | | FW MSDU Rx |
  13308. * | | desc B0 |
  13309. * |-------------------------------------------------------------------|
  13310. * Header fields:
  13311. * - MSG_TYPE
  13312. * Bits 7:0
  13313. * Purpose: identifies this as an rx fragment indication message
  13314. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13315. * - EXT_TID
  13316. * Bits 12:8
  13317. * Purpose: identify the traffic ID of the rx data, including
  13318. * special "extended" TID values for multicast, broadcast, and
  13319. * non-QoS data frames
  13320. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13321. * - FLUSH_VALID (FV)
  13322. * Bit 13
  13323. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13324. * is valid
  13325. * Value:
  13326. * 1 -> flush IE is valid and needs to be processed
  13327. * 0 -> flush IE is not valid and should be ignored
  13328. * - PEER_ID
  13329. * Bits 31:16
  13330. * Purpose: Identify, by ID, which peer sent the rx data
  13331. * Value: ID of the peer who sent the rx data
  13332. * - FLUSH_SEQ_NUM_START
  13333. * Bits 5:0
  13334. * Purpose: Indicate the start of a series of MPDUs to flush
  13335. * Not all MPDUs within this series are necessarily valid - the host
  13336. * must check each sequence number within this range to see if the
  13337. * corresponding MPDU is actually present.
  13338. * This field is only valid if the FV bit is set.
  13339. * Value:
  13340. * The sequence number for the first MPDUs to check to flush.
  13341. * The sequence number is masked by 0x3f.
  13342. * - FLUSH_SEQ_NUM_END
  13343. * Bits 11:6
  13344. * Purpose: Indicate the end of a series of MPDUs to flush
  13345. * Value:
  13346. * The sequence number one larger than the sequence number of the
  13347. * last MPDU to check to flush.
  13348. * The sequence number is masked by 0x3f.
  13349. * Not all MPDUs within this series are necessarily valid - the host
  13350. * must check each sequence number within this range to see if the
  13351. * corresponding MPDU is actually present.
  13352. * This field is only valid if the FV bit is set.
  13353. * Rx descriptor fields:
  13354. * - FW_RX_DESC_BYTES
  13355. * Bits 15:0
  13356. * Purpose: Indicate how many bytes in the Rx indication are used for
  13357. * FW Rx descriptors
  13358. * Value: 1
  13359. */
  13360. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13361. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13362. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13363. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13364. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13365. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13366. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13367. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13368. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13369. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13370. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13371. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13372. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13373. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13374. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13375. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13376. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13377. #define HTT_RX_FRAG_IND_BYTES \
  13378. (4 /* msg hdr */ + \
  13379. 4 /* flush spec */ + \
  13380. 4 /* (unused) FW rx desc bytes spec */ + \
  13381. 4 /* FW rx desc */)
  13382. /**
  13383. * @brief target -> host test message definition
  13384. *
  13385. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13386. *
  13387. * @details
  13388. * The following field definitions describe the format of the test
  13389. * message sent from the target to the host.
  13390. * The message consists of a 4-octet header, followed by a variable
  13391. * number of 32-bit integer values, followed by a variable number
  13392. * of 8-bit character values.
  13393. *
  13394. * |31 16|15 8|7 0|
  13395. * |-----------------------------------------------------------|
  13396. * | num chars | num ints | msg type |
  13397. * |-----------------------------------------------------------|
  13398. * | int 0 |
  13399. * |-----------------------------------------------------------|
  13400. * | int 1 |
  13401. * |-----------------------------------------------------------|
  13402. * | ... |
  13403. * |-----------------------------------------------------------|
  13404. * | char 3 | char 2 | char 1 | char 0 |
  13405. * |-----------------------------------------------------------|
  13406. * | | | ... | char 4 |
  13407. * |-----------------------------------------------------------|
  13408. * - MSG_TYPE
  13409. * Bits 7:0
  13410. * Purpose: identifies this as a test message
  13411. * Value: HTT_MSG_TYPE_TEST
  13412. * - NUM_INTS
  13413. * Bits 15:8
  13414. * Purpose: indicate how many 32-bit integers follow the message header
  13415. * - NUM_CHARS
  13416. * Bits 31:16
  13417. * Purpose: indicate how many 8-bit characters follow the series of integers
  13418. */
  13419. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13420. #define HTT_RX_TEST_NUM_INTS_S 8
  13421. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13422. #define HTT_RX_TEST_NUM_CHARS_S 16
  13423. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13424. do { \
  13425. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13426. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13427. } while (0)
  13428. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13429. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13430. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13431. do { \
  13432. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13433. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13434. } while (0)
  13435. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13436. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13437. /**
  13438. * @brief target -> host packet log message
  13439. *
  13440. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13441. *
  13442. * @details
  13443. * The following field definitions describe the format of the packet log
  13444. * message sent from the target to the host.
  13445. * The message consists of a 4-octet header,followed by a variable number
  13446. * of 32-bit character values.
  13447. *
  13448. * |31 16|15 12|11 10|9 8|7 0|
  13449. * |------------------------------------------------------------------|
  13450. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13451. * |------------------------------------------------------------------|
  13452. * | payload |
  13453. * |------------------------------------------------------------------|
  13454. * - MSG_TYPE
  13455. * Bits 7:0
  13456. * Purpose: identifies this as a pktlog message
  13457. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13458. * - mac_id
  13459. * Bits 9:8
  13460. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13461. * Value: 0-3
  13462. * - pdev_id
  13463. * Bits 11:10
  13464. * Purpose: pdev_id
  13465. * Value: 0-3
  13466. * 0 (for rings at SOC level),
  13467. * 1/2/3 PDEV -> 0/1/2
  13468. * - payload_size
  13469. * Bits 31:16
  13470. * Purpose: explicitly specify the payload size
  13471. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13472. */
  13473. PREPACK struct htt_pktlog_msg {
  13474. A_UINT32 header;
  13475. A_UINT32 payload[1/* or more */];
  13476. } POSTPACK;
  13477. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13478. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13479. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13480. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13481. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13482. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13483. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13484. do { \
  13485. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13486. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13487. } while (0)
  13488. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13489. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13490. HTT_T2H_PKTLOG_MAC_ID_S)
  13491. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13492. do { \
  13493. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13494. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13495. } while (0)
  13496. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13497. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13498. HTT_T2H_PKTLOG_PDEV_ID_S)
  13499. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13500. do { \
  13501. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13502. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13503. } while (0)
  13504. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13505. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13506. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13507. /*
  13508. * Rx reorder statistics
  13509. * NB: all the fields must be defined in 4 octets size.
  13510. */
  13511. struct rx_reorder_stats {
  13512. /* Non QoS MPDUs received */
  13513. A_UINT32 deliver_non_qos;
  13514. /* MPDUs received in-order */
  13515. A_UINT32 deliver_in_order;
  13516. /* Flush due to reorder timer expired */
  13517. A_UINT32 deliver_flush_timeout;
  13518. /* Flush due to move out of window */
  13519. A_UINT32 deliver_flush_oow;
  13520. /* Flush due to DELBA */
  13521. A_UINT32 deliver_flush_delba;
  13522. /* MPDUs dropped due to FCS error */
  13523. A_UINT32 fcs_error;
  13524. /* MPDUs dropped due to monitor mode non-data packet */
  13525. A_UINT32 mgmt_ctrl;
  13526. /* Unicast-data MPDUs dropped due to invalid peer */
  13527. A_UINT32 invalid_peer;
  13528. /* MPDUs dropped due to duplication (non aggregation) */
  13529. A_UINT32 dup_non_aggr;
  13530. /* MPDUs dropped due to processed before */
  13531. A_UINT32 dup_past;
  13532. /* MPDUs dropped due to duplicate in reorder queue */
  13533. A_UINT32 dup_in_reorder;
  13534. /* Reorder timeout happened */
  13535. A_UINT32 reorder_timeout;
  13536. /* invalid bar ssn */
  13537. A_UINT32 invalid_bar_ssn;
  13538. /* reorder reset due to bar ssn */
  13539. A_UINT32 ssn_reset;
  13540. /* Flush due to delete peer */
  13541. A_UINT32 deliver_flush_delpeer;
  13542. /* Flush due to offload*/
  13543. A_UINT32 deliver_flush_offload;
  13544. /* Flush due to out of buffer*/
  13545. A_UINT32 deliver_flush_oob;
  13546. /* MPDUs dropped due to PN check fail */
  13547. A_UINT32 pn_fail;
  13548. /* MPDUs dropped due to unable to allocate memory */
  13549. A_UINT32 store_fail;
  13550. /* Number of times the tid pool alloc succeeded */
  13551. A_UINT32 tid_pool_alloc_succ;
  13552. /* Number of times the MPDU pool alloc succeeded */
  13553. A_UINT32 mpdu_pool_alloc_succ;
  13554. /* Number of times the MSDU pool alloc succeeded */
  13555. A_UINT32 msdu_pool_alloc_succ;
  13556. /* Number of times the tid pool alloc failed */
  13557. A_UINT32 tid_pool_alloc_fail;
  13558. /* Number of times the MPDU pool alloc failed */
  13559. A_UINT32 mpdu_pool_alloc_fail;
  13560. /* Number of times the MSDU pool alloc failed */
  13561. A_UINT32 msdu_pool_alloc_fail;
  13562. /* Number of times the tid pool freed */
  13563. A_UINT32 tid_pool_free;
  13564. /* Number of times the MPDU pool freed */
  13565. A_UINT32 mpdu_pool_free;
  13566. /* Number of times the MSDU pool freed */
  13567. A_UINT32 msdu_pool_free;
  13568. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13569. A_UINT32 msdu_queued;
  13570. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13571. A_UINT32 msdu_recycled;
  13572. /* Number of MPDUs with invalid peer but A2 found in AST */
  13573. A_UINT32 invalid_peer_a2_in_ast;
  13574. /* Number of MPDUs with invalid peer but A3 found in AST */
  13575. A_UINT32 invalid_peer_a3_in_ast;
  13576. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13577. A_UINT32 invalid_peer_bmc_mpdus;
  13578. /* Number of MSDUs with err attention word */
  13579. A_UINT32 rxdesc_err_att;
  13580. /* Number of MSDUs with flag of peer_idx_invalid */
  13581. A_UINT32 rxdesc_err_peer_idx_inv;
  13582. /* Number of MSDUs with flag of peer_idx_timeout */
  13583. A_UINT32 rxdesc_err_peer_idx_to;
  13584. /* Number of MSDUs with flag of overflow */
  13585. A_UINT32 rxdesc_err_ov;
  13586. /* Number of MSDUs with flag of msdu_length_err */
  13587. A_UINT32 rxdesc_err_msdu_len;
  13588. /* Number of MSDUs with flag of mpdu_length_err */
  13589. A_UINT32 rxdesc_err_mpdu_len;
  13590. /* Number of MSDUs with flag of tkip_mic_err */
  13591. A_UINT32 rxdesc_err_tkip_mic;
  13592. /* Number of MSDUs with flag of decrypt_err */
  13593. A_UINT32 rxdesc_err_decrypt;
  13594. /* Number of MSDUs with flag of fcs_err */
  13595. A_UINT32 rxdesc_err_fcs;
  13596. /* Number of Unicast (bc_mc bit is not set in attention word)
  13597. * frames with invalid peer handler
  13598. */
  13599. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13600. /* Number of unicast frame directly (direct bit is set in attention word)
  13601. * to DUT with invalid peer handler
  13602. */
  13603. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13604. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13605. * frames with invalid peer handler
  13606. */
  13607. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13608. /* Number of MSDUs dropped due to no first MSDU flag */
  13609. A_UINT32 rxdesc_no_1st_msdu;
  13610. /* Number of MSDUs dropped due to ring overflow */
  13611. A_UINT32 msdu_drop_ring_ov;
  13612. /* Number of MSDUs dropped due to FC mismatch */
  13613. A_UINT32 msdu_drop_fc_mismatch;
  13614. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13615. A_UINT32 msdu_drop_mgmt_remote_ring;
  13616. /* Number of MSDUs dropped due to errors not reported in attention word */
  13617. A_UINT32 msdu_drop_misc;
  13618. /* Number of MSDUs go to offload before reorder */
  13619. A_UINT32 offload_msdu_wal;
  13620. /* Number of data frame dropped by offload after reorder */
  13621. A_UINT32 offload_msdu_reorder;
  13622. /* Number of MPDUs with sequence number in the past and within the BA window */
  13623. A_UINT32 dup_past_within_window;
  13624. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13625. A_UINT32 dup_past_outside_window;
  13626. /* Number of MSDUs with decrypt/MIC error */
  13627. A_UINT32 rxdesc_err_decrypt_mic;
  13628. /* Number of data MSDUs received on both local and remote rings */
  13629. A_UINT32 data_msdus_on_both_rings;
  13630. /* MPDUs never filled */
  13631. A_UINT32 holes_not_filled;
  13632. };
  13633. /*
  13634. * Rx Remote buffer statistics
  13635. * NB: all the fields must be defined in 4 octets size.
  13636. */
  13637. struct rx_remote_buffer_mgmt_stats {
  13638. /* Total number of MSDUs reaped for Rx processing */
  13639. A_UINT32 remote_reaped;
  13640. /* MSDUs recycled within firmware */
  13641. A_UINT32 remote_recycled;
  13642. /* MSDUs stored by Data Rx */
  13643. A_UINT32 data_rx_msdus_stored;
  13644. /* Number of HTT indications from WAL Rx MSDU */
  13645. A_UINT32 wal_rx_ind;
  13646. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13647. A_UINT32 wal_rx_ind_unconsumed;
  13648. /* Number of HTT indications from Data Rx MSDU */
  13649. A_UINT32 data_rx_ind;
  13650. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13651. A_UINT32 data_rx_ind_unconsumed;
  13652. /* Number of HTT indications from ATHBUF */
  13653. A_UINT32 athbuf_rx_ind;
  13654. /* Number of remote buffers requested for refill */
  13655. A_UINT32 refill_buf_req;
  13656. /* Number of remote buffers filled by the host */
  13657. A_UINT32 refill_buf_rsp;
  13658. /* Number of times MAC hw_index = f/w write_index */
  13659. A_INT32 mac_no_bufs;
  13660. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13661. A_INT32 fw_indices_equal;
  13662. /* Number of times f/w finds no buffers to post */
  13663. A_INT32 host_no_bufs;
  13664. };
  13665. /*
  13666. * TXBF MU/SU packets and NDPA statistics
  13667. * NB: all the fields must be defined in 4 octets size.
  13668. */
  13669. struct rx_txbf_musu_ndpa_pkts_stats {
  13670. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13671. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13672. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13673. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13674. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13675. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13676. };
  13677. /*
  13678. * htt_dbg_stats_status -
  13679. * present - The requested stats have been delivered in full.
  13680. * This indicates that either the stats information was contained
  13681. * in its entirety within this message, or else this message
  13682. * completes the delivery of the requested stats info that was
  13683. * partially delivered through earlier STATS_CONF messages.
  13684. * partial - The requested stats have been delivered in part.
  13685. * One or more subsequent STATS_CONF messages with the same
  13686. * cookie value will be sent to deliver the remainder of the
  13687. * information.
  13688. * error - The requested stats could not be delivered, for example due
  13689. * to a shortage of memory to construct a message holding the
  13690. * requested stats.
  13691. * invalid - The requested stat type is either not recognized, or the
  13692. * target is configured to not gather the stats type in question.
  13693. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13694. * series_done - This special value indicates that no further stats info
  13695. * elements are present within a series of stats info elems
  13696. * (within a stats upload confirmation message).
  13697. */
  13698. enum htt_dbg_stats_status {
  13699. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13700. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13701. HTT_DBG_STATS_STATUS_ERROR = 2,
  13702. HTT_DBG_STATS_STATUS_INVALID = 3,
  13703. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13704. };
  13705. /**
  13706. * @brief target -> host statistics upload
  13707. *
  13708. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13709. *
  13710. * @details
  13711. * The following field definitions describe the format of the HTT target
  13712. * to host stats upload confirmation message.
  13713. * The message contains a cookie echoed from the HTT host->target stats
  13714. * upload request, which identifies which request the confirmation is
  13715. * for, and a series of tag-length-value stats information elements.
  13716. * The tag-length header for each stats info element also includes a
  13717. * status field, to indicate whether the request for the stat type in
  13718. * question was fully met, partially met, unable to be met, or invalid
  13719. * (if the stat type in question is disabled in the target).
  13720. * A special value of all 1's in this status field is used to indicate
  13721. * the end of the series of stats info elements.
  13722. *
  13723. *
  13724. * |31 16|15 8|7 5|4 0|
  13725. * |------------------------------------------------------------|
  13726. * | reserved | msg type |
  13727. * |------------------------------------------------------------|
  13728. * | cookie LSBs |
  13729. * |------------------------------------------------------------|
  13730. * | cookie MSBs |
  13731. * |------------------------------------------------------------|
  13732. * | stats entry length | reserved | S |stat type|
  13733. * |------------------------------------------------------------|
  13734. * | |
  13735. * | type-specific stats info |
  13736. * | |
  13737. * |------------------------------------------------------------|
  13738. * | stats entry length | reserved | S |stat type|
  13739. * |------------------------------------------------------------|
  13740. * | |
  13741. * | type-specific stats info |
  13742. * | |
  13743. * |------------------------------------------------------------|
  13744. * | n/a | reserved | 111 | n/a |
  13745. * |------------------------------------------------------------|
  13746. * Header fields:
  13747. * - MSG_TYPE
  13748. * Bits 7:0
  13749. * Purpose: identifies this is a statistics upload confirmation message
  13750. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13751. * - COOKIE_LSBS
  13752. * Bits 31:0
  13753. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13754. * message with its preceding host->target stats request message.
  13755. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13756. * - COOKIE_MSBS
  13757. * Bits 31:0
  13758. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13759. * message with its preceding host->target stats request message.
  13760. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13761. *
  13762. * Stats Information Element tag-length header fields:
  13763. * - STAT_TYPE
  13764. * Bits 4:0
  13765. * Purpose: identifies the type of statistics info held in the
  13766. * following information element
  13767. * Value: htt_dbg_stats_type
  13768. * - STATUS
  13769. * Bits 7:5
  13770. * Purpose: indicate whether the requested stats are present
  13771. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13772. * the completion of the stats entry series
  13773. * - LENGTH
  13774. * Bits 31:16
  13775. * Purpose: indicate the stats information size
  13776. * Value: This field specifies the number of bytes of stats information
  13777. * that follows the element tag-length header.
  13778. * It is expected but not required that this length is a multiple of
  13779. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13780. * subsequent stats entry header will begin on a 4-byte aligned
  13781. * boundary.
  13782. */
  13783. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13784. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13785. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13786. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13787. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13788. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13789. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13790. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13791. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13792. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13793. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13794. do { \
  13795. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13796. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13797. } while (0)
  13798. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13799. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13800. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13801. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13802. do { \
  13803. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13804. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13805. } while (0)
  13806. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13807. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13808. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13809. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13810. do { \
  13811. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13812. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13813. } while (0)
  13814. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13815. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13816. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13817. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13818. #define HTT_MAX_AGGR 64
  13819. #define HTT_HL_MAX_AGGR 18
  13820. /**
  13821. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13822. *
  13823. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13824. *
  13825. * @details
  13826. * The following field definitions describe the format of the HTT host
  13827. * to target frag_desc/msdu_ext bank configuration message.
  13828. * The message contains the based address and the min and max id of the
  13829. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13830. * MSDU_EXT/FRAG_DESC.
  13831. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13832. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13833. * the hardware does the mapping/translation.
  13834. *
  13835. * Total banks that can be configured is configured to 16.
  13836. *
  13837. * This should be called before any TX has be initiated by the HTT
  13838. *
  13839. * |31 16|15 8|7 5|4 0|
  13840. * |------------------------------------------------------------|
  13841. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13842. * |------------------------------------------------------------|
  13843. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13844. #if HTT_PADDR64
  13845. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13846. #endif
  13847. * |------------------------------------------------------------|
  13848. * | ... |
  13849. * |------------------------------------------------------------|
  13850. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13851. #if HTT_PADDR64
  13852. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13853. #endif
  13854. * |------------------------------------------------------------|
  13855. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13856. * |------------------------------------------------------------|
  13857. * | ... |
  13858. * |------------------------------------------------------------|
  13859. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13860. * |------------------------------------------------------------|
  13861. * Header fields:
  13862. * - MSG_TYPE
  13863. * Bits 7:0
  13864. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13865. * for systems with 64-bit format for bus addresses:
  13866. * - BANKx_BASE_ADDRESS_LO
  13867. * Bits 31:0
  13868. * Purpose: Provide a mechanism to specify the base address of the
  13869. * MSDU_EXT bank physical/bus address.
  13870. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13871. * - BANKx_BASE_ADDRESS_HI
  13872. * Bits 31:0
  13873. * Purpose: Provide a mechanism to specify the base address of the
  13874. * MSDU_EXT bank physical/bus address.
  13875. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13876. * for systems with 32-bit format for bus addresses:
  13877. * - BANKx_BASE_ADDRESS
  13878. * Bits 31:0
  13879. * Purpose: Provide a mechanism to specify the base address of the
  13880. * MSDU_EXT bank physical/bus address.
  13881. * Value: MSDU_EXT bank physical / bus address
  13882. * - BANKx_MIN_ID
  13883. * Bits 15:0
  13884. * Purpose: Provide a mechanism to specify the min index that needs to
  13885. * mapped.
  13886. * - BANKx_MAX_ID
  13887. * Bits 31:16
  13888. * Purpose: Provide a mechanism to specify the max index that needs to
  13889. * mapped.
  13890. *
  13891. */
  13892. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13893. * safe value.
  13894. * @note MAX supported banks is 16.
  13895. */
  13896. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13897. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13898. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13899. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13900. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13901. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13902. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13903. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13904. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13905. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13906. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13907. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13908. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13909. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13910. do { \
  13911. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13912. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13913. } while (0)
  13914. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13915. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13916. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13917. do { \
  13918. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13919. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13920. } while (0)
  13921. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13922. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13923. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13924. do { \
  13925. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13926. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13927. } while (0)
  13928. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13929. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13930. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13931. do { \
  13932. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13933. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13934. } while (0)
  13935. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13936. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13937. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13938. do { \
  13939. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13940. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13941. } while (0)
  13942. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13943. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13944. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13945. do { \
  13946. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13947. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13948. } while (0)
  13949. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13950. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13951. /*
  13952. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13953. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13954. * addresses are stored in a XXX-bit field.
  13955. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13956. * htt_tx_frag_desc64_bank_cfg_t structs.
  13957. */
  13958. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13959. _paddr_bits_, \
  13960. _paddr__bank_base_address_) \
  13961. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13962. /** word 0 \
  13963. * msg_type: 8, \
  13964. * pdev_id: 2, \
  13965. * swap: 1, \
  13966. * reserved0: 5, \
  13967. * num_banks: 8, \
  13968. * desc_size: 8; \
  13969. */ \
  13970. A_UINT32 word0; \
  13971. /* \
  13972. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13973. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13974. * the second A_UINT32). \
  13975. */ \
  13976. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13977. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13978. } POSTPACK
  13979. /* define htt_tx_frag_desc32_bank_cfg_t */
  13980. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13981. /* define htt_tx_frag_desc64_bank_cfg_t */
  13982. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13983. /*
  13984. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13985. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13986. */
  13987. #if HTT_PADDR64
  13988. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13989. #else
  13990. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13991. #endif
  13992. /**
  13993. * @brief target -> host HTT TX Credit total count update message definition
  13994. *
  13995. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13996. *
  13997. *|31 16|15|14 9| 8 |7 0 |
  13998. *|---------------------+--+----------+-------+----------|
  13999. *|cur htt credit delta | Q| reserved | sign | msg type |
  14000. *|------------------------------------------------------|
  14001. *
  14002. * Header fields:
  14003. * - MSG_TYPE
  14004. * Bits 7:0
  14005. * Purpose: identifies this as a htt tx credit delta update message
  14006. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14007. * - SIGN
  14008. * Bits 8
  14009. * identifies whether credit delta is positive or negative
  14010. * Value:
  14011. * - 0x0: credit delta is positive, rebalance in some buffers
  14012. * - 0x1: credit delta is negative, rebalance out some buffers
  14013. * - reserved
  14014. * Bits 14:9
  14015. * Value: 0x0
  14016. * - TXQ_GRP
  14017. * Bit 15
  14018. * Purpose: indicates whether any tx queue group information elements
  14019. * are appended to the tx credit update message
  14020. * Value: 0 -> no tx queue group information element is present
  14021. * 1 -> a tx queue group information element immediately follows
  14022. * - DELTA_COUNT
  14023. * Bits 31:16
  14024. * Purpose: Specify current htt credit delta absolute count
  14025. */
  14026. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14027. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14028. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14029. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14030. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14031. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14032. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14033. do { \
  14034. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14035. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14036. } while (0)
  14037. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14038. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14039. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14040. do { \
  14041. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14042. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14043. } while (0)
  14044. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14045. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14046. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14047. do { \
  14048. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14049. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14050. } while (0)
  14051. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14052. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14053. #define HTT_TX_CREDIT_MSG_BYTES 4
  14054. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14055. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14056. /**
  14057. * @brief HTT WDI_IPA Operation Response Message
  14058. *
  14059. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14060. *
  14061. * @details
  14062. * HTT WDI_IPA Operation Response message is sent by target
  14063. * to host confirming suspend or resume operation.
  14064. * |31 24|23 16|15 8|7 0|
  14065. * |----------------+----------------+----------------+----------------|
  14066. * | op_code | Rsvd | msg_type |
  14067. * |-------------------------------------------------------------------|
  14068. * | Rsvd | Response len |
  14069. * |-------------------------------------------------------------------|
  14070. * | |
  14071. * | Response-type specific info |
  14072. * | |
  14073. * | |
  14074. * |-------------------------------------------------------------------|
  14075. * Header fields:
  14076. * - MSG_TYPE
  14077. * Bits 7:0
  14078. * Purpose: Identifies this as WDI_IPA Operation Response message
  14079. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14080. * - OP_CODE
  14081. * Bits 31:16
  14082. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14083. * value: = enum htt_wdi_ipa_op_code
  14084. * - RSP_LEN
  14085. * Bits 16:0
  14086. * Purpose: length for the response-type specific info
  14087. * value: = length in bytes for response-type specific info
  14088. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14089. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14090. */
  14091. PREPACK struct htt_wdi_ipa_op_response_t
  14092. {
  14093. /* DWORD 0: flags and meta-data */
  14094. A_UINT32
  14095. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14096. reserved1: 8,
  14097. op_code: 16;
  14098. A_UINT32
  14099. rsp_len: 16,
  14100. reserved2: 16;
  14101. } POSTPACK;
  14102. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14103. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14104. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14105. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14106. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14107. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14108. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14109. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14110. do { \
  14111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14112. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14113. } while (0)
  14114. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14115. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14116. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14117. do { \
  14118. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14119. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14120. } while (0)
  14121. enum htt_phy_mode {
  14122. htt_phy_mode_11a = 0,
  14123. htt_phy_mode_11g = 1,
  14124. htt_phy_mode_11b = 2,
  14125. htt_phy_mode_11g_only = 3,
  14126. htt_phy_mode_11na_ht20 = 4,
  14127. htt_phy_mode_11ng_ht20 = 5,
  14128. htt_phy_mode_11na_ht40 = 6,
  14129. htt_phy_mode_11ng_ht40 = 7,
  14130. htt_phy_mode_11ac_vht20 = 8,
  14131. htt_phy_mode_11ac_vht40 = 9,
  14132. htt_phy_mode_11ac_vht80 = 10,
  14133. htt_phy_mode_11ac_vht20_2g = 11,
  14134. htt_phy_mode_11ac_vht40_2g = 12,
  14135. htt_phy_mode_11ac_vht80_2g = 13,
  14136. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14137. htt_phy_mode_11ac_vht160 = 15,
  14138. htt_phy_mode_max,
  14139. };
  14140. /**
  14141. * @brief target -> host HTT channel change indication
  14142. *
  14143. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14144. *
  14145. * @details
  14146. * Specify when a channel change occurs.
  14147. * This allows the host to precisely determine which rx frames arrived
  14148. * on the old channel and which rx frames arrived on the new channel.
  14149. *
  14150. *|31 |7 0 |
  14151. *|-------------------------------------------+----------|
  14152. *| reserved | msg type |
  14153. *|------------------------------------------------------|
  14154. *| primary_chan_center_freq_mhz |
  14155. *|------------------------------------------------------|
  14156. *| contiguous_chan1_center_freq_mhz |
  14157. *|------------------------------------------------------|
  14158. *| contiguous_chan2_center_freq_mhz |
  14159. *|------------------------------------------------------|
  14160. *| phy_mode |
  14161. *|------------------------------------------------------|
  14162. *
  14163. * Header fields:
  14164. * - MSG_TYPE
  14165. * Bits 7:0
  14166. * Purpose: identifies this as a htt channel change indication message
  14167. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14168. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14169. * Bits 31:0
  14170. * Purpose: identify the (center of the) new 20 MHz primary channel
  14171. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14172. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14173. * Bits 31:0
  14174. * Purpose: identify the (center of the) contiguous frequency range
  14175. * comprising the new channel.
  14176. * For example, if the new channel is a 80 MHz channel extending
  14177. * 60 MHz beyond the primary channel, this field would be 30 larger
  14178. * than the primary channel center frequency field.
  14179. * Value: center frequency of the contiguous frequency range comprising
  14180. * the full channel in MHz units
  14181. * (80+80 channels also use the CONTIG_CHAN2 field)
  14182. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14183. * Bits 31:0
  14184. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14185. * within a VHT 80+80 channel.
  14186. * This field is only relevant for VHT 80+80 channels.
  14187. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14188. * channel (arbitrary value for cases besides VHT 80+80)
  14189. * - PHY_MODE
  14190. * Bits 31:0
  14191. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14192. * and band
  14193. * Value: htt_phy_mode enum value
  14194. */
  14195. PREPACK struct htt_chan_change_t
  14196. {
  14197. /* DWORD 0: flags and meta-data */
  14198. A_UINT32
  14199. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14200. reserved1: 24;
  14201. A_UINT32 primary_chan_center_freq_mhz;
  14202. A_UINT32 contig_chan1_center_freq_mhz;
  14203. A_UINT32 contig_chan2_center_freq_mhz;
  14204. A_UINT32 phy_mode;
  14205. } POSTPACK;
  14206. /*
  14207. * Due to historical / backwards-compatibility reasons, maintain the
  14208. * below htt_chan_change_msg struct definition, which needs to be
  14209. * consistent with the above htt_chan_change_t struct definition
  14210. * (aside from the htt_chan_change_t definition including the msg_type
  14211. * dword within the message, and the htt_chan_change_msg only containing
  14212. * the payload of the message that follows the msg_type dword).
  14213. */
  14214. PREPACK struct htt_chan_change_msg {
  14215. A_UINT32 chan_mhz; /* frequency in mhz */
  14216. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14217. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14218. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14219. } POSTPACK;
  14220. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14221. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14222. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14223. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14224. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14225. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14226. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14227. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14228. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14229. do { \
  14230. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14231. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14232. } while (0)
  14233. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14234. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14235. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14236. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14237. do { \
  14238. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14239. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14240. } while (0)
  14241. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14242. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14243. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14244. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14245. do { \
  14246. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14247. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14248. } while (0)
  14249. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14250. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14251. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14252. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14253. do { \
  14254. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14255. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14256. } while (0)
  14257. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14258. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14259. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14260. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14261. /**
  14262. * @brief rx offload packet error message
  14263. *
  14264. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14265. *
  14266. * @details
  14267. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14268. * of target payload like mic err.
  14269. *
  14270. * |31 24|23 16|15 8|7 0|
  14271. * |----------------+----------------+----------------+----------------|
  14272. * | tid | vdev_id | msg_sub_type | msg_type |
  14273. * |-------------------------------------------------------------------|
  14274. * : (sub-type dependent content) :
  14275. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14276. * Header fields:
  14277. * - msg_type
  14278. * Bits 7:0
  14279. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14280. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14281. * - msg_sub_type
  14282. * Bits 15:8
  14283. * Purpose: Identifies which type of rx error is reported by this message
  14284. * value: htt_rx_ofld_pkt_err_type
  14285. * - vdev_id
  14286. * Bits 23:16
  14287. * Purpose: Identifies which vdev received the erroneous rx frame
  14288. * value:
  14289. * - tid
  14290. * Bits 31:24
  14291. * Purpose: Identifies the traffic type of the rx frame
  14292. * value:
  14293. *
  14294. * - The payload fields used if the sub-type == MIC error are shown below.
  14295. * Note - MIC err is per MSDU, while PN is per MPDU.
  14296. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14297. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14298. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14299. * instead of sending separate HTT messages for each wrong MSDU within
  14300. * the MPDU.
  14301. *
  14302. * |31 24|23 16|15 8|7 0|
  14303. * |----------------+----------------+----------------+----------------|
  14304. * | Rsvd | key_id | peer_id |
  14305. * |-------------------------------------------------------------------|
  14306. * | receiver MAC addr 31:0 |
  14307. * |-------------------------------------------------------------------|
  14308. * | Rsvd | receiver MAC addr 47:32 |
  14309. * |-------------------------------------------------------------------|
  14310. * | transmitter MAC addr 31:0 |
  14311. * |-------------------------------------------------------------------|
  14312. * | Rsvd | transmitter MAC addr 47:32 |
  14313. * |-------------------------------------------------------------------|
  14314. * | PN 31:0 |
  14315. * |-------------------------------------------------------------------|
  14316. * | Rsvd | PN 47:32 |
  14317. * |-------------------------------------------------------------------|
  14318. * - peer_id
  14319. * Bits 15:0
  14320. * Purpose: identifies which peer is frame is from
  14321. * value:
  14322. * - key_id
  14323. * Bits 23:16
  14324. * Purpose: identifies key_id of rx frame
  14325. * value:
  14326. * - RA_31_0 (receiver MAC addr 31:0)
  14327. * Bits 31:0
  14328. * Purpose: identifies by MAC address which vdev received the frame
  14329. * value: MAC address lower 4 bytes
  14330. * - RA_47_32 (receiver MAC addr 47:32)
  14331. * Bits 15:0
  14332. * Purpose: identifies by MAC address which vdev received the frame
  14333. * value: MAC address upper 2 bytes
  14334. * - TA_31_0 (transmitter MAC addr 31:0)
  14335. * Bits 31:0
  14336. * Purpose: identifies by MAC address which peer transmitted the frame
  14337. * value: MAC address lower 4 bytes
  14338. * - TA_47_32 (transmitter MAC addr 47:32)
  14339. * Bits 15:0
  14340. * Purpose: identifies by MAC address which peer transmitted the frame
  14341. * value: MAC address upper 2 bytes
  14342. * - PN_31_0
  14343. * Bits 31:0
  14344. * Purpose: Identifies pn of rx frame
  14345. * value: PN lower 4 bytes
  14346. * - PN_47_32
  14347. * Bits 15:0
  14348. * Purpose: Identifies pn of rx frame
  14349. * value:
  14350. * TKIP or CCMP: PN upper 2 bytes
  14351. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14352. */
  14353. enum htt_rx_ofld_pkt_err_type {
  14354. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14355. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14356. };
  14357. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14358. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14359. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14360. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14361. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14362. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14363. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14364. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14365. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14366. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14367. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14368. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14369. do { \
  14370. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14371. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14372. } while (0)
  14373. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14374. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14375. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14376. do { \
  14377. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14378. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14379. } while (0)
  14380. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14381. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14382. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14383. do { \
  14384. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14385. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14386. } while (0)
  14387. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14388. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14389. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14390. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14391. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14392. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14393. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14394. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14395. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14396. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14397. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14398. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14399. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14400. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14401. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14402. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14403. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14404. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14405. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14406. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14407. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14408. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14409. do { \
  14410. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14411. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14412. } while (0)
  14413. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14414. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14415. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14416. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14417. do { \
  14418. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14419. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14420. } while (0)
  14421. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14422. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14423. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14424. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14425. do { \
  14426. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14427. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14428. } while (0)
  14429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14430. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14431. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14433. do { \
  14434. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14435. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14436. } while (0)
  14437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14438. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14439. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14441. do { \
  14442. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14443. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14444. } while (0)
  14445. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14446. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14447. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14448. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14449. do { \
  14450. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14451. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14452. } while (0)
  14453. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14454. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14455. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14456. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14457. do { \
  14458. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14459. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14460. } while (0)
  14461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14462. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14463. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14465. do { \
  14466. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14467. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14468. } while (0)
  14469. /**
  14470. * @brief target -> host peer rate report message
  14471. *
  14472. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14473. *
  14474. * @details
  14475. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14476. * justified rate of all the peers.
  14477. *
  14478. * |31 24|23 16|15 8|7 0|
  14479. * |----------------+----------------+----------------+----------------|
  14480. * | peer_count | | msg_type |
  14481. * |-------------------------------------------------------------------|
  14482. * : Payload (variant number of peer rate report) :
  14483. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14484. * Header fields:
  14485. * - msg_type
  14486. * Bits 7:0
  14487. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14488. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14489. * - reserved
  14490. * Bits 15:8
  14491. * Purpose:
  14492. * value:
  14493. * - peer_count
  14494. * Bits 31:16
  14495. * Purpose: Specify how many peer rate report elements are present in the payload.
  14496. * value:
  14497. *
  14498. * Payload:
  14499. * There are variant number of peer rate report follow the first 32 bits.
  14500. * The peer rate report is defined as follows.
  14501. *
  14502. * |31 20|19 16|15 0|
  14503. * |-----------------------+---------+---------------------------------|-
  14504. * | reserved | phy | peer_id | \
  14505. * |-------------------------------------------------------------------| -> report #0
  14506. * | rate | /
  14507. * |-----------------------+---------+---------------------------------|-
  14508. * | reserved | phy | peer_id | \
  14509. * |-------------------------------------------------------------------| -> report #1
  14510. * | rate | /
  14511. * |-----------------------+---------+---------------------------------|-
  14512. * | reserved | phy | peer_id | \
  14513. * |-------------------------------------------------------------------| -> report #2
  14514. * | rate | /
  14515. * |-------------------------------------------------------------------|-
  14516. * : :
  14517. * : :
  14518. * : :
  14519. * :-------------------------------------------------------------------:
  14520. *
  14521. * - peer_id
  14522. * Bits 15:0
  14523. * Purpose: identify the peer
  14524. * value:
  14525. * - phy
  14526. * Bits 19:16
  14527. * Purpose: identify which phy is in use
  14528. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14529. * Please see enum htt_peer_report_phy_type for detail.
  14530. * - reserved
  14531. * Bits 31:20
  14532. * Purpose:
  14533. * value:
  14534. * - rate
  14535. * Bits 31:0
  14536. * Purpose: represent the justified rate of the peer specified by peer_id
  14537. * value:
  14538. */
  14539. enum htt_peer_rate_report_phy_type {
  14540. HTT_PEER_RATE_REPORT_11B = 0,
  14541. HTT_PEER_RATE_REPORT_11A_G,
  14542. HTT_PEER_RATE_REPORT_11N,
  14543. HTT_PEER_RATE_REPORT_11AC,
  14544. };
  14545. #define HTT_PEER_RATE_REPORT_SIZE 8
  14546. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14547. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14548. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14549. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14550. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14551. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14552. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14553. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14554. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14555. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14556. do { \
  14557. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14558. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14559. } while (0)
  14560. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14561. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14562. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14563. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14564. do { \
  14565. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14566. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14567. } while (0)
  14568. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14569. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14570. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14571. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14572. do { \
  14573. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14574. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14575. } while (0)
  14576. /**
  14577. * @brief target -> host flow pool map message
  14578. *
  14579. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14580. *
  14581. * @details
  14582. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14583. * a flow of descriptors.
  14584. *
  14585. * This message is in TLV format and indicates the parameters to be setup a
  14586. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14587. * receive descriptors from a specified pool.
  14588. *
  14589. * The message would appear as follows:
  14590. *
  14591. * |31 24|23 16|15 8|7 0|
  14592. * |----------------+----------------+----------------+----------------|
  14593. * header | reserved | num_flows | msg_type |
  14594. * |-------------------------------------------------------------------|
  14595. * | |
  14596. * : payload :
  14597. * | |
  14598. * |-------------------------------------------------------------------|
  14599. *
  14600. * The header field is one DWORD long and is interpreted as follows:
  14601. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14602. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14603. * this message
  14604. * b'16-31 - reserved: These bits are reserved for future use
  14605. *
  14606. * Payload:
  14607. * The payload would contain multiple objects of the following structure. Each
  14608. * object represents a flow.
  14609. *
  14610. * |31 24|23 16|15 8|7 0|
  14611. * |----------------+----------------+----------------+----------------|
  14612. * header | reserved | num_flows | msg_type |
  14613. * |-------------------------------------------------------------------|
  14614. * payload0| flow_type |
  14615. * |-------------------------------------------------------------------|
  14616. * | flow_id |
  14617. * |-------------------------------------------------------------------|
  14618. * | reserved0 | flow_pool_id |
  14619. * |-------------------------------------------------------------------|
  14620. * | reserved1 | flow_pool_size |
  14621. * |-------------------------------------------------------------------|
  14622. * | reserved2 |
  14623. * |-------------------------------------------------------------------|
  14624. * payload1| flow_type |
  14625. * |-------------------------------------------------------------------|
  14626. * | flow_id |
  14627. * |-------------------------------------------------------------------|
  14628. * | reserved0 | flow_pool_id |
  14629. * |-------------------------------------------------------------------|
  14630. * | reserved1 | flow_pool_size |
  14631. * |-------------------------------------------------------------------|
  14632. * | reserved2 |
  14633. * |-------------------------------------------------------------------|
  14634. * | . |
  14635. * | . |
  14636. * | . |
  14637. * |-------------------------------------------------------------------|
  14638. *
  14639. * Each payload is 5 DWORDS long and is interpreted as follows:
  14640. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14641. * this flow is associated. It can be VDEV, peer,
  14642. * or tid (AC). Based on enum htt_flow_type.
  14643. *
  14644. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14645. * object. For flow_type vdev it is set to the
  14646. * vdevid, for peer it is peerid and for tid, it is
  14647. * tid_num.
  14648. *
  14649. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14650. * in the host for this flow
  14651. * b'16:31 - reserved0: This field in reserved for the future. In case
  14652. * we have a hierarchical implementation (HCM) of
  14653. * pools, it can be used to indicate the ID of the
  14654. * parent-pool.
  14655. *
  14656. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14657. * Descriptors for this flow will be
  14658. * allocated from this pool in the host.
  14659. * b'16:31 - reserved1: This field in reserved for the future. In case
  14660. * we have a hierarchical implementation of pools,
  14661. * it can be used to indicate the max number of
  14662. * descriptors in the pool. The b'0:15 can be used
  14663. * to indicate min number of descriptors in the
  14664. * HCM scheme.
  14665. *
  14666. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14667. * we have a hierarchical implementation of pools,
  14668. * b'0:15 can be used to indicate the
  14669. * priority-based borrowing (PBB) threshold of
  14670. * the flow's pool. The b'16:31 are still left
  14671. * reserved.
  14672. */
  14673. enum htt_flow_type {
  14674. FLOW_TYPE_VDEV = 0,
  14675. /* Insert new flow types above this line */
  14676. };
  14677. PREPACK struct htt_flow_pool_map_payload_t {
  14678. A_UINT32 flow_type;
  14679. A_UINT32 flow_id;
  14680. A_UINT32 flow_pool_id:16,
  14681. reserved0:16;
  14682. A_UINT32 flow_pool_size:16,
  14683. reserved1:16;
  14684. A_UINT32 reserved2;
  14685. } POSTPACK;
  14686. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14687. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14688. (sizeof(struct htt_flow_pool_map_payload_t))
  14689. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14690. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14691. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14692. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14693. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14694. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14695. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14696. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14697. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14698. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14699. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14700. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14701. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14702. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14703. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14704. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14705. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14706. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14707. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14708. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14709. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14710. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14711. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14712. do { \
  14713. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14714. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14715. } while (0)
  14716. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14717. do { \
  14718. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14719. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14720. } while (0)
  14721. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14722. do { \
  14723. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14724. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14725. } while (0)
  14726. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14727. do { \
  14728. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14729. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14730. } while (0)
  14731. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14732. do { \
  14733. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14734. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14735. } while (0)
  14736. /**
  14737. * @brief target -> host flow pool unmap message
  14738. *
  14739. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14740. *
  14741. * @details
  14742. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14743. * down a flow of descriptors.
  14744. * This message indicates that for the flow (whose ID is provided) is wanting
  14745. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14746. * pool of descriptors from where descriptors are being allocated for this
  14747. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14748. * be unmapped by the host.
  14749. *
  14750. * The message would appear as follows:
  14751. *
  14752. * |31 24|23 16|15 8|7 0|
  14753. * |----------------+----------------+----------------+----------------|
  14754. * | reserved0 | msg_type |
  14755. * |-------------------------------------------------------------------|
  14756. * | flow_type |
  14757. * |-------------------------------------------------------------------|
  14758. * | flow_id |
  14759. * |-------------------------------------------------------------------|
  14760. * | reserved1 | flow_pool_id |
  14761. * |-------------------------------------------------------------------|
  14762. *
  14763. * The message is interpreted as follows:
  14764. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14765. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14766. * b'8:31 - reserved0: Reserved for future use
  14767. *
  14768. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14769. * this flow is associated. It can be VDEV, peer,
  14770. * or tid (AC). Based on enum htt_flow_type.
  14771. *
  14772. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14773. * object. For flow_type vdev it is set to the
  14774. * vdevid, for peer it is peerid and for tid, it is
  14775. * tid_num.
  14776. *
  14777. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14778. * used in the host for this flow
  14779. * b'16:31 - reserved0: This field in reserved for the future.
  14780. *
  14781. */
  14782. PREPACK struct htt_flow_pool_unmap_t {
  14783. A_UINT32 msg_type:8,
  14784. reserved0:24;
  14785. A_UINT32 flow_type;
  14786. A_UINT32 flow_id;
  14787. A_UINT32 flow_pool_id:16,
  14788. reserved1:16;
  14789. } POSTPACK;
  14790. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14791. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14792. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14793. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14794. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14795. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14796. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14797. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14798. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14799. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14800. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14801. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14802. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14803. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14804. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14805. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14806. do { \
  14807. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14808. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14809. } while (0)
  14810. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14811. do { \
  14812. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14813. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14814. } while (0)
  14815. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14816. do { \
  14817. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14818. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14819. } while (0)
  14820. /**
  14821. * @brief target -> host SRING setup done message
  14822. *
  14823. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14824. *
  14825. * @details
  14826. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14827. * SRNG ring setup is done
  14828. *
  14829. * This message indicates whether the last setup operation is successful.
  14830. * It will be sent to host when host set respose_required bit in
  14831. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14832. * The message would appear as follows:
  14833. *
  14834. * |31 24|23 16|15 8|7 0|
  14835. * |--------------- +----------------+----------------+----------------|
  14836. * | setup_status | ring_id | pdev_id | msg_type |
  14837. * |-------------------------------------------------------------------|
  14838. *
  14839. * The message is interpreted as follows:
  14840. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14841. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14842. * b'8:15 - pdev_id:
  14843. * 0 (for rings at SOC/UMAC level),
  14844. * 1/2/3 mac id (for rings at LMAC level)
  14845. * b'16:23 - ring_id: Identify the ring which is set up
  14846. * More details can be got from enum htt_srng_ring_id
  14847. * b'24:31 - setup_status: Indicate status of setup operation
  14848. * Refer to htt_ring_setup_status
  14849. */
  14850. PREPACK struct htt_sring_setup_done_t {
  14851. A_UINT32 msg_type: 8,
  14852. pdev_id: 8,
  14853. ring_id: 8,
  14854. setup_status: 8;
  14855. } POSTPACK;
  14856. enum htt_ring_setup_status {
  14857. htt_ring_setup_status_ok = 0,
  14858. htt_ring_setup_status_error,
  14859. };
  14860. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14861. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14862. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14863. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14864. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14865. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14866. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14867. do { \
  14868. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14869. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14870. } while (0)
  14871. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14872. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14873. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14874. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14875. HTT_SRING_SETUP_DONE_RING_ID_S)
  14876. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14877. do { \
  14878. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14879. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14880. } while (0)
  14881. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14882. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14883. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14884. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14885. HTT_SRING_SETUP_DONE_STATUS_S)
  14886. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14887. do { \
  14888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14889. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14890. } while (0)
  14891. /**
  14892. * @brief target -> flow map flow info
  14893. *
  14894. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14895. *
  14896. * @details
  14897. * HTT TX map flow entry with tqm flow pointer
  14898. * Sent from firmware to host to add tqm flow pointer in corresponding
  14899. * flow search entry. Flow metadata is replayed back to host as part of this
  14900. * struct to enable host to find the specific flow search entry
  14901. *
  14902. * The message would appear as follows:
  14903. *
  14904. * |31 28|27 18|17 14|13 8|7 0|
  14905. * |-------+------------------------------------------+----------------|
  14906. * | rsvd0 | fse_hsh_idx | msg_type |
  14907. * |-------------------------------------------------------------------|
  14908. * | rsvd1 | tid | peer_id |
  14909. * |-------------------------------------------------------------------|
  14910. * | tqm_flow_pntr_lo |
  14911. * |-------------------------------------------------------------------|
  14912. * | tqm_flow_pntr_hi |
  14913. * |-------------------------------------------------------------------|
  14914. * | fse_meta_data |
  14915. * |-------------------------------------------------------------------|
  14916. *
  14917. * The message is interpreted as follows:
  14918. *
  14919. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14920. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14921. *
  14922. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14923. * for this flow entry
  14924. *
  14925. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14926. *
  14927. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14928. *
  14929. * dword1 - b'14:17 - tid
  14930. *
  14931. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14932. *
  14933. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14934. *
  14935. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14936. *
  14937. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14938. * given by host
  14939. */
  14940. PREPACK struct htt_tx_map_flow_info {
  14941. A_UINT32
  14942. msg_type: 8,
  14943. fse_hsh_idx: 20,
  14944. rsvd0: 4;
  14945. A_UINT32
  14946. peer_id: 14,
  14947. tid: 4,
  14948. rsvd1: 14;
  14949. A_UINT32 tqm_flow_pntr_lo;
  14950. A_UINT32 tqm_flow_pntr_hi;
  14951. struct htt_tx_flow_metadata fse_meta_data;
  14952. } POSTPACK;
  14953. /* DWORD 0 */
  14954. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14955. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14956. /* DWORD 1 */
  14957. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14958. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14959. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14960. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14961. /* DWORD 0 */
  14962. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14963. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14964. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14965. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14966. do { \
  14967. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14968. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14969. } while (0)
  14970. /* DWORD 1 */
  14971. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14972. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14973. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14974. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14975. do { \
  14976. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14977. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14978. } while (0)
  14979. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14980. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14981. HTT_TX_MAP_FLOW_INFO_TID_S)
  14982. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14983. do { \
  14984. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14985. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14986. } while (0)
  14987. /*
  14988. * htt_dbg_ext_stats_status -
  14989. * present - The requested stats have been delivered in full.
  14990. * This indicates that either the stats information was contained
  14991. * in its entirety within this message, or else this message
  14992. * completes the delivery of the requested stats info that was
  14993. * partially delivered through earlier STATS_CONF messages.
  14994. * partial - The requested stats have been delivered in part.
  14995. * One or more subsequent STATS_CONF messages with the same
  14996. * cookie value will be sent to deliver the remainder of the
  14997. * information.
  14998. * error - The requested stats could not be delivered, for example due
  14999. * to a shortage of memory to construct a message holding the
  15000. * requested stats.
  15001. * invalid - The requested stat type is either not recognized, or the
  15002. * target is configured to not gather the stats type in question.
  15003. */
  15004. enum htt_dbg_ext_stats_status {
  15005. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15006. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15007. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15008. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15009. };
  15010. /**
  15011. * @brief target -> host ppdu stats upload
  15012. *
  15013. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15014. *
  15015. * @details
  15016. * The following field definitions describe the format of the HTT target
  15017. * to host ppdu stats indication message.
  15018. *
  15019. *
  15020. * |31 16|15 12|11 10|9 8|7 0 |
  15021. * |----------------------------------------------------------------------|
  15022. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15023. * |----------------------------------------------------------------------|
  15024. * | ppdu_id |
  15025. * |----------------------------------------------------------------------|
  15026. * | Timestamp in us |
  15027. * |----------------------------------------------------------------------|
  15028. * | reserved |
  15029. * |----------------------------------------------------------------------|
  15030. * | type-specific stats info |
  15031. * | (see htt_ppdu_stats.h) |
  15032. * |----------------------------------------------------------------------|
  15033. * Header fields:
  15034. * - MSG_TYPE
  15035. * Bits 7:0
  15036. * Purpose: Identifies this is a PPDU STATS indication
  15037. * message.
  15038. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15039. * - mac_id
  15040. * Bits 9:8
  15041. * Purpose: mac_id of this ppdu_id
  15042. * Value: 0-3
  15043. * - pdev_id
  15044. * Bits 11:10
  15045. * Purpose: pdev_id of this ppdu_id
  15046. * Value: 0-3
  15047. * 0 (for rings at SOC level),
  15048. * 1/2/3 PDEV -> 0/1/2
  15049. * - payload_size
  15050. * Bits 31:16
  15051. * Purpose: total tlv size
  15052. * Value: payload_size in bytes
  15053. */
  15054. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15055. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15056. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15057. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15058. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15059. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15060. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15061. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15062. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15063. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15064. do { \
  15065. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15066. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15067. } while (0)
  15068. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15069. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15070. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15071. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15072. do { \
  15073. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15074. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15075. } while (0)
  15076. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15077. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15078. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15079. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15080. do { \
  15081. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15082. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15083. } while (0)
  15084. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15085. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15086. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15087. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15088. do { \
  15089. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15090. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15091. } while (0)
  15092. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15093. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15094. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15095. /* htt_t2h_ppdu_stats_ind_hdr_t
  15096. * This struct contains the fields within the header of the
  15097. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15098. * stats info.
  15099. * This struct assumes little-endian layout, and thus is only
  15100. * suitable for use within processors known to be little-endian
  15101. * (such as the target).
  15102. * In contrast, the above macros provide endian-portable methods
  15103. * to get and set the bitfields within this PPDU_STATS_IND header.
  15104. */
  15105. typedef struct {
  15106. A_UINT32 msg_type: 8, /* bits 7:0 */
  15107. mac_id: 2, /* bits 9:8 */
  15108. pdev_id: 2, /* bits 11:10 */
  15109. reserved1: 4, /* bits 15:12 */
  15110. payload_size: 16; /* bits 31:16 */
  15111. A_UINT32 ppdu_id;
  15112. A_UINT32 timestamp_us;
  15113. A_UINT32 reserved2;
  15114. } htt_t2h_ppdu_stats_ind_hdr_t;
  15115. /**
  15116. * @brief target -> host extended statistics upload
  15117. *
  15118. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15119. *
  15120. * @details
  15121. * The following field definitions describe the format of the HTT target
  15122. * to host stats upload confirmation message.
  15123. * The message contains a cookie echoed from the HTT host->target stats
  15124. * upload request, which identifies which request the confirmation is
  15125. * for, and a single stats can span over multiple HTT stats indication
  15126. * due to the HTT message size limitation so every HTT ext stats indication
  15127. * will have tag-length-value stats information elements.
  15128. * The tag-length header for each HTT stats IND message also includes a
  15129. * status field, to indicate whether the request for the stat type in
  15130. * question was fully met, partially met, unable to be met, or invalid
  15131. * (if the stat type in question is disabled in the target).
  15132. * A Done bit 1's indicate the end of the of stats info elements.
  15133. *
  15134. *
  15135. * |31 16|15 12|11|10 8|7 5|4 0|
  15136. * |--------------------------------------------------------------|
  15137. * | reserved | msg type |
  15138. * |--------------------------------------------------------------|
  15139. * | cookie LSBs |
  15140. * |--------------------------------------------------------------|
  15141. * | cookie MSBs |
  15142. * |--------------------------------------------------------------|
  15143. * | stats entry length | rsvd | D| S | stat type |
  15144. * |--------------------------------------------------------------|
  15145. * | type-specific stats info |
  15146. * | (see htt_stats.h) |
  15147. * |--------------------------------------------------------------|
  15148. * Header fields:
  15149. * - MSG_TYPE
  15150. * Bits 7:0
  15151. * Purpose: Identifies this is a extended statistics upload confirmation
  15152. * message.
  15153. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15154. * - COOKIE_LSBS
  15155. * Bits 31:0
  15156. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15157. * message with its preceding host->target stats request message.
  15158. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15159. * - COOKIE_MSBS
  15160. * Bits 31:0
  15161. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15162. * message with its preceding host->target stats request message.
  15163. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15164. *
  15165. * Stats Information Element tag-length header fields:
  15166. * - STAT_TYPE
  15167. * Bits 7:0
  15168. * Purpose: identifies the type of statistics info held in the
  15169. * following information element
  15170. * Value: htt_dbg_ext_stats_type
  15171. * - STATUS
  15172. * Bits 10:8
  15173. * Purpose: indicate whether the requested stats are present
  15174. * Value: htt_dbg_ext_stats_status
  15175. * - DONE
  15176. * Bits 11
  15177. * Purpose:
  15178. * Indicates the completion of the stats entry, this will be the last
  15179. * stats conf HTT segment for the requested stats type.
  15180. * Value:
  15181. * 0 -> the stats retrieval is ongoing
  15182. * 1 -> the stats retrieval is complete
  15183. * - LENGTH
  15184. * Bits 31:16
  15185. * Purpose: indicate the stats information size
  15186. * Value: This field specifies the number of bytes of stats information
  15187. * that follows the element tag-length header.
  15188. * It is expected but not required that this length is a multiple of
  15189. * 4 bytes.
  15190. */
  15191. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15192. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15193. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15194. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15195. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15196. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15197. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15198. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15199. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15200. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15201. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15202. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15203. do { \
  15204. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15205. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15206. } while (0)
  15207. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15208. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15209. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15210. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15211. do { \
  15212. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15213. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15214. } while (0)
  15215. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15216. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15217. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15218. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15219. do { \
  15220. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15221. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15222. } while (0)
  15223. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15224. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15225. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15226. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15227. do { \
  15228. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15229. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15230. } while (0)
  15231. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15232. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15233. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15234. /**
  15235. * @brief target -> host streaming statistics upload
  15236. *
  15237. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15238. *
  15239. * @details
  15240. * The following field definitions describe the format of the HTT target
  15241. * to host streaming stats upload indication message.
  15242. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15243. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15244. * use the STREAMING_STATS_REQ message to halt the target's production of
  15245. * STREAMING_STATS_IND messages.
  15246. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15247. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15248. *
  15249. * |31 8|7 0|
  15250. * |--------------------------------------------------------------|
  15251. * | reserved | msg type |
  15252. * |--------------------------------------------------------------|
  15253. * | type-specific stats info |
  15254. * | (see htt_stats.h) |
  15255. * |--------------------------------------------------------------|
  15256. * Header fields:
  15257. * - MSG_TYPE
  15258. * Bits 7:0
  15259. * Purpose: Identifies this as a streaming statistics upload indication
  15260. * message.
  15261. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15262. */
  15263. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15264. typedef enum {
  15265. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15266. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15267. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15268. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15269. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15270. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15271. /* Reserved from 128 - 255 for target internal use.*/
  15272. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15273. } HTT_PEER_TYPE;
  15274. /** macro to convert MAC address from char array to HTT word format */
  15275. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15276. (phtt_mac_addr)->mac_addr31to0 = \
  15277. (((c_macaddr)[0] << 0) | \
  15278. ((c_macaddr)[1] << 8) | \
  15279. ((c_macaddr)[2] << 16) | \
  15280. ((c_macaddr)[3] << 24)); \
  15281. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15282. } while (0)
  15283. /**
  15284. * @brief target -> host monitor mac header indication message
  15285. *
  15286. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15287. *
  15288. * @details
  15289. * The following diagram shows the format of the monitor mac header message
  15290. * sent from the target to the host.
  15291. * This message is primarily sent when promiscuous rx mode is enabled.
  15292. * One message is sent per rx PPDU.
  15293. *
  15294. * |31 24|23 16|15 8|7 0|
  15295. * |-------------------------------------------------------------|
  15296. * | peer_id | reserved0 | msg_type |
  15297. * |-------------------------------------------------------------|
  15298. * | reserved1 | num_mpdu |
  15299. * |-------------------------------------------------------------|
  15300. * | struct hw_rx_desc |
  15301. * | (see wal_rx_desc.h) |
  15302. * |-------------------------------------------------------------|
  15303. * | struct ieee80211_frame_addr4 |
  15304. * | (see ieee80211_defs.h) |
  15305. * |-------------------------------------------------------------|
  15306. * | struct ieee80211_frame_addr4 |
  15307. * | (see ieee80211_defs.h) |
  15308. * |-------------------------------------------------------------|
  15309. * | ...... |
  15310. * |-------------------------------------------------------------|
  15311. *
  15312. * Header fields:
  15313. * - msg_type
  15314. * Bits 7:0
  15315. * Purpose: Identifies this is a monitor mac header indication message.
  15316. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15317. * - peer_id
  15318. * Bits 31:16
  15319. * Purpose: Software peer id given by host during association,
  15320. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15321. * for rx PPDUs received from unassociated peers.
  15322. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15323. * - num_mpdu
  15324. * Bits 15:0
  15325. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15326. * delivered within the message.
  15327. * Value: 1 to 32
  15328. * num_mpdu is limited to a maximum value of 32, due to buffer
  15329. * size limits. For PPDUs with more than 32 MPDUs, only the
  15330. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15331. * the PPDU will be provided.
  15332. */
  15333. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15334. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15335. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15336. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15337. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15338. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15339. do { \
  15340. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15341. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15342. } while (0)
  15343. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15344. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15345. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15346. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15347. do { \
  15348. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15349. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15350. } while (0)
  15351. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15352. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15353. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15354. /**
  15355. * @brief target -> host flow pool resize Message
  15356. *
  15357. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15358. *
  15359. * @details
  15360. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15361. * the flow pool associated with the specified ID is resized
  15362. *
  15363. * The message would appear as follows:
  15364. *
  15365. * |31 16|15 8|7 0|
  15366. * |---------------------------------+----------------+----------------|
  15367. * | reserved0 | Msg type |
  15368. * |-------------------------------------------------------------------|
  15369. * | flow pool new size | flow pool ID |
  15370. * |-------------------------------------------------------------------|
  15371. *
  15372. * The message is interpreted as follows:
  15373. * b'0:7 - msg_type: This will be set to 0x21
  15374. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15375. *
  15376. * b'0:15 - flow pool ID: Existing flow pool ID
  15377. *
  15378. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15379. *
  15380. */
  15381. PREPACK struct htt_flow_pool_resize_t {
  15382. A_UINT32 msg_type:8,
  15383. reserved0:24;
  15384. A_UINT32 flow_pool_id:16,
  15385. flow_pool_new_size:16;
  15386. } POSTPACK;
  15387. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15388. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15389. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15390. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15391. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15392. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15393. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15394. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15395. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15396. do { \
  15397. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15398. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15399. } while (0)
  15400. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15401. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15402. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15403. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15404. do { \
  15405. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15406. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15407. } while (0)
  15408. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15409. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15410. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15411. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15412. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15413. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15414. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15415. /*
  15416. * The read and write indices point to the data within the host buffer.
  15417. * Because the first 4 bytes of the host buffer is used for the read index and
  15418. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15419. * The read index and write index are the byte offsets from the base of the
  15420. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15421. * Refer the ASCII text picture below.
  15422. */
  15423. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15424. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15425. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15426. /*
  15427. ***************************************************************************
  15428. *
  15429. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15430. *
  15431. ***************************************************************************
  15432. *
  15433. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15434. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15435. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15436. * written into the Host memory region mentioned below.
  15437. *
  15438. * Read index is updated by the Host. At any point of time, the read index will
  15439. * indicate the index that will next be read by the Host. The read index is
  15440. * in units of bytes offset from the base of the meta-data buffer.
  15441. *
  15442. * Write index is updated by the FW. At any point of time, the write index will
  15443. * indicate from where the FW can start writing any new data. The write index is
  15444. * in units of bytes offset from the base of the meta-data buffer.
  15445. *
  15446. * If the Host is not fast enough in reading the CFR data, any new capture data
  15447. * would be dropped if there is no space left to write the new captures.
  15448. *
  15449. * The last 4 bytes of the memory region will have the magic pattern
  15450. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15451. * not overrun the host buffer.
  15452. *
  15453. * ,--------------------. read and write indices store the
  15454. * | | byte offset from the base of the
  15455. * | ,--------+--------. meta-data buffer to the next
  15456. * | | | | location within the data buffer
  15457. * | | v v that will be read / written
  15458. * ************************************************************************
  15459. * * Read * Write * * Magic *
  15460. * * index * index * CFR data1 ...... CFR data N * pattern *
  15461. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15462. * ************************************************************************
  15463. * |<---------- data buffer ---------->|
  15464. *
  15465. * |<----------------- meta-data buffer allocated in Host ----------------|
  15466. *
  15467. * Note:
  15468. * - Considering the 4 bytes needed to store the Read index (R) and the
  15469. * Write index (W), the initial value is as follows:
  15470. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15471. * - Buffer empty condition:
  15472. * R = W
  15473. *
  15474. * Regarding CFR data format:
  15475. * --------------------------
  15476. *
  15477. * Each CFR tone is stored in HW as 16-bits with the following format:
  15478. * {bits[15:12], bits[11:6], bits[5:0]} =
  15479. * {unsigned exponent (4 bits),
  15480. * signed mantissa_real (6 bits),
  15481. * signed mantissa_imag (6 bits)}
  15482. *
  15483. * CFR_real = mantissa_real * 2^(exponent-5)
  15484. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15485. *
  15486. *
  15487. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15488. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15489. *
  15490. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15491. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15492. * .
  15493. * .
  15494. * .
  15495. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15496. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15497. */
  15498. /* Bandwidth of peer CFR captures */
  15499. typedef enum {
  15500. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15501. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15502. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15503. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15504. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15505. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15506. } HTT_PEER_CFR_CAPTURE_BW;
  15507. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15508. * was captured
  15509. */
  15510. typedef enum {
  15511. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15512. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15513. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15514. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15515. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15516. } HTT_PEER_CFR_CAPTURE_MODE;
  15517. typedef enum {
  15518. /* This message type is currently used for the below purpose:
  15519. *
  15520. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15521. * wmi_peer_cfr_capture_cmd.
  15522. * If payload_present bit is set to 0 then the associated memory region
  15523. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15524. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15525. * message; the CFR dump will be present at the end of the message,
  15526. * after the chan_phy_mode.
  15527. */
  15528. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15529. /* Always keep this last */
  15530. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15531. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15532. /**
  15533. * @brief target -> host CFR dump completion indication message definition
  15534. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15535. *
  15536. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15537. *
  15538. * @details
  15539. * The following diagram shows the format of the Channel Frequency Response
  15540. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15541. * the channel capture of a peer is copied by Firmware into the Host memory
  15542. *
  15543. * **************************************************************************
  15544. *
  15545. * Message format when the CFR capture message type is
  15546. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15547. *
  15548. * **************************************************************************
  15549. *
  15550. * |31 16|15 |8|7 0|
  15551. * |----------------------------------------------------------------|
  15552. * header: | reserved |P| msg_type |
  15553. * word 0 | | | |
  15554. * |----------------------------------------------------------------|
  15555. * payload: | cfr_capture_msg_type |
  15556. * word 1 | |
  15557. * |----------------------------------------------------------------|
  15558. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15559. * word 2 | | | | | | | | |
  15560. * |----------------------------------------------------------------|
  15561. * | mac_addr31to0 |
  15562. * word 3 | |
  15563. * |----------------------------------------------------------------|
  15564. * | unused / reserved | mac_addr47to32 |
  15565. * word 4 | | |
  15566. * |----------------------------------------------------------------|
  15567. * | index |
  15568. * word 5 | |
  15569. * |----------------------------------------------------------------|
  15570. * | length |
  15571. * word 6 | |
  15572. * |----------------------------------------------------------------|
  15573. * | timestamp |
  15574. * word 7 | |
  15575. * |----------------------------------------------------------------|
  15576. * | counter |
  15577. * word 8 | |
  15578. * |----------------------------------------------------------------|
  15579. * | chan_mhz |
  15580. * word 9 | |
  15581. * |----------------------------------------------------------------|
  15582. * | band_center_freq1 |
  15583. * word 10 | |
  15584. * |----------------------------------------------------------------|
  15585. * | band_center_freq2 |
  15586. * word 11 | |
  15587. * |----------------------------------------------------------------|
  15588. * | chan_phy_mode |
  15589. * word 12 | |
  15590. * |----------------------------------------------------------------|
  15591. * where,
  15592. * P - payload present bit (payload_present explained below)
  15593. * req_id - memory request id (mem_req_id explained below)
  15594. * S - status field (status explained below)
  15595. * capbw - capture bandwidth (capture_bw explained below)
  15596. * mode - mode of capture (mode explained below)
  15597. * sts - space time streams (sts_count explained below)
  15598. * chbw - channel bandwidth (channel_bw explained below)
  15599. * captype - capture type (cap_type explained below)
  15600. *
  15601. * The following field definitions describe the format of the CFR dump
  15602. * completion indication sent from the target to the host
  15603. *
  15604. * Header fields:
  15605. *
  15606. * Word 0
  15607. * - msg_type
  15608. * Bits 7:0
  15609. * Purpose: Identifies this as CFR TX completion indication
  15610. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15611. * - payload_present
  15612. * Bit 8
  15613. * Purpose: Identifies how CFR data is sent to host
  15614. * Value: 0 - If CFR Payload is written to host memory
  15615. * 1 - If CFR Payload is sent as part of HTT message
  15616. * (This is the requirement for SDIO/USB where it is
  15617. * not possible to write CFR data to host memory)
  15618. * - reserved
  15619. * Bits 31:9
  15620. * Purpose: Reserved
  15621. * Value: 0
  15622. *
  15623. * Payload fields:
  15624. *
  15625. * Word 1
  15626. * - cfr_capture_msg_type
  15627. * Bits 31:0
  15628. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15629. * to specify the format used for the remainder of the message
  15630. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15631. * (currently only MSG_TYPE_1 is defined)
  15632. *
  15633. * Word 2
  15634. * - mem_req_id
  15635. * Bits 6:0
  15636. * Purpose: Contain the mem request id of the region where the CFR capture
  15637. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15638. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15639. this value is invalid)
  15640. * - status
  15641. * Bit 7
  15642. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15643. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15644. * - capture_bw
  15645. * Bits 10:8
  15646. * Purpose: Carry the bandwidth of the CFR capture
  15647. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15648. * - mode
  15649. * Bits 13:11
  15650. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15651. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15652. * - sts_count
  15653. * Bits 16:14
  15654. * Purpose: Carry the number of space time streams
  15655. * Value: Number of space time streams
  15656. * - channel_bw
  15657. * Bits 19:17
  15658. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15659. * measurement
  15660. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15661. * - cap_type
  15662. * Bits 23:20
  15663. * Purpose: Carry the type of the capture
  15664. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15665. * - vdev_id
  15666. * Bits 31:24
  15667. * Purpose: Carry the virtual device id
  15668. * Value: vdev ID
  15669. *
  15670. * Word 3
  15671. * - mac_addr31to0
  15672. * Bits 31:0
  15673. * Purpose: Contain the bits 31:0 of the peer MAC address
  15674. * Value: Bits 31:0 of the peer MAC address
  15675. *
  15676. * Word 4
  15677. * - mac_addr47to32
  15678. * Bits 15:0
  15679. * Purpose: Contain the bits 47:32 of the peer MAC address
  15680. * Value: Bits 47:32 of the peer MAC address
  15681. *
  15682. * Word 5
  15683. * - index
  15684. * Bits 31:0
  15685. * Purpose: Contain the index at which this CFR dump was written in the Host
  15686. * allocated memory. This index is the number of bytes from the base address.
  15687. * Value: Index position
  15688. *
  15689. * Word 6
  15690. * - length
  15691. * Bits 31:0
  15692. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15693. * Value: Length of the CFR capture of the peer
  15694. *
  15695. * Word 7
  15696. * - timestamp
  15697. * Bits 31:0
  15698. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15699. * clock used for this timestamp is private to the target and not visible to
  15700. * the host i.e., Host can interpret only the relative timestamp deltas from
  15701. * one message to the next, but can't interpret the absolute timestamp from a
  15702. * single message.
  15703. * Value: Timestamp in microseconds
  15704. *
  15705. * Word 8
  15706. * - counter
  15707. * Bits 31:0
  15708. * Purpose: Carry the count of the current CFR capture from FW. This is
  15709. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15710. * in host memory)
  15711. * Value: Count of the current CFR capture
  15712. *
  15713. * Word 9
  15714. * - chan_mhz
  15715. * Bits 31:0
  15716. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15717. * Value: Primary 20 channel frequency
  15718. *
  15719. * Word 10
  15720. * - band_center_freq1
  15721. * Bits 31:0
  15722. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15723. * Value: Center frequency 1 in MHz
  15724. *
  15725. * Word 11
  15726. * - band_center_freq2
  15727. * Bits 31:0
  15728. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15729. * the VDEV
  15730. * 80plus80 mode
  15731. * Value: Center frequency 2 in MHz
  15732. *
  15733. * Word 12
  15734. * - chan_phy_mode
  15735. * Bits 31:0
  15736. * Purpose: Carry the phy mode of the channel, of the VDEV
  15737. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15738. */
  15739. PREPACK struct htt_cfr_dump_ind_type_1 {
  15740. A_UINT32 mem_req_id:7,
  15741. status:1,
  15742. capture_bw:3,
  15743. mode:3,
  15744. sts_count:3,
  15745. channel_bw:3,
  15746. cap_type:4,
  15747. vdev_id:8;
  15748. htt_mac_addr addr;
  15749. A_UINT32 index;
  15750. A_UINT32 length;
  15751. A_UINT32 timestamp;
  15752. A_UINT32 counter;
  15753. struct htt_chan_change_msg chan;
  15754. } POSTPACK;
  15755. PREPACK struct htt_cfr_dump_compl_ind {
  15756. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15757. union {
  15758. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15759. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15760. /* If there is a need to change the memory layout and its associated
  15761. * HTT indication format, a new CFR capture message type can be
  15762. * introduced and added into this union.
  15763. */
  15764. };
  15765. } POSTPACK;
  15766. /*
  15767. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15768. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15769. */
  15770. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15771. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15772. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15773. do { \
  15774. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15775. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15776. } while(0)
  15777. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15778. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15779. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15780. /*
  15781. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15782. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15783. */
  15784. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15785. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15786. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15787. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15788. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15789. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15790. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15791. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15792. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15793. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15794. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15795. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15796. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15797. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15798. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15799. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15800. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15801. do { \
  15802. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15803. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15804. } while (0)
  15805. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15806. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15807. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15808. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15809. do { \
  15810. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15811. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15812. } while (0)
  15813. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15814. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15815. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15816. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15817. do { \
  15818. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15819. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15820. } while (0)
  15821. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15822. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15823. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15824. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15825. do { \
  15826. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15827. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15828. } while (0)
  15829. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15830. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15831. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15832. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15833. do { \
  15834. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15835. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15836. } while (0)
  15837. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15838. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15839. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15840. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15841. do { \
  15842. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15843. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15844. } while (0)
  15845. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15846. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15847. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15848. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15849. do { \
  15850. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15851. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15852. } while (0)
  15853. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15854. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15855. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15856. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15857. do { \
  15858. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15859. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15860. } while (0)
  15861. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15862. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15863. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15864. /**
  15865. * @brief target -> host peer (PPDU) stats message
  15866. *
  15867. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15868. *
  15869. * @details
  15870. * This message is generated by FW when FW is sending stats to host
  15871. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15872. * This message is sent autonomously by the target rather than upon request
  15873. * by the host.
  15874. * The following field definitions describe the format of the HTT target
  15875. * to host peer stats indication message.
  15876. *
  15877. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15878. * or more PPDU stats records.
  15879. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15880. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15881. * then the message would start with the
  15882. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15883. * below.
  15884. *
  15885. * |31 16|15|14|13 11|10 9|8|7 0|
  15886. * |-------------------------------------------------------------|
  15887. * | reserved |MSG_TYPE |
  15888. * |-------------------------------------------------------------|
  15889. * rec 0 | TLV header |
  15890. * rec 0 |-------------------------------------------------------------|
  15891. * rec 0 | ppdu successful bytes |
  15892. * rec 0 |-------------------------------------------------------------|
  15893. * rec 0 | ppdu retry bytes |
  15894. * rec 0 |-------------------------------------------------------------|
  15895. * rec 0 | ppdu failed bytes |
  15896. * rec 0 |-------------------------------------------------------------|
  15897. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15898. * rec 0 |-------------------------------------------------------------|
  15899. * rec 0 | retried MSDUs | successful MSDUs |
  15900. * rec 0 |-------------------------------------------------------------|
  15901. * rec 0 | TX duration | failed MSDUs |
  15902. * rec 0 |-------------------------------------------------------------|
  15903. * ...
  15904. * |-------------------------------------------------------------|
  15905. * rec N | TLV header |
  15906. * rec N |-------------------------------------------------------------|
  15907. * rec N | ppdu successful bytes |
  15908. * rec N |-------------------------------------------------------------|
  15909. * rec N | ppdu retry bytes |
  15910. * rec N |-------------------------------------------------------------|
  15911. * rec N | ppdu failed bytes |
  15912. * rec N |-------------------------------------------------------------|
  15913. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15914. * rec N |-------------------------------------------------------------|
  15915. * rec N | retried MSDUs | successful MSDUs |
  15916. * rec N |-------------------------------------------------------------|
  15917. * rec N | TX duration | failed MSDUs |
  15918. * rec N |-------------------------------------------------------------|
  15919. *
  15920. * where:
  15921. * A = is A-MPDU flag
  15922. * BA = block-ack failure flags
  15923. * BW = bandwidth spec
  15924. * SG = SGI enabled spec
  15925. * S = skipped rate ctrl
  15926. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15927. *
  15928. * Header
  15929. * ------
  15930. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15931. * dword0 - b'8:31 - reserved : Reserved for future use
  15932. *
  15933. * payload include below peer_stats information
  15934. * --------------------------------------------
  15935. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15936. * @tx_success_bytes : total successful bytes in the PPDU.
  15937. * @tx_retry_bytes : total retried bytes in the PPDU.
  15938. * @tx_failed_bytes : total failed bytes in the PPDU.
  15939. * @tx_ratecode : rate code used for the PPDU.
  15940. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15941. * @ba_ack_failed : BA/ACK failed for this PPDU
  15942. * b00 -> BA received
  15943. * b01 -> BA failed once
  15944. * b10 -> BA failed twice, when HW retry is enabled.
  15945. * @bw : BW
  15946. * b00 -> 20 MHz
  15947. * b01 -> 40 MHz
  15948. * b10 -> 80 MHz
  15949. * b11 -> 160 MHz (or 80+80)
  15950. * @sg : SGI enabled
  15951. * @s : skipped ratectrl
  15952. * @peer_id : peer id
  15953. * @tx_success_msdus : successful MSDUs
  15954. * @tx_retry_msdus : retried MSDUs
  15955. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15956. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15957. */
  15958. /**
  15959. * @brief target -> host backpressure event
  15960. *
  15961. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15962. *
  15963. * @details
  15964. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15965. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15966. * This message will only be sent if the backpressure condition has existed
  15967. * continuously for an initial period (100 ms).
  15968. * Repeat messages with updated information will be sent after each
  15969. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15970. * This message indicates the ring id along with current head and tail index
  15971. * locations (i.e. write and read indices).
  15972. * The backpressure time indicates the time in ms for which continuous
  15973. * backpressure has been observed in the ring.
  15974. *
  15975. * The message format is as follows:
  15976. *
  15977. * |31 24|23 16|15 8|7 0|
  15978. * |----------------+----------------+----------------+----------------|
  15979. * | ring_id | ring_type | pdev_id | msg_type |
  15980. * |-------------------------------------------------------------------|
  15981. * | tail_idx | head_idx |
  15982. * |-------------------------------------------------------------------|
  15983. * | backpressure_time_ms |
  15984. * |-------------------------------------------------------------------|
  15985. *
  15986. * The message is interpreted as follows:
  15987. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15988. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15989. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15990. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15991. * the msg is for LMAC ring.
  15992. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15993. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15994. * htt_backpressure_lmac_ring_id. This represents
  15995. * the ring id for which continuous backpressure
  15996. * is seen
  15997. *
  15998. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15999. * the ring indicated by the ring_id
  16000. *
  16001. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16002. * the ring indicated by the ring id
  16003. *
  16004. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16005. * backpressure has been seen in the ring
  16006. * indicated by the ring_id.
  16007. * Units = milliseconds
  16008. */
  16009. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16010. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16011. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16012. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16013. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16014. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16015. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16016. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16017. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16018. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16019. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16020. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16021. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16022. do { \
  16023. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16024. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16025. } while (0)
  16026. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16027. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16028. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16029. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16030. do { \
  16031. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16032. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16033. } while (0)
  16034. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16035. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16036. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16037. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16038. do { \
  16039. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16040. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16041. } while (0)
  16042. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16043. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16044. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16045. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16046. do { \
  16047. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16048. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16049. } while (0)
  16050. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16051. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16052. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16053. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16054. do { \
  16055. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16056. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16057. } while (0)
  16058. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16059. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16060. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16061. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16062. do { \
  16063. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16064. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16065. } while (0)
  16066. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16067. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16068. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16069. enum htt_backpressure_ring_type {
  16070. HTT_SW_RING_TYPE_UMAC,
  16071. HTT_SW_RING_TYPE_LMAC,
  16072. HTT_SW_RING_TYPE_MAX,
  16073. };
  16074. /* Ring id for which the message is sent to host */
  16075. enum htt_backpressure_umac_ringid {
  16076. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16077. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16078. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16079. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16080. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16081. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16082. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16083. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16084. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16085. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16086. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16087. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16088. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16089. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16090. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16091. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16092. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16093. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16094. HTT_SW_UMAC_RING_IDX_MAX,
  16095. };
  16096. enum htt_backpressure_lmac_ringid {
  16097. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16098. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16099. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16100. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16101. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16102. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16103. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16104. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16105. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16106. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16107. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16108. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16109. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16110. HTT_SW_LMAC_RING_IDX_MAX,
  16111. };
  16112. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16113. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16114. pdev_id: 8,
  16115. ring_type: 8, /* htt_backpressure_ring_type */
  16116. /*
  16117. * ring_id holds an enum value from either
  16118. * htt_backpressure_umac_ringid or
  16119. * htt_backpressure_lmac_ringid, based on
  16120. * the ring_type setting.
  16121. */
  16122. ring_id: 8;
  16123. A_UINT16 head_idx;
  16124. A_UINT16 tail_idx;
  16125. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16126. } POSTPACK;
  16127. /*
  16128. * Defines two 32 bit words that can be used by the target to indicate a per
  16129. * user RU allocation and rate information.
  16130. *
  16131. * This information is currently provided in the "sw_response_reference_ptr"
  16132. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16133. * "rx_ppdu_end_user_stats" TLV.
  16134. *
  16135. * VALID:
  16136. * The consumer of these words must explicitly check the valid bit,
  16137. * and only attempt interpretation of any of the remaining fields if
  16138. * the valid bit is set to 1.
  16139. *
  16140. * VERSION:
  16141. * The consumer of these words must also explicitly check the version bit,
  16142. * and only use the V0 definition if the VERSION field is set to 0.
  16143. *
  16144. * Version 1 is currently undefined, with the exception of the VALID and
  16145. * VERSION fields.
  16146. *
  16147. * Version 0:
  16148. *
  16149. * The fields below are duplicated per BW.
  16150. *
  16151. * The consumer must determine which BW field to use, based on the UL OFDMA
  16152. * PPDU BW indicated by HW.
  16153. *
  16154. * RU_START: RU26 start index for the user.
  16155. * Note that this is always using the RU26 index, regardless
  16156. * of the actual RU assigned to the user
  16157. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16158. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16159. *
  16160. * For example, 20MHz (the value in the top row is RU_START)
  16161. *
  16162. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16163. * RU Size 1 (52): | | | | | |
  16164. * RU Size 2 (106): | | | |
  16165. * RU Size 3 (242): | |
  16166. *
  16167. * RU_SIZE: Indicates the RU size, as defined by enum
  16168. * htt_ul_ofdma_user_info_ru_size.
  16169. *
  16170. * LDPC: LDPC enabled (if 0, BCC is used)
  16171. *
  16172. * DCM: DCM enabled
  16173. *
  16174. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16175. * |---------------------------------+--------------------------------|
  16176. * |Ver|Valid| FW internal |
  16177. * |---------------------------------+--------------------------------|
  16178. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16179. * |---------------------------------+--------------------------------|
  16180. */
  16181. enum htt_ul_ofdma_user_info_ru_size {
  16182. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16183. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16184. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16185. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16186. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16187. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16188. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16189. };
  16190. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16191. struct htt_ul_ofdma_user_info_v0 {
  16192. A_UINT32 word0;
  16193. A_UINT32 word1;
  16194. };
  16195. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16196. A_UINT32 w0_fw_rsvd:30; \
  16197. A_UINT32 w0_valid:1; \
  16198. A_UINT32 w0_version:1;
  16199. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16200. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16201. };
  16202. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16203. A_UINT32 w1_nss:3; \
  16204. A_UINT32 w1_mcs:4; \
  16205. A_UINT32 w1_ldpc:1; \
  16206. A_UINT32 w1_dcm:1; \
  16207. A_UINT32 w1_ru_start:7; \
  16208. A_UINT32 w1_ru_size:3; \
  16209. A_UINT32 w1_trig_type:4; \
  16210. A_UINT32 w1_unused:9;
  16211. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16212. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16213. };
  16214. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16215. A_UINT32 w0_fw_rsvd:27; \
  16216. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16217. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16218. 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) */
  16219. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16220. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16221. };
  16222. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16223. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16224. A_UINT32 w1_trig_type:4; \
  16225. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16226. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16227. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16228. };
  16229. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16230. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16231. union {
  16232. A_UINT32 word0;
  16233. struct {
  16234. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16235. };
  16236. };
  16237. union {
  16238. A_UINT32 word1;
  16239. struct {
  16240. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16241. };
  16242. };
  16243. } POSTPACK;
  16244. /*
  16245. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16246. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16247. * this should be picked.
  16248. */
  16249. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16250. union {
  16251. A_UINT32 word0;
  16252. struct {
  16253. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16254. };
  16255. };
  16256. union {
  16257. A_UINT32 word1;
  16258. struct {
  16259. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16260. };
  16261. };
  16262. } POSTPACK;
  16263. enum HTT_UL_OFDMA_TRIG_TYPE {
  16264. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16265. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16266. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16267. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16268. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16269. };
  16270. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16271. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16272. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16273. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16274. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16277. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16278. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16279. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16280. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16281. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16282. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16283. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16284. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16285. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16286. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16287. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16288. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16289. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16291. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16292. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16293. /*--- word 0 ---*/
  16294. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16295. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16296. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16297. do { \
  16298. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16299. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16300. } while (0)
  16301. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16302. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16303. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16304. do { \
  16305. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16306. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16307. } while (0)
  16308. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16309. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16310. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16311. do { \
  16312. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16313. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16314. } while (0)
  16315. /*--- word 1 ---*/
  16316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16317. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16319. do { \
  16320. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16321. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16322. } while (0)
  16323. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16324. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16325. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16326. do { \
  16327. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16328. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16329. } while (0)
  16330. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16331. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16332. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16333. do { \
  16334. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16335. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16336. } while (0)
  16337. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16338. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16339. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16340. do { \
  16341. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16342. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16343. } while (0)
  16344. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16345. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16346. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16347. do { \
  16348. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16349. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16350. } while (0)
  16351. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16352. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16353. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16354. do { \
  16355. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16356. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16357. } while (0)
  16358. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16359. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16360. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16361. do { \
  16362. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16363. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16364. } while (0)
  16365. /**
  16366. * @brief target -> host channel calibration data message
  16367. *
  16368. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16369. *
  16370. * @brief host -> target channel calibration data message
  16371. *
  16372. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16373. *
  16374. * @details
  16375. * The following field definitions describe the format of the channel
  16376. * calibration data message sent from the target to the host when
  16377. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16378. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16379. * The message is defined as htt_chan_caldata_msg followed by a variable
  16380. * number of 32-bit character values.
  16381. *
  16382. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16383. * |------------------------------------------------------------------|
  16384. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16385. * |------------------------------------------------------------------|
  16386. * | payload size | mhz |
  16387. * |------------------------------------------------------------------|
  16388. * | center frequency 2 | center frequency 1 |
  16389. * |------------------------------------------------------------------|
  16390. * | check sum |
  16391. * |------------------------------------------------------------------|
  16392. * | payload |
  16393. * |------------------------------------------------------------------|
  16394. * message info field:
  16395. * - MSG_TYPE
  16396. * Bits 7:0
  16397. * Purpose: identifies this as a channel calibration data message
  16398. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16399. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16400. * - SUB_TYPE
  16401. * Bits 11:8
  16402. * Purpose: T2H: indicates whether target is providing chan cal data
  16403. * to the host to store, or requesting that the host
  16404. * download previously-stored data.
  16405. * H2T: indicates whether the host is providing the requested
  16406. * channel cal data, or if it is rejecting the data
  16407. * request because it does not have the requested data.
  16408. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16409. * - CHKSUM_VALID
  16410. * Bit 12
  16411. * Purpose: indicates if the checksum field is valid
  16412. * value:
  16413. * - FRAG
  16414. * Bit 19:16
  16415. * Purpose: indicates the fragment index for message
  16416. * value: 0 for first fragment, 1 for second fragment, ...
  16417. * - APPEND
  16418. * Bit 20
  16419. * Purpose: indicates if this is the last fragment
  16420. * value: 0 = final fragment, 1 = more fragments will be appended
  16421. *
  16422. * channel and payload size field
  16423. * - MHZ
  16424. * Bits 15:0
  16425. * Purpose: indicates the channel primary frequency
  16426. * Value:
  16427. * - PAYLOAD_SIZE
  16428. * Bits 31:16
  16429. * Purpose: indicates the bytes of calibration data in payload
  16430. * Value:
  16431. *
  16432. * center frequency field
  16433. * - CENTER FREQUENCY 1
  16434. * Bits 15:0
  16435. * Purpose: indicates the channel center frequency
  16436. * Value: channel center frequency, in MHz units
  16437. * - CENTER FREQUENCY 2
  16438. * Bits 31:16
  16439. * Purpose: indicates the secondary channel center frequency,
  16440. * only for 11acvht 80plus80 mode
  16441. * Value: secondary channel center frequency, in MHz units, if applicable
  16442. *
  16443. * checksum field
  16444. * - CHECK_SUM
  16445. * Bits 31:0
  16446. * Purpose: check the payload data, it is just for this fragment.
  16447. * This is intended for the target to check that the channel
  16448. * calibration data returned by the host is the unmodified data
  16449. * that was previously provided to the host by the target.
  16450. * value: checksum of fragment payload
  16451. */
  16452. PREPACK struct htt_chan_caldata_msg {
  16453. /* DWORD 0: message info */
  16454. A_UINT32
  16455. msg_type: 8,
  16456. sub_type: 4 ,
  16457. chksum_valid: 1, /** 1:valid, 0:invalid */
  16458. reserved1: 3,
  16459. frag_idx: 4, /** fragment index for calibration data */
  16460. appending: 1, /** 0: no fragment appending,
  16461. * 1: extra fragment appending */
  16462. reserved2: 11;
  16463. /* DWORD 1: channel and payload size */
  16464. A_UINT32
  16465. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16466. payload_size: 16; /** unit: bytes */
  16467. /* DWORD 2: center frequency */
  16468. A_UINT32
  16469. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16470. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16471. * valid only for 11acvht 80plus80 mode */
  16472. /* DWORD 3: check sum */
  16473. A_UINT32 chksum;
  16474. /* variable length for calibration data */
  16475. A_UINT32 payload[1/* or more */];
  16476. } POSTPACK;
  16477. /* T2H SUBTYPE */
  16478. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16479. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16480. /* H2T SUBTYPE */
  16481. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16482. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16483. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16484. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16485. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16486. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16487. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16488. do { \
  16489. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16490. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16491. } while (0)
  16492. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16493. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16494. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16495. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16496. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16497. do { \
  16498. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16499. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16500. } while (0)
  16501. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16502. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16503. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16504. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16505. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16506. do { \
  16507. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16508. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16509. } while (0)
  16510. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16511. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16512. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16513. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16514. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16515. do { \
  16516. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16517. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16518. } while (0)
  16519. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16520. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16521. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16522. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16523. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16524. do { \
  16525. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16526. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16527. } while (0)
  16528. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16529. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16530. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16531. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16532. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16533. do { \
  16534. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16535. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16536. } while (0)
  16537. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16538. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16539. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16540. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16541. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16542. do { \
  16543. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16544. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16545. } while (0)
  16546. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16547. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16548. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16549. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16550. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16551. do { \
  16552. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16553. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16554. } while (0)
  16555. /**
  16556. * @brief target -> host FSE CMEM based send
  16557. *
  16558. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16559. *
  16560. * @details
  16561. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16562. * FSE placement in CMEM is enabled.
  16563. *
  16564. * This message sends the non-secure CMEM base address.
  16565. * It will be sent to host in response to message
  16566. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16567. * The message would appear as follows:
  16568. *
  16569. * |31 24|23 16|15 8|7 0|
  16570. * |----------------+----------------+----------------+----------------|
  16571. * | reserved | num_entries | msg_type |
  16572. * |----------------+----------------+----------------+----------------|
  16573. * | base_address_lo |
  16574. * |----------------+----------------+----------------+----------------|
  16575. * | base_address_hi |
  16576. * |-------------------------------------------------------------------|
  16577. *
  16578. * The message is interpreted as follows:
  16579. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16580. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16581. * b'8:15 - number_entries: Indicated the number of entries
  16582. * programmed.
  16583. * b'16:31 - reserved.
  16584. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16585. * CMEM base address
  16586. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16587. * CMEM base address
  16588. */
  16589. PREPACK struct htt_cmem_base_send_t {
  16590. A_UINT32 msg_type: 8,
  16591. num_entries: 8,
  16592. reserved: 16;
  16593. A_UINT32 base_address_lo;
  16594. A_UINT32 base_address_hi;
  16595. } POSTPACK;
  16596. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16597. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16598. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16599. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16600. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16601. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16602. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16603. do { \
  16604. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16605. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16606. } while (0)
  16607. /**
  16608. * @brief - HTT PPDU ID format
  16609. *
  16610. * @details
  16611. * The following field definitions describe the format of the PPDU ID.
  16612. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16613. *
  16614. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16615. * +--------------------------------------------------------------------------
  16616. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16617. * +--------------------------------------------------------------------------
  16618. *
  16619. * sch id :Schedule command id
  16620. * Bits [11 : 0] : monotonically increasing counter to track the
  16621. * PPDU posted to a specific transmit queue.
  16622. *
  16623. * hwq_id: Hardware Queue ID.
  16624. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16625. *
  16626. * mac_id: MAC ID
  16627. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16628. *
  16629. * seq_idx: Sequence index.
  16630. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16631. * a particular TXOP.
  16632. *
  16633. * tqm_cmd: HWSCH/TQM flag.
  16634. * Bit [23] : Always set to 0.
  16635. *
  16636. * seq_cmd_type: Sequence command type.
  16637. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16638. * Refer to enum HTT_STATS_FTYPE for values.
  16639. */
  16640. PREPACK struct htt_ppdu_id {
  16641. A_UINT32
  16642. sch_id: 12,
  16643. hwq_id: 5,
  16644. mac_id: 2,
  16645. seq_idx: 2,
  16646. reserved1: 2,
  16647. tqm_cmd: 1,
  16648. seq_cmd_type: 6,
  16649. reserved2: 2;
  16650. } POSTPACK;
  16651. #define HTT_PPDU_ID_SCH_ID_S 0
  16652. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16653. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16654. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16655. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16656. do { \
  16657. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16658. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16659. } while (0)
  16660. #define HTT_PPDU_ID_HWQ_ID_S 12
  16661. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16662. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16663. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16664. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16665. do { \
  16666. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16667. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16668. } while (0)
  16669. #define HTT_PPDU_ID_MAC_ID_S 17
  16670. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16671. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16672. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16673. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16674. do { \
  16675. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16676. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16677. } while (0)
  16678. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16679. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16680. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16681. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16682. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16683. do { \
  16684. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16685. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16686. } while (0)
  16687. #define HTT_PPDU_ID_TQM_CMD_S 23
  16688. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16689. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16690. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16691. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16692. do { \
  16693. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16694. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16695. } while (0)
  16696. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16697. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16698. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16699. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16700. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16701. do { \
  16702. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16703. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16704. } while (0)
  16705. /**
  16706. * @brief target -> RX PEER METADATA V0 format
  16707. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16708. * message from target, and will confirm to the target which peer metadata
  16709. * version to use in the wmi_init message.
  16710. *
  16711. * The following diagram shows the format of the RX PEER METADATA.
  16712. *
  16713. * |31 24|23 16|15 8|7 0|
  16714. * |-----------------------------------------------------------------------|
  16715. * | Reserved | VDEV ID | PEER ID |
  16716. * |-----------------------------------------------------------------------|
  16717. */
  16718. PREPACK struct htt_rx_peer_metadata_v0 {
  16719. A_UINT32
  16720. peer_id: 16,
  16721. vdev_id: 8,
  16722. reserved1: 8;
  16723. } POSTPACK;
  16724. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16725. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16726. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16727. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16728. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16729. do { \
  16730. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16731. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16732. } while (0)
  16733. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16734. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16735. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16736. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16737. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16738. do { \
  16739. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16740. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16741. } while (0)
  16742. /**
  16743. * @brief target -> RX PEER METADATA V1 format
  16744. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16745. * message from target, and will confirm to the target which peer metadata
  16746. * version to use in the wmi_init message.
  16747. *
  16748. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16749. *
  16750. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16751. * |---------------------------------------------------------------------------|
  16752. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  16753. * |---------------------------------------------------------------------------|
  16754. */
  16755. PREPACK struct htt_rx_peer_metadata_v1 {
  16756. A_UINT32
  16757. peer_id: 13,
  16758. ml_peer_valid: 1,
  16759. logical_link_id: 2,
  16760. vdev_id: 8,
  16761. lmac_id: 2,
  16762. chip_id: 3,
  16763. reserved2: 3;
  16764. } POSTPACK;
  16765. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16766. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16767. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16768. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16769. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16770. do { \
  16771. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16772. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16773. } while (0)
  16774. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16775. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16776. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16777. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16778. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16779. do { \
  16780. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16781. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16782. } while (0)
  16783. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16784. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16785. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16786. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16787. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  16788. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  16789. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  16790. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  16791. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  16792. do { \
  16793. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  16794. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  16795. } while (0)
  16796. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16797. do { \
  16798. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16799. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16800. } while (0)
  16801. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16802. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16803. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16804. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16805. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16806. do { \
  16807. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16808. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16809. } while (0)
  16810. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16811. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16812. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16813. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16814. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16815. do { \
  16816. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16817. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16818. } while (0)
  16819. /*
  16820. * In some systems, the host SW wants to specify priorities between
  16821. * different MSDU / flow queues within the same peer-TID.
  16822. * The below enums are used for the host to identify to the target
  16823. * which MSDU queue's priority it wants to adjust.
  16824. */
  16825. /*
  16826. * The MSDUQ index describe index of TCL HW, where each index is
  16827. * used for queuing particular types of MSDUs.
  16828. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16829. */
  16830. enum HTT_MSDUQ_INDEX {
  16831. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16832. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16833. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16834. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16835. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16836. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16837. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16838. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16839. HTT_MSDUQ_MAX_INDEX,
  16840. };
  16841. /* MSDU qtype definition */
  16842. enum HTT_MSDU_QTYPE {
  16843. /*
  16844. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16845. * relative priority. Instead, the relative priority of CRIT_0 versus
  16846. * CRIT_1 is controlled by the FW, through the configuration parameters
  16847. * it applies to the queues.
  16848. */
  16849. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16850. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16851. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16852. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16853. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16854. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16855. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16856. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16857. /* New MSDU_QTYPE should be added above this line */
  16858. /*
  16859. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16860. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16861. * any host/target message definitions. The QTYPE_MAX value can
  16862. * only be used internally within the host or within the target.
  16863. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16864. * it must regard the unexpected value as a default qtype value,
  16865. * or ignore it.
  16866. */
  16867. HTT_MSDU_QTYPE_MAX,
  16868. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16869. };
  16870. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16871. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16872. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16873. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16874. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16875. };
  16876. /**
  16877. * @brief target -> host mlo timestamp offset indication
  16878. *
  16879. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16880. *
  16881. * @details
  16882. * The following field definitions describe the format of the HTT target
  16883. * to host mlo timestamp offset indication message.
  16884. *
  16885. *
  16886. * |31 16|15 12|11 10|9 8|7 0 |
  16887. * |----------------------------------------------------------------------|
  16888. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16889. * |----------------------------------------------------------------------|
  16890. * | Sync time stamp lo in us |
  16891. * |----------------------------------------------------------------------|
  16892. * | Sync time stamp hi in us |
  16893. * |----------------------------------------------------------------------|
  16894. * | mlo time stamp offset lo in us |
  16895. * |----------------------------------------------------------------------|
  16896. * | mlo time stamp offset hi in us |
  16897. * |----------------------------------------------------------------------|
  16898. * | mlo time stamp offset clocks in clock ticks |
  16899. * |----------------------------------------------------------------------|
  16900. * |31 26|25 16|15 0 |
  16901. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16902. * | | compensation in clks | |
  16903. * |----------------------------------------------------------------------|
  16904. * |31 22|21 0 |
  16905. * | rsvd 3 | mlo time stamp comp timer period |
  16906. * |----------------------------------------------------------------------|
  16907. * The message is interpreted as follows:
  16908. *
  16909. * dword0 - b'0:7 - msg_type: This will be set to
  16910. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16911. * value: 0x28
  16912. *
  16913. * dword0 - b'9:8 - pdev_id
  16914. *
  16915. * dword0 - b'11:10 - chip_id
  16916. *
  16917. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16918. *
  16919. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16920. *
  16921. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16922. * which last sync interrupt was received
  16923. *
  16924. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16925. * which last sync interrupt was received
  16926. *
  16927. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16928. *
  16929. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16930. *
  16931. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16932. *
  16933. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16934. *
  16935. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16936. * for sub us resolution
  16937. *
  16938. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16939. *
  16940. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16941. * is applied, in us
  16942. *
  16943. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16944. */
  16945. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16946. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16947. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16949. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16950. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16952. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16953. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16954. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16955. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16957. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16958. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16960. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16961. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16962. do { \
  16963. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16964. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16965. } while (0)
  16966. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16967. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16968. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16969. do { \
  16970. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16971. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16972. } while (0)
  16973. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16974. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16975. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16976. do { \
  16977. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16978. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16979. } while (0)
  16980. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16981. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16982. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16983. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16984. do { \
  16985. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16986. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16987. } while (0)
  16988. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16989. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16990. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16991. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16992. do { \
  16993. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16994. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16995. } while (0)
  16996. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16997. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16998. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16999. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17000. do { \
  17001. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17002. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17003. } while (0)
  17004. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17005. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17006. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17007. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17008. do { \
  17009. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17010. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17011. } while (0)
  17012. typedef struct {
  17013. A_UINT32 msg_type: 8, /* bits 7:0 */
  17014. pdev_id: 2, /* bits 9:8 */
  17015. chip_id: 2, /* bits 11:10 */
  17016. reserved1: 4, /* bits 15:12 */
  17017. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17018. A_UINT32 sync_timestamp_lo_us;
  17019. A_UINT32 sync_timestamp_hi_us;
  17020. A_UINT32 mlo_timestamp_offset_lo_us;
  17021. A_UINT32 mlo_timestamp_offset_hi_us;
  17022. A_UINT32 mlo_timestamp_offset_clks;
  17023. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17024. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17025. reserved2: 6; /* bits 31:26 */
  17026. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17027. reserved3: 10; /* bits 31:22 */
  17028. } htt_t2h_mlo_offset_ind_t;
  17029. /*
  17030. * @brief target -> host VDEV TX RX STATS
  17031. *
  17032. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17033. *
  17034. * @details
  17035. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17036. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17037. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17038. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17039. * periodically by target even in the absence of any further HTT request
  17040. * messages from host.
  17041. *
  17042. * The message is formatted as follows:
  17043. *
  17044. * |31 16|15 8|7 0|
  17045. * |---------------------------------+----------------+----------------|
  17046. * | payload_size | pdev_id | msg_type |
  17047. * |---------------------------------+----------------+----------------|
  17048. * | reserved0 |
  17049. * |-------------------------------------------------------------------|
  17050. * | reserved1 |
  17051. * |-------------------------------------------------------------------|
  17052. * | reserved2 |
  17053. * |-------------------------------------------------------------------|
  17054. * | |
  17055. * | VDEV specific Tx Rx stats info |
  17056. * | |
  17057. * |-------------------------------------------------------------------|
  17058. *
  17059. * The message is interpreted as follows:
  17060. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17061. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17062. * b'8:15 - pdev_id
  17063. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17064. * message header fields (msg_type through reserved2)
  17065. * dword1 - b'0:31 - reserved0.
  17066. * dword2 - b'0:31 - reserved1.
  17067. * dword3 - b'0:31 - reserved2.
  17068. */
  17069. typedef struct {
  17070. A_UINT32 msg_type: 8,
  17071. pdev_id: 8,
  17072. payload_size: 16;
  17073. A_UINT32 reserved0;
  17074. A_UINT32 reserved1;
  17075. A_UINT32 reserved2;
  17076. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17077. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17078. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17079. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17080. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17081. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17082. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17083. do { \
  17084. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17085. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17086. } while (0)
  17087. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17088. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17089. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17090. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17091. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17092. do { \
  17093. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17094. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17095. } while (0)
  17096. /* SOC related stats */
  17097. typedef struct {
  17098. htt_tlv_hdr_t tlv_hdr;
  17099. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17100. * This can be due to either the peer is deleted or deletion is ongoing
  17101. * */
  17102. A_UINT32 inv_peers_msdu_drop_count_lo;
  17103. A_UINT32 inv_peers_msdu_drop_count_hi;
  17104. } htt_t2h_soc_txrx_stats_common_tlv;
  17105. /* VDEV HW Tx/Rx stats */
  17106. typedef struct {
  17107. htt_tlv_hdr_t tlv_hdr;
  17108. A_UINT32 vdev_id;
  17109. /* Rx msdu byte cnt */
  17110. A_UINT32 rx_msdu_byte_cnt_lo;
  17111. A_UINT32 rx_msdu_byte_cnt_hi;
  17112. /* Rx msdu cnt */
  17113. A_UINT32 rx_msdu_cnt_lo;
  17114. A_UINT32 rx_msdu_cnt_hi;
  17115. /* tx msdu byte cnt */
  17116. A_UINT32 tx_msdu_byte_cnt_lo;
  17117. A_UINT32 tx_msdu_byte_cnt_hi;
  17118. /* tx msdu cnt */
  17119. A_UINT32 tx_msdu_cnt_lo;
  17120. A_UINT32 tx_msdu_cnt_hi;
  17121. /* tx excessive retry discarded msdu cnt */
  17122. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17123. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17124. /* TX congestion ctrl msdu drop cnt */
  17125. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17126. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17127. /* discarded tx msdus cnt coz of time to live expiry */
  17128. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17129. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17130. /* tx excessive retry discarded msdu byte cnt */
  17131. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17132. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17133. /* TX congestion ctrl msdu drop byte cnt */
  17134. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17135. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17136. /* discarded tx msdus byte cnt coz of time to live expiry */
  17137. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17138. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17139. /* TQM bypass frame cnt */
  17140. A_UINT32 tqm_bypass_frame_cnt_lo;
  17141. A_UINT32 tqm_bypass_frame_cnt_hi;
  17142. /* TQM bypass byte cnt */
  17143. A_UINT32 tqm_bypass_byte_cnt_lo;
  17144. A_UINT32 tqm_bypass_byte_cnt_hi;
  17145. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17146. /*
  17147. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17148. *
  17149. * @details
  17150. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17151. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17152. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17153. * the default MSDU queues of each of the specified TIDs for the peer
  17154. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17155. * If the default MSDU queues of a given TID within the peer are not linked
  17156. * to a service class, the svc_class_id field for that TID will have a
  17157. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17158. * queues for that TID are not mapped to any service class.
  17159. *
  17160. * |31 16|15 8|7 0|
  17161. * |------------------------------+--------------+--------------|
  17162. * | peer ID | reserved | msg type |
  17163. * |------------------------------+--------------+------+-------|
  17164. * | reserved | svc class ID | TID |
  17165. * |------------------------------------------------------------|
  17166. * ...
  17167. * |------------------------------------------------------------|
  17168. * | reserved | svc class ID | TID |
  17169. * |------------------------------------------------------------|
  17170. * Header fields:
  17171. * dword0 - b'7:0 - msg_type: This will be set to
  17172. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17173. * b'31:16 - peer ID
  17174. * dword1 - b'7:0 - TID
  17175. * b'15:8 - svc class ID
  17176. * (dword2, etc. same format as dword1)
  17177. */
  17178. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17179. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17180. A_UINT32 msg_type :8,
  17181. reserved0 :8,
  17182. peer_id :16;
  17183. struct {
  17184. A_UINT32 tid :8,
  17185. svc_class_id :8,
  17186. reserved1 :16;
  17187. } tid_reports[1/*or more*/];
  17188. } POSTPACK;
  17189. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17190. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17191. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17192. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17193. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17194. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17195. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17196. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17197. do { \
  17198. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17199. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17200. } while (0)
  17201. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17202. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17203. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17204. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17205. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17206. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17207. do { \
  17208. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17209. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17210. } while (0)
  17211. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17212. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17213. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17214. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17215. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17216. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17217. do { \
  17218. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17219. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17220. } while (0)
  17221. /*
  17222. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17223. *
  17224. * @details
  17225. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17226. * flow if the flow is seen the associated service class is conveyed to the
  17227. * target via TCL Data Command. Target on the other hand internally creates the
  17228. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17229. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17230. * the newly created MSDUQ
  17231. *
  17232. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17233. * |------------------------------+------------------------+--------------|
  17234. * | peer ID | HTT qtype | msg type |
  17235. * |---------------------------------+--------------+--+---+-------+------|
  17236. * | reserved |AST list index|FO|WC | HLOS | remap|
  17237. * | | | | | TID | TID |
  17238. * |---------------------+------------------------------------------------|
  17239. * | reserved1 | tgt_opaque_id |
  17240. * |---------------------+------------------------------------------------|
  17241. *
  17242. * Header fields:
  17243. *
  17244. * dword0 - b'7:0 - msg_type: This will be set to
  17245. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17246. * b'15:8 - HTT qtype
  17247. * b'31:16 - peer ID
  17248. *
  17249. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17250. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17251. * hlos_tid : Common to Lithium and Beryllium
  17252. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17253. * TCL Data Command : Beryllium
  17254. * b10 - flow_override (FO), as sent by host in
  17255. * TCL Data Command: Beryllium
  17256. * b11:14 - ast_list_idx
  17257. * Array index into the list of extension AST entries
  17258. * (not the actual AST 16-bit index).
  17259. * The ast_list_idx is one-based, with the following
  17260. * range of values:
  17261. * - legacy targets supporting 16 user-defined
  17262. * MSDU queues: 1-2
  17263. * - legacy targets supporting 48 user-defined
  17264. * MSDU queues: 1-6
  17265. * - new targets: 0 (peer_id is used instead)
  17266. * Note that since ast_list_idx is one-based,
  17267. * the host will need to subtract 1 to use it as an
  17268. * index into a list of extension AST entries.
  17269. * b15:31 - reserved
  17270. *
  17271. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17272. * unique MSDUQ id in firmware
  17273. * b'24:31 - reserved1
  17274. */
  17275. PREPACK struct htt_t2h_sawf_msduq_event {
  17276. A_UINT32 msg_type : 8,
  17277. htt_qtype : 8,
  17278. peer_id :16;
  17279. A_UINT32 remap_tid : 4,
  17280. hlos_tid : 4,
  17281. who_classify_info_sel : 2,
  17282. flow_override : 1,
  17283. ast_list_idx : 4,
  17284. reserved :17;
  17285. A_UINT32 tgt_opaque_id :24,
  17286. reserved1 : 8;
  17287. } POSTPACK;
  17288. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17289. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17290. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17291. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17292. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17293. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17294. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17295. do { \
  17296. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17297. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17298. } while (0)
  17299. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17300. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17301. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17302. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17303. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17304. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17305. do { \
  17306. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17307. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17308. } while (0)
  17309. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17310. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17311. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17312. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17313. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17314. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17315. do { \
  17316. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17317. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17318. } while (0)
  17319. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17320. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17321. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17322. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17323. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17324. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17325. do { \
  17326. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17327. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17328. } while (0)
  17329. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17330. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17331. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17332. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17333. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17334. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17335. do { \
  17336. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17337. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17338. } while (0)
  17339. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17340. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17341. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17342. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17343. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17344. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17345. do { \
  17346. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17347. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17348. } while (0)
  17349. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17350. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17351. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17352. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17353. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17354. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17355. do { \
  17356. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17357. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17358. } while (0)
  17359. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17360. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17361. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17362. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17363. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17364. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17365. do { \
  17366. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17367. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17368. } while (0)
  17369. /**
  17370. * @brief target -> PPDU id format indication
  17371. *
  17372. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17373. *
  17374. * @details
  17375. * The following field definitions describe the format of the HTT target
  17376. * to host PPDU ID format indication message.
  17377. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17378. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17379. * seq_idx :- Sequence control index of this PPDU.
  17380. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17381. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17382. * tqm_cmd:-
  17383. *
  17384. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17385. * |--------------------------------------------------+------------------------|
  17386. * | rsvd0 | msg type |
  17387. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17388. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17389. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17390. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17391. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17392. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17393. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17394. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17395. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17396. * Where: OF = bit offset, NB = number of bits, V = valid
  17397. * The message is interpreted as follows:
  17398. *
  17399. * dword0 - b'7:0 - msg_type: This will be set to
  17400. * HTT_T2H_PPDU_ID_FMT_IND
  17401. * value: 0x30
  17402. *
  17403. * dword0 - b'31:8 - reserved
  17404. *
  17405. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17406. *
  17407. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17408. *
  17409. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17410. *
  17411. * dword1 - b'15:11 - reserved for future use
  17412. *
  17413. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17414. *
  17415. * dword1 - b'21:17 - number of bits in ring_id
  17416. *
  17417. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17418. *
  17419. * dword1 - b'31:27 - reserved for future use
  17420. *
  17421. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17422. *
  17423. * dword2 - b'5:1 - number of bits in sequence index
  17424. *
  17425. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17426. *
  17427. * dword2 - b'15:11 - reserved for future use
  17428. *
  17429. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17430. *
  17431. * dword2 - b'21:17 - number of bits in link_id
  17432. *
  17433. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17434. *
  17435. * dword2 - b'31:27 - reserved for future use
  17436. *
  17437. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17438. *
  17439. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17440. *
  17441. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17442. *
  17443. * dword3 - b'15:11 - reserved for future use
  17444. *
  17445. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17446. *
  17447. * dword3 - b'21:17 - number of bits in tqm_cmd
  17448. *
  17449. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17450. *
  17451. * dword3 - b'31:27 - reserved for future use
  17452. *
  17453. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17454. *
  17455. * dword4 - b'5:1 - number of bits in mac_id
  17456. *
  17457. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17458. *
  17459. * dword4 - b'15:11 - reserved for future use
  17460. *
  17461. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17462. *
  17463. * dword4 - b'21:17 - number of bits in crc
  17464. *
  17465. * dword4 - b'26:22 - offset of crc (in number of bits)
  17466. *
  17467. * dword4 - b'31:27 - reserved for future use
  17468. *
  17469. */
  17470. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17471. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17472. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17473. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17474. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17475. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17476. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17477. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17478. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17479. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17480. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17481. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17482. /* macros for accessing lower 16 bits in dword */
  17483. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17484. do { \
  17485. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17486. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17487. } while (0)
  17488. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17489. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17490. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17491. do { \
  17492. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17493. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17494. } while (0)
  17495. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17496. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17497. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17498. do { \
  17499. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17500. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17501. } while (0)
  17502. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17503. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17504. /* macros for accessing upper 16 bits in dword */
  17505. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17506. do { \
  17507. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17508. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17509. } while (0)
  17510. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17511. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17512. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17513. do { \
  17514. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17515. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17516. } while (0)
  17517. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17518. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17519. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17520. do { \
  17521. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17522. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17523. } while (0)
  17524. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17525. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17526. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17527. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17528. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17529. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17530. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17531. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17532. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17533. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17534. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17535. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17536. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17537. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17538. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17539. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17540. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17541. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17542. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17543. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17544. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17545. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17546. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17547. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17548. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17549. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17550. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17551. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17552. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17553. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17554. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17555. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17556. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17557. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17558. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17559. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17560. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17561. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17562. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17563. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17564. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17565. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17566. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17567. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17568. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17569. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17570. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17571. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17572. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17573. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17574. /* offsets in number dwords */
  17575. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17576. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17577. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17578. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17579. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17580. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17581. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17582. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17583. typedef struct {
  17584. A_UINT32 msg_type: 8, /* bits 7:0 */
  17585. rsvd0: 24;/* bits 31:8 */
  17586. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17587. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17588. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17589. rsvd1: 5, /* bits 15:11 */
  17590. ring_id_valid: 1, /* bits 16:16 */
  17591. ring_id_bits: 5, /* bits 21:17 */
  17592. ring_id_offset: 5, /* bits 26:22 */
  17593. rsvd2: 5; /* bits 31:27 */
  17594. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17595. seq_idx_bits: 5, /* bits 5:1 */
  17596. seq_idx_offset: 5, /* bits 10:6 */
  17597. rsvd3: 5, /* bits 15:11 */
  17598. link_id_valid: 1, /* bits 16:16 */
  17599. link_id_bits: 5, /* bits 21:17 */
  17600. link_id_offset: 5, /* bits 26:22 */
  17601. rsvd4: 5; /* bits 31:27 */
  17602. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17603. seq_cmd_type_bits: 5, /* bits 5:1 */
  17604. seq_cmd_type_offset: 5, /* bits 10:6 */
  17605. rsvd5: 5, /* bits 15:11 */
  17606. tqm_cmd_valid: 1, /* bits 16:16 */
  17607. tqm_cmd_bits: 5, /* bits 21:17 */
  17608. tqm_cmd_offset: 5, /* bits 26:12 */
  17609. rsvd6: 5; /* bits 31:27 */
  17610. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17611. mac_id_bits: 5, /* bits 5:1 */
  17612. mac_id_offset: 5, /* bits 10:6 */
  17613. rsvd8: 5, /* bits 15:11 */
  17614. crc_valid: 1, /* bits 16:16 */
  17615. crc_bits: 5, /* bits 21:17 */
  17616. crc_offset: 5, /* bits 26:12 */
  17617. rsvd9: 5; /* bits 31:27 */
  17618. } htt_t2h_ppdu_id_fmt_ind_t;
  17619. #endif