htt.h 986 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. * 3.116 Add HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE flag.
  238. * 3.117 Add HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND def.
  239. * 3.118 Add HTT_T2H_MSG_TYPE_RX_DATA_IND and _SOFT_UMAC_TX_COMPL_IND defs.
  240. * 3.119 Add RX_PEER_META_DATA V1A and V1B defs.
  241. */
  242. #define HTT_CURRENT_VERSION_MAJOR 3
  243. #define HTT_CURRENT_VERSION_MINOR 119
  244. #define HTT_NUM_TX_FRAG_DESC 1024
  245. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  246. #define HTT_CHECK_SET_VAL(field, val) \
  247. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  248. /* macros to assist in sign-extending fields from HTT messages */
  249. #define HTT_SIGN_BIT_MASK(field) \
  250. ((field ## _M + (1 << field ## _S)) >> 1)
  251. #define HTT_SIGN_BIT(_val, field) \
  252. (_val & HTT_SIGN_BIT_MASK(field))
  253. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  254. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  255. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  256. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  257. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  258. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  259. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  260. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  261. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  262. /*
  263. * TEMPORARY:
  264. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  265. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  266. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  267. * updated.
  268. */
  269. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  270. /*
  271. * TEMPORARY:
  272. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  273. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  274. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  275. * updated.
  276. */
  277. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  278. /**
  279. * htt_dbg_stats_type -
  280. * bit positions for each stats type within a stats type bitmask
  281. * The bitmask contains 24 bits.
  282. */
  283. enum htt_dbg_stats_type {
  284. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  285. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  286. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  287. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  288. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  289. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  290. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  291. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  292. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  293. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  294. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  295. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  296. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  297. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  298. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  299. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  300. /* bits 16-23 currently reserved */
  301. /* keep this last */
  302. HTT_DBG_NUM_STATS
  303. };
  304. /*=== HTT option selection TLVs ===
  305. * Certain HTT messages have alternatives or options.
  306. * For such cases, the host and target need to agree on which option to use.
  307. * Option specification TLVs can be appended to the VERSION_REQ and
  308. * VERSION_CONF messages to select options other than the default.
  309. * These TLVs are entirely optional - if they are not provided, there is a
  310. * well-defined default for each option. If they are provided, they can be
  311. * provided in any order. Each TLV can be present or absent independent of
  312. * the presence / absence of other TLVs.
  313. *
  314. * The HTT option selection TLVs use the following format:
  315. * |31 16|15 8|7 0|
  316. * |---------------------------------+----------------+----------------|
  317. * | value (payload) | length | tag |
  318. * |-------------------------------------------------------------------|
  319. * The value portion need not be only 2 bytes; it can be extended by any
  320. * integer number of 4-byte units. The total length of the TLV, including
  321. * the tag and length fields, must be a multiple of 4 bytes. The length
  322. * field specifies the total TLV size in 4-byte units. Thus, the typical
  323. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  324. * field, would store 0x1 in its length field, to show that the TLV occupies
  325. * a single 4-byte unit.
  326. */
  327. /*--- TLV header format - applies to all HTT option TLVs ---*/
  328. enum HTT_OPTION_TLV_TAGS {
  329. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  330. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  331. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  332. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  333. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  334. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  335. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  336. };
  337. #define HTT_TCL_METADATA_VER_SZ 4
  338. PREPACK struct htt_option_tlv_header_t {
  339. A_UINT8 tag;
  340. A_UINT8 length;
  341. } POSTPACK;
  342. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  343. #define HTT_OPTION_TLV_TAG_S 0
  344. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  345. #define HTT_OPTION_TLV_LENGTH_S 8
  346. /*
  347. * value0 - 16 bit value field stored in word0
  348. * The TLV's value field may be longer than 2 bytes, in which case
  349. * the remainder of the value is stored in word1, word2, etc.
  350. */
  351. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  352. #define HTT_OPTION_TLV_VALUE0_S 16
  353. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  354. do { \
  355. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  356. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  357. } while (0)
  358. #define HTT_OPTION_TLV_TAG_GET(word) \
  359. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  360. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  361. do { \
  362. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  363. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  364. } while (0)
  365. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  366. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  367. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  368. do { \
  369. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  370. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  371. } while (0)
  372. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  373. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  374. /*--- format of specific HTT option TLVs ---*/
  375. /*
  376. * HTT option TLV for specifying LL bus address size
  377. * Some chips require bus addresses used by the target to access buffers
  378. * within the host's memory to be 32 bits; others require bus addresses
  379. * used by the target to access buffers within the host's memory to be
  380. * 64 bits.
  381. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  382. * a suffix to the VERSION_CONF message to specify which bus address format
  383. * the target requires.
  384. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  385. * default to providing bus addresses to the target in 32-bit format.
  386. */
  387. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  388. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  389. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  390. };
  391. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  392. struct htt_option_tlv_header_t hdr;
  393. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  394. } POSTPACK;
  395. /*
  396. * HTT option TLV for specifying whether HL systems should indicate
  397. * over-the-air tx completion for individual frames, or should instead
  398. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  399. * requests an OTA tx completion for a particular tx frame.
  400. * This option does not apply to LL systems, where the TX_COMPL_IND
  401. * is mandatory.
  402. * This option is primarily intended for HL systems in which the tx frame
  403. * downloads over the host --> target bus are as slow as or slower than
  404. * the transmissions over the WLAN PHY. For cases where the bus is faster
  405. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  406. * and consequently will send one TX_COMPL_IND message that covers several
  407. * tx frames. For cases where the WLAN PHY is faster than the bus,
  408. * the target will end up transmitting very short A-MPDUs, and consequently
  409. * sending many TX_COMPL_IND messages, which each cover a very small number
  410. * of tx frames.
  411. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  412. * a suffix to the VERSION_REQ message to request whether the host desires to
  413. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  414. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  415. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  416. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  417. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  418. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  419. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  420. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  421. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  422. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  423. * TLV.
  424. */
  425. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  426. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  427. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  428. };
  429. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  430. struct htt_option_tlv_header_t hdr;
  431. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  432. } POSTPACK;
  433. /*
  434. * HTT option TLV for specifying how many tx queue groups the target
  435. * may establish.
  436. * This TLV specifies the maximum value the target may send in the
  437. * txq_group_id field of any TXQ_GROUP information elements sent by
  438. * the target to the host. This allows the host to pre-allocate an
  439. * appropriate number of tx queue group structs.
  440. *
  441. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  442. * a suffix to the VERSION_REQ message to specify whether the host supports
  443. * tx queue groups at all, and if so if there is any limit on the number of
  444. * tx queue groups that the host supports.
  445. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  446. * a suffix to the VERSION_CONF message. If the host has specified in the
  447. * VER_REQ message a limit on the number of tx queue groups the host can
  448. * support, the target shall limit its specification of the maximum tx groups
  449. * to be no larger than this host-specified limit.
  450. *
  451. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  452. * shall preallocate 4 tx queue group structs, and the target shall not
  453. * specify a txq_group_id larger than 3.
  454. */
  455. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  456. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  457. /*
  458. * values 1 through N specify the max number of tx queue groups
  459. * the sender supports
  460. */
  461. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  462. };
  463. /* TEMPORARY backwards-compatibility alias for a typo fix -
  464. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  465. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  466. * to support the old name (with the typo) until all references to the
  467. * old name are replaced with the new name.
  468. */
  469. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  470. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  471. struct htt_option_tlv_header_t hdr;
  472. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  473. } POSTPACK;
  474. /*
  475. * HTT option TLV for specifying whether the target supports an extended
  476. * version of the HTT tx descriptor. If the target provides this TLV
  477. * and specifies in the TLV that the target supports an extended version
  478. * of the HTT tx descriptor, the target must check the "extension" bit in
  479. * the HTT tx descriptor, and if the extension bit is set, to expect a
  480. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  481. * descriptor. Furthermore, the target must provide room for the HTT
  482. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  483. * This option is intended for systems where the host needs to explicitly
  484. * control the transmission parameters such as tx power for individual
  485. * tx frames.
  486. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  487. * as a suffix to the VERSION_CONF message to explicitly specify whether
  488. * the target supports the HTT tx MSDU extension descriptor.
  489. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  490. * by the host as lack of target support for the HTT tx MSDU extension
  491. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  492. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  493. * the HTT tx MSDU extension descriptor.
  494. * The host is not required to provide the HTT tx MSDU extension descriptor
  495. * just because the target supports it; the target must check the
  496. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  497. * extension descriptor is present.
  498. */
  499. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  500. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  501. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  502. };
  503. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  504. struct htt_option_tlv_header_t hdr;
  505. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  506. } POSTPACK;
  507. /*
  508. * For the tcl data command V2 and higher support added a new
  509. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  510. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  511. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  512. * HTT option TLV for specifying which version of the TCL metadata struct
  513. * should be used:
  514. * V1 -> use htt_tx_tcl_metadata struct
  515. * V2 -> use htt_tx_tcl_metadata_v2 struct
  516. * Old FW will only support V1.
  517. * New FW will support V2. New FW will still support V1, at least during
  518. * a transition period.
  519. * Similarly, old host will only support V1, and new host will support V1 + V2.
  520. *
  521. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  522. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  523. * of TCL metadata the host supports. If the host doesn't provide a
  524. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  525. * is implicitly understood that the host only supports V1.
  526. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  527. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  528. * the host shall use. The target shall only select one of the versions
  529. * supported by the host. If the target doesn't provide a
  530. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  531. * is implicitly understood that the V1 TCL metadata shall be used.
  532. */
  533. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  534. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  535. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  536. };
  537. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  538. struct htt_option_tlv_header_t hdr;
  539. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  540. } POSTPACK;
  541. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  542. HTT_OPTION_TLV_VALUE0_SET(word, value)
  543. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  544. HTT_OPTION_TLV_VALUE0_GET(word)
  545. typedef struct {
  546. union {
  547. /* BIT [11 : 0] :- tag
  548. * BIT [23 : 12] :- length
  549. * BIT [31 : 24] :- reserved
  550. */
  551. A_UINT32 tag__length;
  552. /*
  553. * The following struct is not endian-portable.
  554. * It is suitable for use within the target, which is known to be
  555. * little-endian.
  556. * The host should use the above endian-portable macros to access
  557. * the tag and length bitfields in an endian-neutral manner.
  558. */
  559. struct {
  560. A_UINT32 tag : 12, /* BIT [11 : 0] */
  561. length : 12, /* BIT [23 : 12] */
  562. reserved : 8; /* BIT [31 : 24] */
  563. };
  564. };
  565. } htt_tlv_hdr_t;
  566. /** HTT stats TLV tag values */
  567. typedef enum {
  568. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  569. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  570. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  571. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  572. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  573. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  574. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  575. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  576. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  577. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  578. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  579. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  580. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  581. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  582. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  583. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  584. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  585. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  586. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  587. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  588. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  589. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  590. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  591. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  592. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  593. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  594. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  595. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  596. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  597. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  598. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  599. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  600. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  601. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  602. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  603. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  604. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  605. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  606. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  607. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  608. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  609. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  610. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  611. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  612. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  613. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  614. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  615. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  616. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  617. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  618. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  619. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  620. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  621. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  622. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  623. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  624. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  625. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  626. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  627. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  628. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  629. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  630. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  631. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  632. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  633. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  634. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  635. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  636. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  637. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  638. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  639. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  640. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  641. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  642. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  643. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  644. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  645. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  646. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  647. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  648. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  649. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  650. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  651. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  652. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  653. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  654. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  655. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  656. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  657. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  658. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  659. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  660. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  661. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  662. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  663. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  664. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  665. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  666. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  667. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  668. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  669. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  670. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  671. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  672. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  673. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  674. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  675. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  676. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  677. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  678. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  679. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  680. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  681. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  682. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  683. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  684. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  685. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  686. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  687. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  688. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  689. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  690. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  691. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  692. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  693. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  694. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  695. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  696. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  697. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  698. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  699. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  700. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  701. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  702. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  703. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  704. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  705. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  706. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  707. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  708. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  709. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  710. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  711. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  712. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  713. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  714. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  715. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  717. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  718. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  719. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  720. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  721. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  722. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  723. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  724. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  725. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  726. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  727. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  728. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  729. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  730. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  731. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  732. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  733. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  734. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  735. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  736. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  737. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  738. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  739. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  740. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  741. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  742. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  743. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  744. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  745. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  746. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  747. HTT_STATS_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  748. HTT_STATS_MAX_TAG,
  749. } htt_stats_tlv_tag_t;
  750. /* retain deprecated enum name as an alias for the current enum name */
  751. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  752. #define HTT_STATS_TLV_TAG_M 0x00000fff
  753. #define HTT_STATS_TLV_TAG_S 0
  754. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  755. #define HTT_STATS_TLV_LENGTH_S 12
  756. #define HTT_STATS_TLV_TAG_GET(_var) \
  757. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  758. HTT_STATS_TLV_TAG_S)
  759. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  760. do { \
  761. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  762. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  763. } while (0)
  764. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  765. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  766. HTT_STATS_TLV_LENGTH_S)
  767. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  768. do { \
  769. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  770. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  771. } while (0)
  772. /*=== host -> target messages ===============================================*/
  773. enum htt_h2t_msg_type {
  774. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  775. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  776. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  777. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  778. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  779. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  780. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  781. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  782. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  783. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  784. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  785. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  786. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  787. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  788. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  789. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  790. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  791. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  792. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  793. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  794. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  795. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  796. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  797. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  798. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  799. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  800. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  801. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  802. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  803. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  804. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  805. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  806. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  807. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  808. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  809. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  810. /* keep this last */
  811. HTT_H2T_NUM_MSGS
  812. };
  813. /*
  814. * HTT host to target message type -
  815. * stored in bits 7:0 of the first word of the message
  816. */
  817. #define HTT_H2T_MSG_TYPE_M 0xff
  818. #define HTT_H2T_MSG_TYPE_S 0
  819. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  820. do { \
  821. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  822. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  823. } while (0)
  824. #define HTT_H2T_MSG_TYPE_GET(word) \
  825. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  826. /**
  827. * @brief host -> target version number request message definition
  828. *
  829. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  830. *
  831. *
  832. * |31 24|23 16|15 8|7 0|
  833. * |----------------+----------------+----------------+----------------|
  834. * | reserved | msg type |
  835. * |-------------------------------------------------------------------|
  836. * : option request TLV (optional) |
  837. * :...................................................................:
  838. *
  839. * The VER_REQ message may consist of a single 4-byte word, or may be
  840. * extended with TLVs that specify which HTT options the host is requesting
  841. * from the target.
  842. * The following option TLVs may be appended to the VER_REQ message:
  843. * - HL_SUPPRESS_TX_COMPL_IND
  844. * - HL_MAX_TX_QUEUE_GROUPS
  845. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  846. * may be appended to the VER_REQ message (but only one TLV of each type).
  847. *
  848. * Header fields:
  849. * - MSG_TYPE
  850. * Bits 7:0
  851. * Purpose: identifies this as a version number request message
  852. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  853. */
  854. #define HTT_VER_REQ_BYTES 4
  855. /* TBDXXX: figure out a reasonable number */
  856. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  857. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  858. /**
  859. * @brief HTT tx MSDU descriptor
  860. *
  861. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  862. *
  863. * @details
  864. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  865. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  866. * the target firmware needs for the FW's tx processing, particularly
  867. * for creating the HW msdu descriptor.
  868. * The same HTT tx descriptor is used for HL and LL systems, though
  869. * a few fields within the tx descriptor are used only by LL or
  870. * only by HL.
  871. * The HTT tx descriptor is defined in two manners: by a struct with
  872. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  873. * definitions.
  874. * The target should use the struct def, for simplicitly and clarity,
  875. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  876. * neutral. Specifically, the host shall use the get/set macros built
  877. * around the mask + shift defs.
  878. */
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  882. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  883. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  884. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  885. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  886. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  887. #define HTT_TX_VDEV_ID_WORD 0
  888. #define HTT_TX_VDEV_ID_MASK 0x3f
  889. #define HTT_TX_VDEV_ID_SHIFT 16
  890. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  891. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  892. #define HTT_TX_MSDU_LEN_DWORD 1
  893. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  894. /*
  895. * HTT_VAR_PADDR macros
  896. * Allow physical / bus addresses to be either a single 32-bit value,
  897. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  898. */
  899. #define HTT_VAR_PADDR32(var_name) \
  900. A_UINT32 var_name
  901. #define HTT_VAR_PADDR64_LE(var_name) \
  902. struct { \
  903. /* little-endian: lo precedes hi */ \
  904. A_UINT32 lo; \
  905. A_UINT32 hi; \
  906. } var_name
  907. /*
  908. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  909. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  910. * addresses are stored in a XXX-bit field.
  911. * This macro is used to define both htt_tx_msdu_desc32_t and
  912. * htt_tx_msdu_desc64_t structs.
  913. */
  914. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  915. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  916. { \
  917. /* DWORD 0: flags and meta-data */ \
  918. A_UINT32 \
  919. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  920. \
  921. /* pkt_subtype - \
  922. * Detailed specification of the tx frame contents, extending the \
  923. * general specification provided by pkt_type. \
  924. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  925. * pkt_type | pkt_subtype \
  926. * ============================================================== \
  927. * 802.3 | bit 0:3 - Reserved \
  928. * | bit 4: 0x0 - Copy-Engine Classification Results \
  929. * | not appended to the HTT message \
  930. * | 0x1 - Copy-Engine Classification Results \
  931. * | appended to the HTT message in the \
  932. * | format: \
  933. * | [HTT tx desc, frame header, \
  934. * | CE classification results] \
  935. * | The CE classification results begin \
  936. * | at the next 4-byte boundary after \
  937. * | the frame header. \
  938. * ------------+------------------------------------------------- \
  939. * Eth2 | bit 0:3 - Reserved \
  940. * | bit 4: 0x0 - Copy-Engine Classification Results \
  941. * | not appended to the HTT message \
  942. * | 0x1 - Copy-Engine Classification Results \
  943. * | appended to the HTT message. \
  944. * | See the above specification of the \
  945. * | CE classification results location. \
  946. * ------------+------------------------------------------------- \
  947. * native WiFi | bit 0:3 - Reserved \
  948. * | bit 4: 0x0 - Copy-Engine Classification Results \
  949. * | not appended to the HTT message \
  950. * | 0x1 - Copy-Engine Classification Results \
  951. * | appended to the HTT message. \
  952. * | See the above specification of the \
  953. * | CE classification results location. \
  954. * ------------+------------------------------------------------- \
  955. * mgmt | 0x0 - 802.11 MAC header absent \
  956. * | 0x1 - 802.11 MAC header present \
  957. * ------------+------------------------------------------------- \
  958. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  959. * | 0x1 - 802.11 MAC header present \
  960. * | bit 1: 0x0 - allow aggregation \
  961. * | 0x1 - don't allow aggregation \
  962. * | bit 2: 0x0 - perform encryption \
  963. * | 0x1 - don't perform encryption \
  964. * | bit 3: 0x0 - perform tx classification / queuing \
  965. * | 0x1 - don't perform tx classification; \
  966. * | insert the frame into the "misc" \
  967. * | tx queue \
  968. * | bit 4: 0x0 - Copy-Engine Classification Results \
  969. * | not appended to the HTT message \
  970. * | 0x1 - Copy-Engine Classification Results \
  971. * | appended to the HTT message. \
  972. * | See the above specification of the \
  973. * | CE classification results location. \
  974. */ \
  975. pkt_subtype: 5, \
  976. \
  977. /* pkt_type - \
  978. * General specification of the tx frame contents. \
  979. * The htt_pkt_type enum should be used to specify and check the \
  980. * value of this field. \
  981. */ \
  982. pkt_type: 3, \
  983. \
  984. /* vdev_id - \
  985. * ID for the vdev that is sending this tx frame. \
  986. * For certain non-standard packet types, e.g. pkt_type == raw \
  987. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  988. * This field is used primarily for determining where to queue \
  989. * broadcast and multicast frames. \
  990. */ \
  991. vdev_id: 6, \
  992. /* ext_tid - \
  993. * The extended traffic ID. \
  994. * If the TID is unknown, the extended TID is set to \
  995. * HTT_TX_EXT_TID_INVALID. \
  996. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  997. * value of the QoS TID. \
  998. * If the tx frame is non-QoS data, then the extended TID is set to \
  999. * HTT_TX_EXT_TID_NON_QOS. \
  1000. * If the tx frame is multicast or broadcast, then the extended TID \
  1001. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1002. */ \
  1003. ext_tid: 5, \
  1004. \
  1005. /* postponed - \
  1006. * This flag indicates whether the tx frame has been downloaded to \
  1007. * the target before but discarded by the target, and now is being \
  1008. * downloaded again; or if this is a new frame that is being \
  1009. * downloaded for the first time. \
  1010. * This flag allows the target to determine the correct order for \
  1011. * transmitting new vs. old frames. \
  1012. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1013. * This flag only applies to HL systems, since in LL systems, \
  1014. * the tx flow control is handled entirely within the target. \
  1015. */ \
  1016. postponed: 1, \
  1017. \
  1018. /* extension - \
  1019. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1020. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1021. * \
  1022. * 0x0 - no extension MSDU descriptor is present \
  1023. * 0x1 - an extension MSDU descriptor immediately follows the \
  1024. * regular MSDU descriptor \
  1025. */ \
  1026. extension: 1, \
  1027. \
  1028. /* cksum_offload - \
  1029. * This flag indicates whether checksum offload is enabled or not \
  1030. * for this frame. Target FW use this flag to turn on HW checksumming \
  1031. * 0x0 - No checksum offload \
  1032. * 0x1 - L3 header checksum only \
  1033. * 0x2 - L4 checksum only \
  1034. * 0x3 - L3 header checksum + L4 checksum \
  1035. */ \
  1036. cksum_offload: 2, \
  1037. \
  1038. /* tx_comp_req - \
  1039. * This flag indicates whether Tx Completion \
  1040. * from fw is required or not. \
  1041. * This flag is only relevant if tx completion is not \
  1042. * universally enabled. \
  1043. * For all LL systems, tx completion is mandatory, \
  1044. * so this flag will be irrelevant. \
  1045. * For HL systems tx completion is optional, but HL systems in which \
  1046. * the bus throughput exceeds the WLAN throughput will \
  1047. * probably want to always use tx completion, and thus \
  1048. * would not check this flag. \
  1049. * This flag is required when tx completions are not used universally, \
  1050. * but are still required for certain tx frames for which \
  1051. * an OTA delivery acknowledgment is needed by the host. \
  1052. * In practice, this would be for HL systems in which the \
  1053. * bus throughput is less than the WLAN throughput. \
  1054. * \
  1055. * 0x0 - Tx Completion Indication from Fw not required \
  1056. * 0x1 - Tx Completion Indication from Fw is required \
  1057. */ \
  1058. tx_compl_req: 1; \
  1059. \
  1060. \
  1061. /* DWORD 1: MSDU length and ID */ \
  1062. A_UINT32 \
  1063. len: 16, /* MSDU length, in bytes */ \
  1064. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1065. * and this id is used to calculate fragmentation \
  1066. * descriptor pointer inside the target based on \
  1067. * the base address, configured inside the target. \
  1068. */ \
  1069. \
  1070. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1071. /* frags_desc_ptr - \
  1072. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1073. * where the tx frame's fragments reside in memory. \
  1074. * This field only applies to LL systems, since in HL systems the \
  1075. * (degenerate single-fragment) fragmentation descriptor is created \
  1076. * within the target. \
  1077. */ \
  1078. _paddr__frags_desc_ptr_; \
  1079. \
  1080. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1081. /* \
  1082. * Peer ID : Target can use this value to know which peer-id packet \
  1083. * destined to. \
  1084. * It's intended to be specified by host in case of NAWDS. \
  1085. */ \
  1086. A_UINT16 peerid; \
  1087. \
  1088. /* \
  1089. * Channel frequency: This identifies the desired channel \
  1090. * frequency (in mhz) for tx frames. This is used by FW to help \
  1091. * determine when it is safe to transmit or drop frames for \
  1092. * off-channel operation. \
  1093. * The default value of zero indicates to FW that the corresponding \
  1094. * VDEV's home channel (if there is one) is the desired channel \
  1095. * frequency. \
  1096. */ \
  1097. A_UINT16 chanfreq; \
  1098. \
  1099. /* Reason reserved is commented is increasing the htt structure size \
  1100. * leads to some weird issues. \
  1101. * A_UINT32 reserved_dword3_bits0_31; \
  1102. */ \
  1103. } POSTPACK
  1104. /* define a htt_tx_msdu_desc32_t type */
  1105. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1106. /* define a htt_tx_msdu_desc64_t type */
  1107. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1108. /*
  1109. * Make htt_tx_msdu_desc_t be an alias for either
  1110. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1111. */
  1112. #if HTT_PADDR64
  1113. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1114. #else
  1115. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1116. #endif
  1117. /* decriptor information for Management frame*/
  1118. /*
  1119. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1120. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1121. */
  1122. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1123. extern A_UINT32 mgmt_hdr_len;
  1124. PREPACK struct htt_mgmt_tx_desc_t {
  1125. A_UINT32 msg_type;
  1126. #if HTT_PADDR64
  1127. A_UINT64 frag_paddr; /* DMAble address of the data */
  1128. #else
  1129. A_UINT32 frag_paddr; /* DMAble address of the data */
  1130. #endif
  1131. A_UINT32 desc_id; /* returned to host during completion
  1132. * to free the meory*/
  1133. A_UINT32 len; /* Fragment length */
  1134. A_UINT32 vdev_id; /* virtual device ID*/
  1135. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1136. } POSTPACK;
  1137. PREPACK struct htt_mgmt_tx_compl_ind {
  1138. A_UINT32 desc_id;
  1139. A_UINT32 status;
  1140. } POSTPACK;
  1141. /*
  1142. * This SDU header size comes from the summation of the following:
  1143. * 1. Max of:
  1144. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1145. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1146. * b. 802.11 header, for raw frames: 36 bytes
  1147. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1148. * QoS header, HT header)
  1149. * c. 802.3 header, for ethernet frames: 14 bytes
  1150. * (destination address, source address, ethertype / length)
  1151. * 2. Max of:
  1152. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1153. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1154. * 3. 802.1Q VLAN header: 4 bytes
  1155. * 4. LLC/SNAP header: 8 bytes
  1156. */
  1157. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1158. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1159. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1160. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1161. A_COMPILE_TIME_ASSERT(
  1162. htt_encap_hdr_size_max_check_nwifi,
  1163. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1164. A_COMPILE_TIME_ASSERT(
  1165. htt_encap_hdr_size_max_check_enet,
  1166. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1167. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1168. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1169. #define HTT_TX_HDR_SIZE_802_1Q 4
  1170. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1171. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1172. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1173. HTT_TX_HDR_SIZE_802_1Q + \
  1174. HTT_TX_HDR_SIZE_LLC_SNAP)
  1175. #define HTT_HL_TX_FRM_HDR_LEN \
  1176. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1177. #define HTT_LL_TX_FRM_HDR_LEN \
  1178. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1179. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1180. /* dword 0 */
  1181. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1182. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1183. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1184. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1185. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1186. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1187. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1188. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1189. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1190. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1191. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1192. #define HTT_TX_DESC_PKT_TYPE_S 13
  1193. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1194. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1195. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1196. #define HTT_TX_DESC_VDEV_ID_S 16
  1197. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1198. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1199. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1200. #define HTT_TX_DESC_EXT_TID_S 22
  1201. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1202. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1203. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1204. #define HTT_TX_DESC_POSTPONED_S 27
  1205. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1206. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1207. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1208. #define HTT_TX_DESC_EXTENSION_S 28
  1209. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1210. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1211. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1212. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1213. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1214. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1215. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1216. #define HTT_TX_DESC_TX_COMP_S 31
  1217. /* dword 1 */
  1218. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1219. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1220. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1221. #define HTT_TX_DESC_FRM_LEN_S 0
  1222. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1223. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1224. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1225. #define HTT_TX_DESC_FRM_ID_S 16
  1226. /* dword 2 */
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1229. /* for systems using 64-bit format for bus addresses */
  1230. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1231. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1232. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1233. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1234. /* for systems using 32-bit format for bus addresses */
  1235. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1236. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1237. /* dword 3 */
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1239. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1240. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1241. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1242. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1243. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1244. #if HTT_PADDR64
  1245. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1246. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1247. #else
  1248. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1249. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1250. #endif
  1251. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1252. #define HTT_TX_DESC_PEER_ID_S 0
  1253. /*
  1254. * TEMPORARY:
  1255. * The original definitions for the PEER_ID fields contained typos
  1256. * (with _DESC_PADDR appended to this PEER_ID field name).
  1257. * Retain deprecated original names for PEER_ID fields until all code that
  1258. * refers to them has been updated.
  1259. */
  1260. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1261. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1262. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1263. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1264. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1265. HTT_TX_DESC_PEER_ID_M
  1266. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1267. HTT_TX_DESC_PEER_ID_S
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1269. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1270. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1271. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1272. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1273. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1274. #if HTT_PADDR64
  1275. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1276. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1277. #else
  1278. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1279. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1280. #endif
  1281. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1282. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1283. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1285. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1292. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1299. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1306. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1310. } while (0)
  1311. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1312. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1313. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1317. } while (0)
  1318. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1319. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1320. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1324. } while (0)
  1325. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1326. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1327. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1331. } while (0)
  1332. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1333. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1334. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1338. } while (0)
  1339. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1340. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1341. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1342. do { \
  1343. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1344. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1345. } while (0)
  1346. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1347. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1348. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1352. } while (0)
  1353. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1354. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1355. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1356. do { \
  1357. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1358. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1359. } while (0)
  1360. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1361. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1362. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1366. } while (0)
  1367. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1368. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1369. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1373. } while (0)
  1374. /* enums used in the HTT tx MSDU extension descriptor */
  1375. enum {
  1376. htt_tx_guard_interval_regular = 0,
  1377. htt_tx_guard_interval_short = 1,
  1378. };
  1379. enum {
  1380. htt_tx_preamble_type_ofdm = 0,
  1381. htt_tx_preamble_type_cck = 1,
  1382. htt_tx_preamble_type_ht = 2,
  1383. htt_tx_preamble_type_vht = 3,
  1384. };
  1385. enum {
  1386. htt_tx_bandwidth_5MHz = 0,
  1387. htt_tx_bandwidth_10MHz = 1,
  1388. htt_tx_bandwidth_20MHz = 2,
  1389. htt_tx_bandwidth_40MHz = 3,
  1390. htt_tx_bandwidth_80MHz = 4,
  1391. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1392. };
  1393. /**
  1394. * @brief HTT tx MSDU extension descriptor
  1395. * @details
  1396. * If the target supports HTT tx MSDU extension descriptors, the host has
  1397. * the option of appending the following struct following the regular
  1398. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1399. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1400. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1401. * tx specs for each frame.
  1402. */
  1403. PREPACK struct htt_tx_msdu_desc_ext_t {
  1404. /* DWORD 0: flags */
  1405. A_UINT32
  1406. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1407. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1408. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1409. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1410. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1411. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1412. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1413. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1414. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1415. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1416. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1417. /* DWORD 1: tx power, tx rate, tx BW */
  1418. A_UINT32
  1419. /* pwr -
  1420. * Specify what power the tx frame needs to be transmitted at.
  1421. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1422. * The value needs to be appropriately sign-extended when extracting
  1423. * the value from the message and storing it in a variable that is
  1424. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1425. * automatically handles this sign-extension.)
  1426. * If the transmission uses multiple tx chains, this power spec is
  1427. * the total transmit power, assuming incoherent combination of
  1428. * per-chain power to produce the total power.
  1429. */
  1430. pwr: 8,
  1431. /* mcs_mask -
  1432. * Specify the allowable values for MCS index (modulation and coding)
  1433. * to use for transmitting the frame.
  1434. *
  1435. * For HT / VHT preamble types, this mask directly corresponds to
  1436. * the HT or VHT MCS indices that are allowed. For each bit N set
  1437. * within the mask, MCS index N is allowed for transmitting the frame.
  1438. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1439. * rates versus OFDM rates, so the host has the option of specifying
  1440. * that the target must transmit the frame with CCK or OFDM rates
  1441. * (not HT or VHT), but leaving the decision to the target whether
  1442. * to use CCK or OFDM.
  1443. *
  1444. * For CCK and OFDM, the bits within this mask are interpreted as
  1445. * follows:
  1446. * bit 0 -> CCK 1 Mbps rate is allowed
  1447. * bit 1 -> CCK 2 Mbps rate is allowed
  1448. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1449. * bit 3 -> CCK 11 Mbps rate is allowed
  1450. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1451. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1452. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1453. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1454. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1455. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1456. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1457. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1458. *
  1459. * The MCS index specification needs to be compatible with the
  1460. * bandwidth mask specification. For example, a MCS index == 9
  1461. * specification is inconsistent with a preamble type == VHT,
  1462. * Nss == 1, and channel bandwidth == 20 MHz.
  1463. *
  1464. * Furthermore, the host has only a limited ability to specify to
  1465. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1466. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1467. */
  1468. mcs_mask: 12,
  1469. /* nss_mask -
  1470. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1471. * Each bit in this mask corresponds to a Nss value:
  1472. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1473. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1474. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1475. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1476. * The values in the Nss mask must be suitable for the recipient, e.g.
  1477. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1478. * recipient which only supports 2x2 MIMO.
  1479. */
  1480. nss_mask: 4,
  1481. /* guard_interval -
  1482. * Specify a htt_tx_guard_interval enum value to indicate whether
  1483. * the transmission should use a regular guard interval or a
  1484. * short guard interval.
  1485. */
  1486. guard_interval: 1,
  1487. /* preamble_type_mask -
  1488. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1489. * may choose from for transmitting this frame.
  1490. * The bits in this mask correspond to the values in the
  1491. * htt_tx_preamble_type enum. For example, to allow the target
  1492. * to transmit the frame as either CCK or OFDM, this field would
  1493. * be set to
  1494. * (1 << htt_tx_preamble_type_ofdm) |
  1495. * (1 << htt_tx_preamble_type_cck)
  1496. */
  1497. preamble_type_mask: 4,
  1498. reserved1_31_29: 3; /* unused, set to 0x0 */
  1499. /* DWORD 2: tx chain mask, tx retries */
  1500. A_UINT32
  1501. /* chain_mask - specify which chains to transmit from */
  1502. chain_mask: 4,
  1503. /* retry_limit -
  1504. * Specify the maximum number of transmissions, including the
  1505. * initial transmission, to attempt before giving up if no ack
  1506. * is received.
  1507. * If the tx rate is specified, then all retries shall use the
  1508. * same rate as the initial transmission.
  1509. * If no tx rate is specified, the target can choose whether to
  1510. * retain the original rate during the retransmissions, or to
  1511. * fall back to a more robust rate.
  1512. */
  1513. retry_limit: 4,
  1514. /* bandwidth_mask -
  1515. * Specify what channel widths may be used for the transmission.
  1516. * A value of zero indicates "don't care" - the target may choose
  1517. * the transmission bandwidth.
  1518. * The bits within this mask correspond to the htt_tx_bandwidth
  1519. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1520. * The bandwidth_mask must be consistent with the preamble_type_mask
  1521. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1522. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1523. */
  1524. bandwidth_mask: 6,
  1525. reserved2_31_14: 18; /* unused, set to 0x0 */
  1526. /* DWORD 3: tx expiry time (TSF) LSBs */
  1527. A_UINT32 expire_tsf_lo;
  1528. /* DWORD 4: tx expiry time (TSF) MSBs */
  1529. A_UINT32 expire_tsf_hi;
  1530. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1531. } POSTPACK;
  1532. /* DWORD 0 */
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1551. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1553. /* DWORD 1 */
  1554. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1555. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1556. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1557. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1558. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1559. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1560. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1561. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1562. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1563. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1564. /* DWORD 2 */
  1565. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1566. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1567. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1568. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1569. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1570. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1571. /* DWORD 0 */
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL( \
  1594. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1595. ((_var) |= ((_val) \
  1596. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1597. } while (0)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1600. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL( \
  1604. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1605. ((_var) |= ((_val) \
  1606. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1607. } while (0)
  1608. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1610. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1612. do { \
  1613. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1614. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1615. } while (0)
  1616. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1617. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1618. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1619. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1620. do { \
  1621. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1622. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1623. } while (0)
  1624. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1626. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1627. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1628. do { \
  1629. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1630. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1634. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1635. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1642. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1643. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1647. } while (0)
  1648. /* DWORD 1 */
  1649. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1651. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1652. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1653. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1654. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1655. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1656. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1657. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1658. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1659. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1660. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1661. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1668. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1669. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1676. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1677. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1684. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1685. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1689. } while (0)
  1690. /* DWORD 2 */
  1691. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1693. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1694. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1701. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1702. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1709. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1710. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1714. } while (0)
  1715. typedef enum {
  1716. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1717. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1718. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1719. } htt_11ax_ltf_subtype_t;
  1720. typedef enum {
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1722. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1723. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1724. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1725. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1726. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1727. } htt_tx_ext2_preamble_type_t;
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1738. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1739. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1740. /**
  1741. * @brief HTT tx MSDU extension descriptor v2
  1742. * @details
  1743. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1744. * is received as tcl_exit_base->host_meta_info in firmware.
  1745. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1746. * are already part of tcl_exit_base.
  1747. */
  1748. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1749. /* DWORD 0: flags */
  1750. A_UINT32
  1751. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1752. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1753. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1754. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1755. valid_retries : 1, /* if set, tx retries spec is valid */
  1756. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1757. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1758. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1759. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1760. valid_key_flags : 1, /* if set, key flags is valid */
  1761. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1762. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1763. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1764. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1765. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1766. 1 = ENCRYPT,
  1767. 2 ~ 3 - Reserved */
  1768. /* retry_limit -
  1769. * Specify the maximum number of transmissions, including the
  1770. * initial transmission, to attempt before giving up if no ack
  1771. * is received.
  1772. * If the tx rate is specified, then all retries shall use the
  1773. * same rate as the initial transmission.
  1774. * If no tx rate is specified, the target can choose whether to
  1775. * retain the original rate during the retransmissions, or to
  1776. * fall back to a more robust rate.
  1777. */
  1778. retry_limit : 4,
  1779. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1780. * Valid only for 11ax preamble types HE_SU
  1781. * and HE_EXT_SU
  1782. */
  1783. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1784. * Valid only for 11ax preamble types HE_SU
  1785. * and HE_EXT_SU
  1786. */
  1787. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1788. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1789. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1790. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1791. */
  1792. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1793. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1794. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1795. * Use cases:
  1796. * Any time firmware uses TQM-BYPASS for Data
  1797. * TID, firmware expect host to set this bit.
  1798. */
  1799. /* DWORD 1: tx power, tx rate */
  1800. A_UINT32
  1801. power : 8, /* unit of the power field is 0.5 dbm
  1802. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1803. * signed value ranging from -64dbm to 63.5 dbm
  1804. */
  1805. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1806. * Setting more than one MCS isn't currently
  1807. * supported by the target (but is supported
  1808. * in the interface in case in the future
  1809. * the target supports specifications of
  1810. * a limited set of MCS values.
  1811. */
  1812. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1813. * Setting more than one Nss isn't currently
  1814. * supported by the target (but is supported
  1815. * in the interface in case in the future
  1816. * the target supports specifications of
  1817. * a limited set of Nss values.
  1818. */
  1819. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1820. update_peer_cache : 1; /* When set these custom values will be
  1821. * used for all packets, until the next
  1822. * update via this ext header.
  1823. * This is to make sure not all packets
  1824. * need to include this header.
  1825. */
  1826. /* DWORD 2: tx chain mask, tx retries */
  1827. A_UINT32
  1828. /* chain_mask - specify which chains to transmit from */
  1829. chain_mask : 8,
  1830. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1831. * TODO: Update Enum values for key_flags
  1832. */
  1833. /*
  1834. * Channel frequency: This identifies the desired channel
  1835. * frequency (in MHz) for tx frames. This is used by FW to help
  1836. * determine when it is safe to transmit or drop frames for
  1837. * off-channel operation.
  1838. * The default value of zero indicates to FW that the corresponding
  1839. * VDEV's home channel (if there is one) is the desired channel
  1840. * frequency.
  1841. */
  1842. chanfreq : 16;
  1843. /* DWORD 3: tx expiry time (TSF) LSBs */
  1844. A_UINT32 expire_tsf_lo;
  1845. /* DWORD 4: tx expiry time (TSF) MSBs */
  1846. A_UINT32 expire_tsf_hi;
  1847. /* DWORD 5: flags to control routing / processing of the MSDU */
  1848. A_UINT32
  1849. /* learning_frame
  1850. * When this flag is set, this frame will be dropped by FW
  1851. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1852. */
  1853. learning_frame : 1,
  1854. /* send_as_standalone
  1855. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1856. * i.e. with no A-MSDU or A-MPDU aggregation.
  1857. * The scope is extended to other use-cases.
  1858. */
  1859. send_as_standalone : 1,
  1860. /* is_host_opaque_valid
  1861. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1862. * with valid information.
  1863. */
  1864. is_host_opaque_valid : 1,
  1865. traffic_end_indication: 1,
  1866. rsvd0 : 28;
  1867. /* DWORD 6 : Host opaque cookie for special frames */
  1868. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1869. rsvd1 : 16;
  1870. /*
  1871. * This structure can be expanded further up to 40 bytes
  1872. * by adding further DWORDs as needed.
  1873. */
  1874. } POSTPACK;
  1875. /* DWORD 0 */
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1902. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1903. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1904. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1905. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1906. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1907. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1908. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1909. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1910. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1911. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1912. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1913. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1914. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1915. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1916. /* DWORD 1 */
  1917. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1918. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1919. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1920. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1921. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1922. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1923. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1924. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1925. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1926. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1927. /* DWORD 2 */
  1928. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1929. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1930. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1931. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1932. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1933. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1934. /* DWORD 5 */
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1941. /* DWORD 6 */
  1942. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1943. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1944. /* DWORD 0 */
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1946. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1947. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1952. } while (0)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1954. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1955. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1960. } while (0)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1962. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1963. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1968. } while (0)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1970. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1971. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL( \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1976. ((_var) |= ((_val) \
  1977. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1978. } while (0)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1980. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1981. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1986. } while (0)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1994. } while (0)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL( \
  2001. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2002. ((_var) |= ((_val) \
  2003. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2052. } while (0)
  2053. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2057. do { \
  2058. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2059. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2060. } while (0)
  2061. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2062. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2063. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2064. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2065. do { \
  2066. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2067. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2068. } while (0)
  2069. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2070. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2071. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2072. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2073. do { \
  2074. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2075. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2076. } while (0)
  2077. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2078. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2079. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2080. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2081. do { \
  2082. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2083. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2084. } while (0)
  2085. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2092. } while (0)
  2093. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2100. } while (0)
  2101. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2102. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2103. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2104. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2108. } while (0)
  2109. /* DWORD 1 */
  2110. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2114. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2115. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2116. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2117. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2118. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2119. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2120. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2121. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2122. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2123. do { \
  2124. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2125. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2126. } while (0)
  2127. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2128. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2129. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2130. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2131. do { \
  2132. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2133. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2134. } while (0)
  2135. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2136. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2137. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2138. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2139. do { \
  2140. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2141. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2142. } while (0)
  2143. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2144. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2145. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2146. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2150. } while (0)
  2151. /* DWORD 2 */
  2152. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2153. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2154. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2155. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2159. } while (0)
  2160. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2162. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2163. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2167. } while (0)
  2168. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2169. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2170. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2171. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2175. } while (0)
  2176. /* DWORD 5 */
  2177. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2178. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2179. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2180. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2184. } while (0)
  2185. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2186. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2187. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2188. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2189. do { \
  2190. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2191. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2192. } while (0)
  2193. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2194. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2195. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2196. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2197. do { \
  2198. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2199. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2200. } while (0)
  2201. /* DWORD 6 */
  2202. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2203. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2204. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2205. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2206. do { \
  2207. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2208. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2209. } while (0)
  2210. typedef enum {
  2211. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2212. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2213. } htt_tcl_metadata_type;
  2214. /**
  2215. * @brief HTT TCL command number format
  2216. * @details
  2217. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2218. * available to firmware as tcl_exit_base->tcl_status_number.
  2219. * For regular / multicast packets host will send vdev and mac id and for
  2220. * NAWDS packets, host will send peer id.
  2221. * A_UINT32 is used to avoid endianness conversion problems.
  2222. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2223. */
  2224. typedef struct {
  2225. A_UINT32
  2226. type: 1, /* vdev_id based or peer_id based */
  2227. rsvd: 31;
  2228. } htt_tx_tcl_vdev_or_peer_t;
  2229. typedef struct {
  2230. A_UINT32
  2231. type: 1, /* vdev_id based or peer_id based */
  2232. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2233. vdev_id: 8,
  2234. pdev_id: 2,
  2235. host_inspected:1,
  2236. rsvd: 19;
  2237. } htt_tx_tcl_vdev_metadata;
  2238. typedef struct {
  2239. A_UINT32
  2240. type: 1, /* vdev_id based or peer_id based */
  2241. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2242. peer_id: 14,
  2243. rsvd: 16;
  2244. } htt_tx_tcl_peer_metadata;
  2245. PREPACK struct htt_tx_tcl_metadata {
  2246. union {
  2247. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2248. htt_tx_tcl_vdev_metadata vdev_meta;
  2249. htt_tx_tcl_peer_metadata peer_meta;
  2250. };
  2251. } POSTPACK;
  2252. /* DWORD 0 */
  2253. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2254. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2255. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2256. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2257. /* VDEV metadata */
  2258. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2259. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2260. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2261. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2262. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2263. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2264. /* PEER metadata */
  2265. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2266. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2267. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2268. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2269. HTT_TX_TCL_METADATA_TYPE_S)
  2270. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2274. } while (0)
  2275. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2276. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2277. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2278. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2282. } while (0)
  2283. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2284. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2285. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2286. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2290. } while (0)
  2291. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2292. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2293. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2294. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2298. } while (0)
  2299. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2300. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2301. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2302. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2303. do { \
  2304. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2305. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2306. } while (0)
  2307. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2308. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2309. HTT_TX_TCL_METADATA_PEER_ID_S)
  2310. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2311. do { \
  2312. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2313. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2314. } while (0)
  2315. /*------------------------------------------------------------------
  2316. * V2 Version of TCL Data Command
  2317. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2318. * MLO global_seq all flavours of TCL Data Cmd.
  2319. *-----------------------------------------------------------------*/
  2320. typedef enum {
  2321. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2322. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2323. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2324. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2325. } htt_tcl_metadata_type_v2;
  2326. /**
  2327. * @brief HTT TCL command number format
  2328. * @details
  2329. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2330. * available to firmware as tcl_exit_base->tcl_status_number.
  2331. * A_UINT32 is used to avoid endianness conversion problems.
  2332. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2333. */
  2334. typedef struct {
  2335. A_UINT32
  2336. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2337. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2338. vdev_id: 8,
  2339. pdev_id: 2,
  2340. host_inspected:1,
  2341. rsvd: 2,
  2342. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2343. } htt_tx_tcl_vdev_metadata_v2;
  2344. typedef struct {
  2345. A_UINT32
  2346. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2347. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2348. peer_id: 13,
  2349. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2350. } htt_tx_tcl_peer_metadata_v2;
  2351. typedef struct {
  2352. A_UINT32
  2353. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2354. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2355. svc_class_id: 8,
  2356. rsvd: 5,
  2357. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2358. } htt_tx_tcl_svc_class_id_metadata;
  2359. typedef struct {
  2360. A_UINT32
  2361. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2362. host_inspected: 1,
  2363. global_seq_no: 12,
  2364. rsvd: 1,
  2365. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2366. } htt_tx_tcl_global_seq_metadata;
  2367. PREPACK struct htt_tx_tcl_metadata_v2 {
  2368. union {
  2369. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2370. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2371. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2372. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2373. };
  2374. } POSTPACK;
  2375. /* DWORD 0 */
  2376. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2377. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2378. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2379. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2380. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2381. /* VDEV V2 metadata */
  2382. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2383. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2384. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2385. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2386. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2387. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2388. /* PEER V2 metadata */
  2389. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2390. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2391. /* SVC_CLASS_ID metadata */
  2392. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2393. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2394. /* Global Seq no metadata */
  2395. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2397. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2398. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2399. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2400. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2401. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2402. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2403. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2406. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2407. } while (0)
  2408. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2409. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2410. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2411. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2412. do { \
  2413. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2414. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2415. } while (0)
  2416. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2417. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2418. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2419. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2420. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2424. } while (0)
  2425. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2426. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2427. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2428. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2432. } while (0)
  2433. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2434. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2435. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2436. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2440. } while (0)
  2441. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2442. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2443. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2444. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2445. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2448. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2449. } while (0)
  2450. /*----- Get and Set V2 type field in Service Class fields ----*/
  2451. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2452. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2453. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2454. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2458. } while (0)
  2459. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2460. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2461. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2462. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2463. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2466. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2467. } while (0)
  2468. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2469. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2470. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2471. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2474. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2475. } while (0)
  2476. /*------------------------------------------------------------------
  2477. * End V2 Version of TCL Data Command
  2478. *-----------------------------------------------------------------*/
  2479. typedef enum {
  2480. HTT_TX_FW2WBM_TX_STATUS_OK,
  2481. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2482. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2483. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2484. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2485. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2486. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2487. HTT_TX_FW2WBM_TX_STATUS_MAX
  2488. } htt_tx_fw2wbm_tx_status_t;
  2489. typedef enum {
  2490. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2491. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2492. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2495. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2496. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2497. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2498. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2499. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2500. } htt_tx_fw2wbm_reinject_reason_t;
  2501. /**
  2502. * @brief HTT TX WBM Completion from firmware to host
  2503. * @details
  2504. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2505. * DWORD 3 and 4 for software based completions (Exception frames and
  2506. * TQM bypass frames)
  2507. * For software based completions, wbm_release_ring->release_source_module will
  2508. * be set to release_source_fw
  2509. */
  2510. PREPACK struct htt_tx_wbm_completion {
  2511. A_UINT32
  2512. sch_cmd_id: 24,
  2513. exception_frame: 1, /* If set, this packet was queued via exception path */
  2514. rsvd0_31_25: 7;
  2515. A_UINT32
  2516. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2517. * reception of an ACK or BA, this field indicates
  2518. * the RSSI of the received ACK or BA frame.
  2519. * When the frame is removed as result of a direct
  2520. * remove command from the SW, this field is set
  2521. * to 0x0 (which is never a valid value when real
  2522. * RSSI is available).
  2523. * Units: dB w.r.t noise floor
  2524. */
  2525. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2526. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2527. rsvd1_31_16: 16;
  2528. } POSTPACK;
  2529. /* DWORD 0 */
  2530. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2531. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2532. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2533. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2534. /* DWORD 1 */
  2535. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2536. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2537. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2538. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2539. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2540. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2541. /* DWORD 0 */
  2542. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2543. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2544. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2545. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2548. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2549. } while (0)
  2550. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2551. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2552. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2553. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2556. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2557. } while (0)
  2558. /* DWORD 1 */
  2559. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2560. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2561. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2562. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2563. do { \
  2564. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2565. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2566. } while (0)
  2567. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2568. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2569. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2570. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2571. do { \
  2572. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2573. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2574. } while (0)
  2575. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2576. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2577. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2578. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2579. do { \
  2580. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2581. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2582. } while (0)
  2583. /**
  2584. * @brief HTT TX WBM Completion from firmware to host
  2585. * @details
  2586. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2587. * (WBM) offload HW.
  2588. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2589. * For software based completions, release_source_module will
  2590. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2591. * struct wbm_release_ring and then switch to this after looking at
  2592. * release_source_module.
  2593. */
  2594. PREPACK struct htt_tx_wbm_completion_v2 {
  2595. A_UINT32
  2596. used_by_hw0; /* Refer to struct wbm_release_ring */
  2597. A_UINT32
  2598. used_by_hw1; /* Refer to struct wbm_release_ring */
  2599. A_UINT32
  2600. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2601. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2602. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2603. exception_frame: 1,
  2604. rsvd0: 12, /* For future use */
  2605. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2606. rsvd1: 1; /* For future use */
  2607. A_UINT32
  2608. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2609. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2610. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2611. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2612. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2613. */
  2614. A_UINT32
  2615. data1: 32;
  2616. A_UINT32
  2617. data2: 32;
  2618. A_UINT32
  2619. used_by_hw3; /* Refer to struct wbm_release_ring */
  2620. } POSTPACK;
  2621. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2622. /* DWORD 3 */
  2623. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2624. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2625. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2626. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2627. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2628. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2629. /* DWORD 3 */
  2630. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2631. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2632. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2633. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2634. do { \
  2635. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2636. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2637. } while (0)
  2638. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2639. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2640. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2641. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2642. do { \
  2643. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2644. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2645. } while (0)
  2646. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2647. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2648. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2649. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2652. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2653. } while (0)
  2654. /**
  2655. * @brief HTT TX WBM Completion from firmware to host (V3)
  2656. * @details
  2657. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2658. * (WBM) offload HW.
  2659. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2660. * For software based completions, release_source_module will
  2661. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2662. * struct wbm_release_ring and then switch to this after looking at
  2663. * release_source_module.
  2664. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2665. * by new generations of targets.
  2666. */
  2667. PREPACK struct htt_tx_wbm_completion_v3 {
  2668. A_UINT32
  2669. used_by_hw0; /* Refer to struct wbm_release_ring */
  2670. A_UINT32
  2671. used_by_hw1; /* Refer to struct wbm_release_ring */
  2672. A_UINT32
  2673. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2674. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2675. used_by_hw3: 15;
  2676. A_UINT32
  2677. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2678. exception_frame: 1,
  2679. rsvd0: 27; /* For future use */
  2680. A_UINT32
  2681. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2682. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2683. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2684. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2685. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2686. */
  2687. A_UINT32
  2688. data1: 32;
  2689. A_UINT32
  2690. data2: 32;
  2691. A_UINT32
  2692. rsvd1: 20,
  2693. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2694. } POSTPACK;
  2695. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2696. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2697. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2698. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2699. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2700. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2701. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2702. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2703. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2704. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2705. do { \
  2706. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2707. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2708. } while (0)
  2709. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2710. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2711. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2712. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2713. do { \
  2714. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2715. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2716. } while (0)
  2717. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2718. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2719. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2720. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2721. do { \
  2722. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2723. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2724. } while (0)
  2725. typedef enum {
  2726. TX_FRAME_TYPE_UNDEFINED = 0,
  2727. TX_FRAME_TYPE_EAPOL = 1,
  2728. } htt_tx_wbm_status_frame_type;
  2729. /**
  2730. * @brief HTT TX WBM transmit status from firmware to host
  2731. * @details
  2732. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2733. * (WBM) offload HW.
  2734. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2735. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2736. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2737. */
  2738. PREPACK struct htt_tx_wbm_transmit_status {
  2739. A_UINT32
  2740. sch_cmd_id: 24,
  2741. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2742. * reception of an ACK or BA, this field indicates
  2743. * the RSSI of the received ACK or BA frame.
  2744. * When the frame is removed as result of a direct
  2745. * remove command from the SW, this field is set
  2746. * to 0x0 (which is never a valid value when real
  2747. * RSSI is available).
  2748. * Units: dB w.r.t noise floor
  2749. */
  2750. A_UINT32
  2751. sw_peer_id: 16,
  2752. tid_num: 5,
  2753. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2754. * and tid_num fields contain valid data.
  2755. * If this "valid" flag is not set, the
  2756. * sw_peer_id and tid_num fields must be ignored.
  2757. */
  2758. mcast: 1,
  2759. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2760. * contains valid data.
  2761. */
  2762. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2763. reserved: 4;
  2764. A_UINT32
  2765. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2766. * packets in the wbm completion path
  2767. */
  2768. } POSTPACK;
  2769. /* DWORD 4 */
  2770. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2771. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2772. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2773. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2774. /* DWORD 5 */
  2775. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2776. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2777. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2778. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2779. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2780. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2782. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2783. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2784. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2785. /* DWORD 4 */
  2786. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2787. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2788. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2789. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2792. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2793. } while (0)
  2794. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2795. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2796. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2797. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2798. do { \
  2799. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2800. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2801. } while (0)
  2802. /* DWORD 5 */
  2803. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2804. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2805. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2806. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2809. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2810. } while (0)
  2811. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2812. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2813. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2814. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2817. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2818. } while (0)
  2819. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2820. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2821. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2822. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2825. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2826. } while (0)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2828. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2829. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2830. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2833. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2834. } while (0)
  2835. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2836. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2837. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2838. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2841. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2842. } while (0)
  2843. /**
  2844. * @brief HTT TX WBM reinject status from firmware to host
  2845. * @details
  2846. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2847. * (WBM) offload HW.
  2848. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2849. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2850. */
  2851. PREPACK struct htt_tx_wbm_reinject_status {
  2852. A_UINT32
  2853. reserved0: 32;
  2854. A_UINT32
  2855. reserved1: 32;
  2856. A_UINT32
  2857. reserved2: 32;
  2858. } POSTPACK;
  2859. /**
  2860. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2861. * @details
  2862. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2863. * (WBM) offload HW.
  2864. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2865. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2866. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2867. * STA side.
  2868. */
  2869. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2870. A_UINT32
  2871. mec_sa_addr_31_0;
  2872. A_UINT32
  2873. mec_sa_addr_47_32: 16,
  2874. sa_ast_index: 16;
  2875. A_UINT32
  2876. vdev_id: 8,
  2877. reserved0: 24;
  2878. } POSTPACK;
  2879. /* DWORD 4 - mec_sa_addr_31_0 */
  2880. /* DWORD 5 */
  2881. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2882. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2883. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2884. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2885. /* DWORD 6 */
  2886. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2887. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2888. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2889. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2890. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2891. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2894. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2895. } while (0)
  2896. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2897. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2898. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2899. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2902. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2903. } while (0)
  2904. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2905. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2906. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2907. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2910. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2911. } while (0)
  2912. typedef enum {
  2913. TX_FLOW_PRIORITY_BE,
  2914. TX_FLOW_PRIORITY_HIGH,
  2915. TX_FLOW_PRIORITY_LOW,
  2916. } htt_tx_flow_priority_t;
  2917. typedef enum {
  2918. TX_FLOW_LATENCY_SENSITIVE,
  2919. TX_FLOW_LATENCY_INSENSITIVE,
  2920. } htt_tx_flow_latency_t;
  2921. typedef enum {
  2922. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2923. TX_FLOW_INTERACTIVE_TRAFFIC,
  2924. TX_FLOW_PERIODIC_TRAFFIC,
  2925. TX_FLOW_BURSTY_TRAFFIC,
  2926. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2927. } htt_tx_flow_traffic_pattern_t;
  2928. /**
  2929. * @brief HTT TX Flow search metadata format
  2930. * @details
  2931. * Host will set this metadata in flow table's flow search entry along with
  2932. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2933. * firmware and TQM ring if the flow search entry wins.
  2934. * This metadata is available to firmware in that first MSDU's
  2935. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2936. * to one of the available flows for specific tid and returns the tqm flow
  2937. * pointer as part of htt_tx_map_flow_info message.
  2938. */
  2939. PREPACK struct htt_tx_flow_metadata {
  2940. A_UINT32
  2941. rsvd0_1_0: 2,
  2942. tid: 4,
  2943. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2944. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2945. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2946. * Else choose final tid based on latency, priority.
  2947. */
  2948. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2949. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2950. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2951. } POSTPACK;
  2952. /* DWORD 0 */
  2953. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2954. #define HTT_TX_FLOW_METADATA_TID_S 2
  2955. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2956. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2957. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2958. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2959. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2960. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2961. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2962. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2963. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2964. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2965. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2966. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2967. /* DWORD 0 */
  2968. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2969. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2970. HTT_TX_FLOW_METADATA_TID_S)
  2971. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2974. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2975. } while (0)
  2976. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2977. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2978. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2979. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2982. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2983. } while (0)
  2984. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2985. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2986. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2987. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2990. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2991. } while (0)
  2992. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2993. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2994. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2995. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2998. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2999. } while (0)
  3000. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  3001. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3002. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3003. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3006. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3007. } while (0)
  3008. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3009. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3010. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3011. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3014. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3015. } while (0)
  3016. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3017. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3018. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3019. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3022. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3023. } while (0)
  3024. /**
  3025. * @brief host -> target ADD WDS Entry
  3026. *
  3027. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3028. *
  3029. * @brief host -> target DELETE WDS Entry
  3030. *
  3031. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3032. *
  3033. * @details
  3034. * HTT wds entry from source port learning
  3035. * Host will learn wds entries from rx and send this message to firmware
  3036. * to enable firmware to configure/delete AST entries for wds clients.
  3037. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3038. * and when SA's entry is deleted, firmware removes this AST entry
  3039. *
  3040. * The message would appear as follows:
  3041. *
  3042. * |31 30|29 |17 16|15 8|7 0|
  3043. * |----------------+----------------+----------------+----------------|
  3044. * | rsvd0 |PDVID| vdev_id | msg_type |
  3045. * |-------------------------------------------------------------------|
  3046. * | sa_addr_31_0 |
  3047. * |-------------------------------------------------------------------|
  3048. * | | ta_peer_id | sa_addr_47_32 |
  3049. * |-------------------------------------------------------------------|
  3050. * Where PDVID = pdev_id
  3051. *
  3052. * The message is interpreted as follows:
  3053. *
  3054. * dword0 - b'0:7 - msg_type: This will be set to
  3055. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3056. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3057. *
  3058. * dword0 - b'8:15 - vdev_id
  3059. *
  3060. * dword0 - b'16:17 - pdev_id
  3061. *
  3062. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3063. *
  3064. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3065. *
  3066. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3067. *
  3068. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3069. */
  3070. PREPACK struct htt_wds_entry {
  3071. A_UINT32
  3072. msg_type: 8,
  3073. vdev_id: 8,
  3074. pdev_id: 2,
  3075. rsvd0: 14;
  3076. A_UINT32 sa_addr_31_0;
  3077. A_UINT32
  3078. sa_addr_47_32: 16,
  3079. ta_peer_id: 14,
  3080. rsvd2: 2;
  3081. } POSTPACK;
  3082. /* DWORD 0 */
  3083. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3084. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3085. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3086. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3087. /* DWORD 2 */
  3088. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3089. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3090. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3091. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3092. /* DWORD 0 */
  3093. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3094. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3095. HTT_WDS_ENTRY_VDEV_ID_S)
  3096. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3099. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3100. } while (0)
  3101. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3102. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3103. HTT_WDS_ENTRY_PDEV_ID_S)
  3104. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3105. do { \
  3106. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3107. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3108. } while (0)
  3109. /* DWORD 2 */
  3110. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3111. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3112. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3113. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3114. do { \
  3115. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3116. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3117. } while (0)
  3118. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3119. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3120. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3121. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3122. do { \
  3123. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3124. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3125. } while (0)
  3126. /**
  3127. * @brief MAC DMA rx ring setup specification
  3128. *
  3129. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3130. *
  3131. * @details
  3132. * To allow for dynamic rx ring reconfiguration and to avoid race
  3133. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3134. * it uses. Instead, it sends this message to the target, indicating how
  3135. * the rx ring used by the host should be set up and maintained.
  3136. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3137. * specifications.
  3138. *
  3139. * |31 16|15 8|7 0|
  3140. * |---------------------------------------------------------------|
  3141. * header: | reserved | num rings | msg type |
  3142. * |---------------------------------------------------------------|
  3143. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3144. #if HTT_PADDR64
  3145. * | FW_IDX shadow register physical address (bits 63:32) |
  3146. #endif
  3147. * |---------------------------------------------------------------|
  3148. * | rx ring base physical address (bits 31:0) |
  3149. #if HTT_PADDR64
  3150. * | rx ring base physical address (bits 63:32) |
  3151. #endif
  3152. * |---------------------------------------------------------------|
  3153. * | rx ring buffer size | rx ring length |
  3154. * |---------------------------------------------------------------|
  3155. * | FW_IDX initial value | enabled flags |
  3156. * |---------------------------------------------------------------|
  3157. * | MSDU payload offset | 802.11 header offset |
  3158. * |---------------------------------------------------------------|
  3159. * | PPDU end offset | PPDU start offset |
  3160. * |---------------------------------------------------------------|
  3161. * | MPDU end offset | MPDU start offset |
  3162. * |---------------------------------------------------------------|
  3163. * | MSDU end offset | MSDU start offset |
  3164. * |---------------------------------------------------------------|
  3165. * | frag info offset | rx attention offset |
  3166. * |---------------------------------------------------------------|
  3167. * payload 2, if present, has the same format as payload 1
  3168. * Header fields:
  3169. * - MSG_TYPE
  3170. * Bits 7:0
  3171. * Purpose: identifies this as an rx ring configuration message
  3172. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3173. * - NUM_RINGS
  3174. * Bits 15:8
  3175. * Purpose: indicates whether the host is setting up one rx ring or two
  3176. * Value: 1 or 2
  3177. * Payload:
  3178. * for systems using 64-bit format for bus addresses:
  3179. * - IDX_SHADOW_REG_PADDR_LO
  3180. * Bits 31:0
  3181. * Value: lower 4 bytes of physical address of the host's
  3182. * FW_IDX shadow register
  3183. * - IDX_SHADOW_REG_PADDR_HI
  3184. * Bits 31:0
  3185. * Value: upper 4 bytes of physical address of the host's
  3186. * FW_IDX shadow register
  3187. * - RING_BASE_PADDR_LO
  3188. * Bits 31:0
  3189. * Value: lower 4 bytes of physical address of the host's rx ring
  3190. * - RING_BASE_PADDR_HI
  3191. * Bits 31:0
  3192. * Value: uppper 4 bytes of physical address of the host's rx ring
  3193. * for systems using 32-bit format for bus addresses:
  3194. * - IDX_SHADOW_REG_PADDR
  3195. * Bits 31:0
  3196. * Value: physical address of the host's FW_IDX shadow register
  3197. * - RING_BASE_PADDR
  3198. * Bits 31:0
  3199. * Value: physical address of the host's rx ring
  3200. * - RING_LEN
  3201. * Bits 15:0
  3202. * Value: number of elements in the rx ring
  3203. * - RING_BUF_SZ
  3204. * Bits 31:16
  3205. * Value: size of the buffers referenced by the rx ring, in byte units
  3206. * - ENABLED_FLAGS
  3207. * Bits 15:0
  3208. * Value: 1-bit flags to show whether different rx fields are enabled
  3209. * bit 0: 802.11 header enabled (1) or disabled (0)
  3210. * bit 1: MSDU payload enabled (1) or disabled (0)
  3211. * bit 2: PPDU start enabled (1) or disabled (0)
  3212. * bit 3: PPDU end enabled (1) or disabled (0)
  3213. * bit 4: MPDU start enabled (1) or disabled (0)
  3214. * bit 5: MPDU end enabled (1) or disabled (0)
  3215. * bit 6: MSDU start enabled (1) or disabled (0)
  3216. * bit 7: MSDU end enabled (1) or disabled (0)
  3217. * bit 8: rx attention enabled (1) or disabled (0)
  3218. * bit 9: frag info enabled (1) or disabled (0)
  3219. * bit 10: unicast rx enabled (1) or disabled (0)
  3220. * bit 11: multicast rx enabled (1) or disabled (0)
  3221. * bit 12: ctrl rx enabled (1) or disabled (0)
  3222. * bit 13: mgmt rx enabled (1) or disabled (0)
  3223. * bit 14: null rx enabled (1) or disabled (0)
  3224. * bit 15: phy data rx enabled (1) or disabled (0)
  3225. * - IDX_INIT_VAL
  3226. * Bits 31:16
  3227. * Purpose: Specify the initial value for the FW_IDX.
  3228. * Value: the number of buffers initially present in the host's rx ring
  3229. * - OFFSET_802_11_HDR
  3230. * Bits 15:0
  3231. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3232. * - OFFSET_MSDU_PAYLOAD
  3233. * Bits 31:16
  3234. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3235. * - OFFSET_PPDU_START
  3236. * Bits 15:0
  3237. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3238. * - OFFSET_PPDU_END
  3239. * Bits 31:16
  3240. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3241. * - OFFSET_MPDU_START
  3242. * Bits 15:0
  3243. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3244. * - OFFSET_MPDU_END
  3245. * Bits 31:16
  3246. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3247. * - OFFSET_MSDU_START
  3248. * Bits 15:0
  3249. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3250. * - OFFSET_MSDU_END
  3251. * Bits 31:16
  3252. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3253. * - OFFSET_RX_ATTN
  3254. * Bits 15:0
  3255. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3256. * - OFFSET_FRAG_INFO
  3257. * Bits 31:16
  3258. * Value: offset in QUAD-bytes of frag info table
  3259. */
  3260. /* header fields */
  3261. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3262. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3263. /* payload fields */
  3264. /* for systems using a 64-bit format for bus addresses */
  3265. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3266. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3267. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3268. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3269. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3270. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3271. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3272. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3273. /* for systems using a 32-bit format for bus addresses */
  3274. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3275. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3276. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3277. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3278. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3279. #define HTT_RX_RING_CFG_LEN_S 0
  3280. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3281. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3282. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3283. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3284. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3285. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3286. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3287. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3288. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3289. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3290. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3291. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3292. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3293. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3294. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3295. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3296. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3297. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3298. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3299. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3300. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3301. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3302. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3303. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3304. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3305. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3306. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3307. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3308. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3309. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3310. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3311. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3312. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3313. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3314. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3315. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3316. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3317. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3318. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3319. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3320. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3321. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3322. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3323. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3324. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3325. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3326. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3327. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3328. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3329. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3330. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3331. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3332. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3333. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3334. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3335. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3336. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3337. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3338. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3339. #if HTT_PADDR64
  3340. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3341. #else
  3342. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3343. #endif
  3344. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3345. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3346. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3347. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3348. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3349. do { \
  3350. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3351. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3352. } while (0)
  3353. /* degenerate case for 32-bit fields */
  3354. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3355. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3356. ((_var) = (_val))
  3357. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3358. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3359. ((_var) = (_val))
  3360. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3361. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3362. ((_var) = (_val))
  3363. /* degenerate case for 32-bit fields */
  3364. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3365. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3366. ((_var) = (_val))
  3367. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3368. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3369. ((_var) = (_val))
  3370. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3371. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3372. ((_var) = (_val))
  3373. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3375. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3376. do { \
  3377. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3378. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3379. } while (0)
  3380. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3381. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3382. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3389. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3390. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3461. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3462. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3469. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3470. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3477. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3478. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3485. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3486. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3493. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3494. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3501. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3502. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3509. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3510. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3517. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3518. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3538. } while (0)
  3539. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3540. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3541. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3542. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3545. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3546. } while (0)
  3547. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3548. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3549. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3550. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3553. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3554. } while (0)
  3555. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3556. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3557. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3558. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3559. do { \
  3560. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3561. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3562. } while (0)
  3563. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3564. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3565. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3566. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3567. do { \
  3568. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3569. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3570. } while (0)
  3571. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3572. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3573. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3574. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3577. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3578. } while (0)
  3579. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3580. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3581. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3582. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3585. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3586. } while (0)
  3587. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3588. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3589. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3590. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3593. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3594. } while (0)
  3595. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3596. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3597. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3598. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3601. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3602. } while (0)
  3603. /**
  3604. * @brief host -> target FW statistics retrieve
  3605. *
  3606. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3607. *
  3608. * @details
  3609. * The following field definitions describe the format of the HTT host
  3610. * to target FW stats retrieve message. The message specifies the type of
  3611. * stats host wants to retrieve.
  3612. *
  3613. * |31 24|23 16|15 8|7 0|
  3614. * |-----------------------------------------------------------|
  3615. * | stats types request bitmask | msg type |
  3616. * |-----------------------------------------------------------|
  3617. * | stats types reset bitmask | reserved |
  3618. * |-----------------------------------------------------------|
  3619. * | stats type | config value |
  3620. * |-----------------------------------------------------------|
  3621. * | cookie LSBs |
  3622. * |-----------------------------------------------------------|
  3623. * | cookie MSBs |
  3624. * |-----------------------------------------------------------|
  3625. * Header fields:
  3626. * - MSG_TYPE
  3627. * Bits 7:0
  3628. * Purpose: identifies this is a stats upload request message
  3629. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3630. * - UPLOAD_TYPES
  3631. * Bits 31:8
  3632. * Purpose: identifies which types of FW statistics to upload
  3633. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3634. * - RESET_TYPES
  3635. * Bits 31:8
  3636. * Purpose: identifies which types of FW statistics to reset
  3637. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3638. * - CFG_VAL
  3639. * Bits 23:0
  3640. * Purpose: give an opaque configuration value to the specified stats type
  3641. * Value: stats-type specific configuration value
  3642. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3643. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3644. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3645. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3646. * - CFG_STAT_TYPE
  3647. * Bits 31:24
  3648. * Purpose: specify which stats type (if any) the config value applies to
  3649. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3650. * a valid configuration specification
  3651. * - COOKIE_LSBS
  3652. * Bits 31:0
  3653. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3654. * message with its preceding host->target stats request message.
  3655. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3656. * - COOKIE_MSBS
  3657. * Bits 31:0
  3658. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3659. * message with its preceding host->target stats request message.
  3660. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3661. */
  3662. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3663. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3664. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3665. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3666. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3667. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3668. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3669. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3670. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3671. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3672. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3673. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3674. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3675. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3678. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3679. } while (0)
  3680. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3681. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3682. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3683. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3686. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3687. } while (0)
  3688. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3689. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3690. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3691. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3694. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3695. } while (0)
  3696. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3697. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3698. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3699. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3700. do { \
  3701. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3702. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3703. } while (0)
  3704. /**
  3705. * @brief host -> target HTT out-of-band sync request
  3706. *
  3707. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3708. *
  3709. * @details
  3710. * The HTT SYNC tells the target to suspend processing of subsequent
  3711. * HTT host-to-target messages until some other target agent locally
  3712. * informs the target HTT FW that the current sync counter is equal to
  3713. * or greater than (in a modulo sense) the sync counter specified in
  3714. * the SYNC message.
  3715. * This allows other host-target components to synchronize their operation
  3716. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3717. * security key has been downloaded to and activated by the target.
  3718. * In the absence of any explicit synchronization counter value
  3719. * specification, the target HTT FW will use zero as the default current
  3720. * sync value.
  3721. *
  3722. * |31 24|23 16|15 8|7 0|
  3723. * |-----------------------------------------------------------|
  3724. * | reserved | sync count | msg type |
  3725. * |-----------------------------------------------------------|
  3726. * Header fields:
  3727. * - MSG_TYPE
  3728. * Bits 7:0
  3729. * Purpose: identifies this as a sync message
  3730. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3731. * - SYNC_COUNT
  3732. * Bits 15:8
  3733. * Purpose: specifies what sync value the HTT FW will wait for from
  3734. * an out-of-band specification to resume its operation
  3735. * Value: in-band sync counter value to compare against the out-of-band
  3736. * counter spec.
  3737. * The HTT target FW will suspend its host->target message processing
  3738. * as long as
  3739. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3740. */
  3741. #define HTT_H2T_SYNC_MSG_SZ 4
  3742. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3743. #define HTT_H2T_SYNC_COUNT_S 8
  3744. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3745. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3746. HTT_H2T_SYNC_COUNT_S)
  3747. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3748. do { \
  3749. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3750. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3751. } while (0)
  3752. /**
  3753. * @brief host -> target HTT aggregation configuration
  3754. *
  3755. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3756. */
  3757. #define HTT_AGGR_CFG_MSG_SZ 4
  3758. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3760. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3761. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3762. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3763. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3764. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3765. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3768. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3769. } while (0)
  3770. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3771. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3772. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3773. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3776. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3777. } while (0)
  3778. /**
  3779. * @brief host -> target HTT configure max amsdu info per vdev
  3780. *
  3781. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3782. *
  3783. * @details
  3784. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3785. *
  3786. * |31 21|20 16|15 8|7 0|
  3787. * |-----------------------------------------------------------|
  3788. * | reserved | vdev id | max amsdu | msg type |
  3789. * |-----------------------------------------------------------|
  3790. * Header fields:
  3791. * - MSG_TYPE
  3792. * Bits 7:0
  3793. * Purpose: identifies this as a aggr cfg ex message
  3794. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3795. * - MAX_NUM_AMSDU_SUBFRM
  3796. * Bits 15:8
  3797. * Purpose: max MSDUs per A-MSDU
  3798. * - VDEV_ID
  3799. * Bits 20:16
  3800. * Purpose: ID of the vdev to which this limit is applied
  3801. */
  3802. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3803. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3804. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3805. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3806. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3807. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3808. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3809. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3810. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3811. do { \
  3812. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3813. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3814. } while (0)
  3815. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3816. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3817. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3818. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3819. do { \
  3820. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3821. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3822. } while (0)
  3823. /**
  3824. * @brief HTT WDI_IPA Config Message
  3825. *
  3826. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3827. *
  3828. * @details
  3829. * The HTT WDI_IPA config message is created/sent by host at driver
  3830. * init time. It contains information about data structures used on
  3831. * WDI_IPA TX and RX path.
  3832. * TX CE ring is used for pushing packet metadata from IPA uC
  3833. * to WLAN FW
  3834. * TX Completion ring is used for generating TX completions from
  3835. * WLAN FW to IPA uC
  3836. * RX Indication ring is used for indicating RX packets from FW
  3837. * to IPA uC
  3838. * RX Ring2 is used as either completion ring or as second
  3839. * indication ring. when Ring2 is used as completion ring, IPA uC
  3840. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3841. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3842. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3843. * indicated in RX Indication ring. Please see WDI_IPA specification
  3844. * for more details.
  3845. * |31 24|23 16|15 8|7 0|
  3846. * |----------------+----------------+----------------+----------------|
  3847. * | tx pkt pool size | Rsvd | msg_type |
  3848. * |-------------------------------------------------------------------|
  3849. * | tx comp ring base (bits 31:0) |
  3850. #if HTT_PADDR64
  3851. * | tx comp ring base (bits 63:32) |
  3852. #endif
  3853. * |-------------------------------------------------------------------|
  3854. * | tx comp ring size |
  3855. * |-------------------------------------------------------------------|
  3856. * | tx comp WR_IDX physical address (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | tx comp WR_IDX physical address (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. * | tx CE WR_IDX physical address (bits 31:0) |
  3862. #if HTT_PADDR64
  3863. * | tx CE WR_IDX physical address (bits 63:32) |
  3864. #endif
  3865. * |-------------------------------------------------------------------|
  3866. * | rx indication ring base (bits 31:0) |
  3867. #if HTT_PADDR64
  3868. * | rx indication ring base (bits 63:32) |
  3869. #endif
  3870. * |-------------------------------------------------------------------|
  3871. * | rx indication ring size |
  3872. * |-------------------------------------------------------------------|
  3873. * | rx ind RD_IDX physical address (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | rx ind RD_IDX physical address (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. * | rx ind WR_IDX physical address (bits 31:0) |
  3879. #if HTT_PADDR64
  3880. * | rx ind WR_IDX physical address (bits 63:32) |
  3881. #endif
  3882. * |-------------------------------------------------------------------|
  3883. * |-------------------------------------------------------------------|
  3884. * | rx ring2 base (bits 31:0) |
  3885. #if HTT_PADDR64
  3886. * | rx ring2 base (bits 63:32) |
  3887. #endif
  3888. * |-------------------------------------------------------------------|
  3889. * | rx ring2 size |
  3890. * |-------------------------------------------------------------------|
  3891. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3892. #if HTT_PADDR64
  3893. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3894. #endif
  3895. * |-------------------------------------------------------------------|
  3896. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3897. #if HTT_PADDR64
  3898. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3899. #endif
  3900. * |-------------------------------------------------------------------|
  3901. *
  3902. * Header fields:
  3903. * Header fields:
  3904. * - MSG_TYPE
  3905. * Bits 7:0
  3906. * Purpose: Identifies this as WDI_IPA config message
  3907. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3908. * - TX_PKT_POOL_SIZE
  3909. * Bits 15:0
  3910. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3911. * WDI_IPA TX path
  3912. * For systems using 32-bit format for bus addresses:
  3913. * - TX_COMP_RING_BASE_ADDR
  3914. * Bits 31:0
  3915. * Purpose: TX Completion Ring base address in DDR
  3916. * - TX_COMP_RING_SIZE
  3917. * Bits 31:0
  3918. * Purpose: TX Completion Ring size (must be power of 2)
  3919. * - TX_COMP_WR_IDX_ADDR
  3920. * Bits 31:0
  3921. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3922. * updates the Write Index for WDI_IPA TX completion ring
  3923. * - TX_CE_WR_IDX_ADDR
  3924. * Bits 31:0
  3925. * Purpose: DDR address where IPA uC
  3926. * updates the WR Index for TX CE ring
  3927. * (needed for fusion platforms)
  3928. * - RX_IND_RING_BASE_ADDR
  3929. * Bits 31:0
  3930. * Purpose: RX Indication Ring base address in DDR
  3931. * - RX_IND_RING_SIZE
  3932. * Bits 31:0
  3933. * Purpose: RX Indication Ring size
  3934. * - RX_IND_RD_IDX_ADDR
  3935. * Bits 31:0
  3936. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3937. * RX indication ring
  3938. * - RX_IND_WR_IDX_ADDR
  3939. * Bits 31:0
  3940. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3941. * updates the Write Index for WDI_IPA RX indication ring
  3942. * - RX_RING2_BASE_ADDR
  3943. * Bits 31:0
  3944. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3945. * - RX_RING2_SIZE
  3946. * Bits 31:0
  3947. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3948. * - RX_RING2_RD_IDX_ADDR
  3949. * Bits 31:0
  3950. * Purpose: If Second RX ring is Indication ring, DDR address where
  3951. * IPA uC updates the Read Index for Ring2.
  3952. * If Second RX ring is completion ring, this is NOT used
  3953. * - RX_RING2_WR_IDX_ADDR
  3954. * Bits 31:0
  3955. * Purpose: If Second RX ring is Indication ring, DDR address where
  3956. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3957. * If second RX ring is completion ring, DDR address where
  3958. * IPA uC updates the Write Index for Ring 2.
  3959. * For systems using 64-bit format for bus addresses:
  3960. * - TX_COMP_RING_BASE_ADDR_LO
  3961. * Bits 31:0
  3962. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3963. * - TX_COMP_RING_BASE_ADDR_HI
  3964. * Bits 31:0
  3965. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3966. * - TX_COMP_RING_SIZE
  3967. * Bits 31:0
  3968. * Purpose: TX Completion Ring size (must be power of 2)
  3969. * - TX_COMP_WR_IDX_ADDR_LO
  3970. * Bits 31:0
  3971. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3972. * Lower 4 bytes of DDR address where WIFI FW
  3973. * updates the Write Index for WDI_IPA TX completion ring
  3974. * - TX_COMP_WR_IDX_ADDR_HI
  3975. * Bits 31:0
  3976. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3977. * Higher 4 bytes of DDR address where WIFI FW
  3978. * updates the Write Index for WDI_IPA TX completion ring
  3979. * - TX_CE_WR_IDX_ADDR_LO
  3980. * Bits 31:0
  3981. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3982. * updates the WR Index for TX CE ring
  3983. * (needed for fusion platforms)
  3984. * - TX_CE_WR_IDX_ADDR_HI
  3985. * Bits 31:0
  3986. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3987. * updates the WR Index for TX CE ring
  3988. * (needed for fusion platforms)
  3989. * - RX_IND_RING_BASE_ADDR_LO
  3990. * Bits 31:0
  3991. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3992. * - RX_IND_RING_BASE_ADDR_HI
  3993. * Bits 31:0
  3994. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3995. * - RX_IND_RING_SIZE
  3996. * Bits 31:0
  3997. * Purpose: RX Indication Ring size
  3998. * - RX_IND_RD_IDX_ADDR_LO
  3999. * Bits 31:0
  4000. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  4001. * for WDI_IPA RX indication ring
  4002. * - RX_IND_RD_IDX_ADDR_HI
  4003. * Bits 31:0
  4004. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4005. * for WDI_IPA RX indication ring
  4006. * - RX_IND_WR_IDX_ADDR_LO
  4007. * Bits 31:0
  4008. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4009. * Lower 4 bytes of DDR address where WIFI FW
  4010. * updates the Write Index for WDI_IPA RX indication ring
  4011. * - RX_IND_WR_IDX_ADDR_HI
  4012. * Bits 31:0
  4013. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4014. * Higher 4 bytes of DDR address where WIFI FW
  4015. * updates the Write Index for WDI_IPA RX indication ring
  4016. * - RX_RING2_BASE_ADDR_LO
  4017. * Bits 31:0
  4018. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4019. * - RX_RING2_BASE_ADDR_HI
  4020. * Bits 31:0
  4021. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4022. * - RX_RING2_SIZE
  4023. * Bits 31:0
  4024. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4025. * - RX_RING2_RD_IDX_ADDR_LO
  4026. * Bits 31:0
  4027. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4028. * DDR address where IPA uC updates the Read Index for Ring2.
  4029. * If Second RX ring is completion ring, this is NOT used
  4030. * - RX_RING2_RD_IDX_ADDR_HI
  4031. * Bits 31:0
  4032. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4033. * DDR address where IPA uC updates the Read Index for Ring2.
  4034. * If Second RX ring is completion ring, this is NOT used
  4035. * - RX_RING2_WR_IDX_ADDR_LO
  4036. * Bits 31:0
  4037. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4038. * DDR address where WIFI FW updates the Write Index
  4039. * for WDI_IPA RX ring2
  4040. * If second RX ring is completion ring, lower 4 bytes of
  4041. * DDR address where IPA uC updates the Write Index for Ring 2.
  4042. * - RX_RING2_WR_IDX_ADDR_HI
  4043. * Bits 31:0
  4044. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4045. * DDR address where WIFI FW updates the Write Index
  4046. * for WDI_IPA RX ring2
  4047. * If second RX ring is completion ring, higher 4 bytes of
  4048. * DDR address where IPA uC updates the Write Index for Ring 2.
  4049. */
  4050. #if HTT_PADDR64
  4051. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4052. #else
  4053. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4054. #endif
  4055. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4056. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4067. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4069. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4073. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4075. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4112. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4113. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4114. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4115. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4116. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4117. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4118. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4119. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4122. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4123. } while (0)
  4124. /* for systems using 32-bit format for bus addr */
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4126. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4130. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4131. } while (0)
  4132. /* for systems using 64-bit format for bus addr */
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4134. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4135. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4138. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4139. } while (0)
  4140. /* for systems using 64-bit format for bus addr */
  4141. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4142. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4146. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4147. } while (0)
  4148. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4150. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4154. } while (0)
  4155. /* for systems using 32-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4158. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4162. } while (0)
  4163. /* for systems using 64-bit format for bus addr */
  4164. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4166. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4170. } while (0)
  4171. /* for systems using 64-bit format for bus addr */
  4172. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4174. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4178. } while (0)
  4179. /* for systems using 32-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4182. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4186. } while (0)
  4187. /* for systems using 64-bit format for bus addr */
  4188. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4189. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4190. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4193. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4194. } while (0)
  4195. /* for systems using 64-bit format for bus addr */
  4196. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4197. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4198. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4201. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4202. } while (0)
  4203. /* for systems using 32-bit format for bus addr */
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4210. } while (0)
  4211. /* for systems using 64-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4218. } while (0)
  4219. /* for systems using 64-bit format for bus addr */
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4221. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4225. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4226. } while (0)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4229. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4233. } while (0)
  4234. /* for systems using 32-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4237. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4241. } while (0)
  4242. /* for systems using 64-bit format for bus addr */
  4243. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4244. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4245. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4249. } while (0)
  4250. /* for systems using 64-bit format for bus addr */
  4251. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4252. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4253. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4256. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4257. } while (0)
  4258. /* for systems using 32-bit format for bus addr */
  4259. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4260. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4261. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4264. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4265. } while (0)
  4266. /* for systems using 64-bit format for bus addr */
  4267. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4268. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4269. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4272. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4273. } while (0)
  4274. /* for systems using 64-bit format for bus addr */
  4275. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4276. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4277. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4278. do { \
  4279. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4280. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4281. } while (0)
  4282. /* for systems using 32-bit format for bus addr */
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4289. } while (0)
  4290. /* for systems using 64-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4297. } while (0)
  4298. /* for systems using 64-bit format for bus addr */
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4300. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4304. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4305. } while (0)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4307. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4311. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4312. } while (0)
  4313. /* for systems using 32-bit format for bus addr */
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4315. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4319. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4320. } while (0)
  4321. /* for systems using 64-bit format for bus addr */
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4323. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4324. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4325. do { \
  4326. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4327. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4328. } while (0)
  4329. /* for systems using 64-bit format for bus addr */
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4331. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4335. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4336. } while (0)
  4337. /* for systems using 32-bit format for bus addr */
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4339. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4340. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4343. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4344. } while (0)
  4345. /* for systems using 64-bit format for bus addr */
  4346. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4347. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4348. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4351. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4352. } while (0)
  4353. /* for systems using 64-bit format for bus addr */
  4354. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4355. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4356. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4359. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4360. } while (0)
  4361. /*
  4362. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4363. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4364. * addresses are stored in a XXX-bit field.
  4365. * This macro is used to define both htt_wdi_ipa_config32_t and
  4366. * htt_wdi_ipa_config64_t structs.
  4367. */
  4368. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4369. _paddr__tx_comp_ring_base_addr_, \
  4370. _paddr__tx_comp_wr_idx_addr_, \
  4371. _paddr__tx_ce_wr_idx_addr_, \
  4372. _paddr__rx_ind_ring_base_addr_, \
  4373. _paddr__rx_ind_rd_idx_addr_, \
  4374. _paddr__rx_ind_wr_idx_addr_, \
  4375. _paddr__rx_ring2_base_addr_,\
  4376. _paddr__rx_ring2_rd_idx_addr_,\
  4377. _paddr__rx_ring2_wr_idx_addr_) \
  4378. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4379. { \
  4380. /* DWORD 0: flags and meta-data */ \
  4381. A_UINT32 \
  4382. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4383. reserved: 8, \
  4384. tx_pkt_pool_size: 16;\
  4385. /* DWORD 1 */\
  4386. _paddr__tx_comp_ring_base_addr_;\
  4387. /* DWORD 2 (or 3)*/\
  4388. A_UINT32 tx_comp_ring_size;\
  4389. /* DWORD 3 (or 4)*/\
  4390. _paddr__tx_comp_wr_idx_addr_;\
  4391. /* DWORD 4 (or 6)*/\
  4392. _paddr__tx_ce_wr_idx_addr_;\
  4393. /* DWORD 5 (or 8)*/\
  4394. _paddr__rx_ind_ring_base_addr_;\
  4395. /* DWORD 6 (or 10)*/\
  4396. A_UINT32 rx_ind_ring_size;\
  4397. /* DWORD 7 (or 11)*/\
  4398. _paddr__rx_ind_rd_idx_addr_;\
  4399. /* DWORD 8 (or 13)*/\
  4400. _paddr__rx_ind_wr_idx_addr_;\
  4401. /* DWORD 9 (or 15)*/\
  4402. _paddr__rx_ring2_base_addr_;\
  4403. /* DWORD 10 (or 17) */\
  4404. A_UINT32 rx_ring2_size;\
  4405. /* DWORD 11 (or 18) */\
  4406. _paddr__rx_ring2_rd_idx_addr_;\
  4407. /* DWORD 12 (or 20) */\
  4408. _paddr__rx_ring2_wr_idx_addr_;\
  4409. } POSTPACK
  4410. /* define a htt_wdi_ipa_config32_t type */
  4411. 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));
  4412. /* define a htt_wdi_ipa_config64_t type */
  4413. 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));
  4414. #if HTT_PADDR64
  4415. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4416. #else
  4417. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4418. #endif
  4419. enum htt_wdi_ipa_op_code {
  4420. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4421. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4422. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4423. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4424. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4425. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4426. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4427. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4428. /* keep this last */
  4429. HTT_WDI_IPA_OPCODE_MAX
  4430. };
  4431. /**
  4432. * @brief HTT WDI_IPA Operation Request Message
  4433. *
  4434. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4435. *
  4436. * @details
  4437. * HTT WDI_IPA Operation Request message is sent by host
  4438. * to either suspend or resume WDI_IPA TX or RX path.
  4439. * |31 24|23 16|15 8|7 0|
  4440. * |----------------+----------------+----------------+----------------|
  4441. * | op_code | Rsvd | msg_type |
  4442. * |-------------------------------------------------------------------|
  4443. *
  4444. * Header fields:
  4445. * - MSG_TYPE
  4446. * Bits 7:0
  4447. * Purpose: Identifies this as WDI_IPA Operation Request message
  4448. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4449. * - OP_CODE
  4450. * Bits 31:16
  4451. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4452. * value: = enum htt_wdi_ipa_op_code
  4453. */
  4454. PREPACK struct htt_wdi_ipa_op_request_t
  4455. {
  4456. /* DWORD 0: flags and meta-data */
  4457. A_UINT32
  4458. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4459. reserved: 8,
  4460. op_code: 16;
  4461. } POSTPACK;
  4462. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4463. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4464. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4465. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4466. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4467. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4468. do { \
  4469. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4470. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4471. } while (0)
  4472. /*
  4473. * @brief host -> target HTT_MSI_SETUP message
  4474. *
  4475. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4476. *
  4477. * @details
  4478. * After target is booted up, host can send MSI setup message so that
  4479. * target sets up HW registers based on setup message.
  4480. *
  4481. * The message would appear as follows:
  4482. * |31 24|23 16|15|14 8|7 0|
  4483. * |---------------+-----------------+-----------------+-----------------|
  4484. * | reserved | msi_type | pdev_id | msg_type |
  4485. * |---------------------------------------------------------------------|
  4486. * | msi_addr_lo |
  4487. * |---------------------------------------------------------------------|
  4488. * | msi_addr_hi |
  4489. * |---------------------------------------------------------------------|
  4490. * | msi_data |
  4491. * |---------------------------------------------------------------------|
  4492. *
  4493. * The message is interpreted as follows:
  4494. * dword0 - b'0:7 - msg_type: This will be set to
  4495. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4496. * b'8:15 - pdev_id:
  4497. * 0 (for rings at SOC/UMAC level),
  4498. * 1/2/3 mac id (for rings at LMAC level)
  4499. * b'16:23 - msi_type: identify which msi registers need to be setup
  4500. * more details can be got from enum htt_msi_setup_type
  4501. * b'24:31 - reserved
  4502. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4503. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4504. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4505. */
  4506. PREPACK struct htt_msi_setup_t {
  4507. A_UINT32 msg_type: 8,
  4508. pdev_id: 8,
  4509. msi_type: 8,
  4510. reserved: 8;
  4511. A_UINT32 msi_addr_lo;
  4512. A_UINT32 msi_addr_hi;
  4513. A_UINT32 msi_data;
  4514. } POSTPACK;
  4515. enum htt_msi_setup_type {
  4516. HTT_PPDU_END_MSI_SETUP_TYPE,
  4517. /* Insert new types here*/
  4518. };
  4519. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4520. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4521. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4522. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4523. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4524. HTT_MSI_SETUP_PDEV_ID_S)
  4525. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4528. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4529. } while (0)
  4530. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4531. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4532. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4533. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4534. HTT_MSI_SETUP_MSI_TYPE_S)
  4535. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4538. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4539. } while (0)
  4540. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4541. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4542. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4543. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4544. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4545. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4548. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4549. } while (0)
  4550. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4551. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4552. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4553. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4554. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4555. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4556. do { \
  4557. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4558. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4559. } while (0)
  4560. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4561. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4562. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4563. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4564. HTT_MSI_SETUP_MSI_DATA_S)
  4565. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4566. do { \
  4567. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4568. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4569. } while (0)
  4570. /*
  4571. * @brief host -> target HTT_SRING_SETUP message
  4572. *
  4573. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4574. *
  4575. * @details
  4576. * After target is booted up, Host can send SRING setup message for
  4577. * each host facing LMAC SRING. Target setups up HW registers based
  4578. * on setup message and confirms back to Host if response_required is set.
  4579. * Host should wait for confirmation message before sending new SRING
  4580. * setup message
  4581. *
  4582. * The message would appear as follows:
  4583. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4584. * |--------------- +-----------------+-----------------+-----------------|
  4585. * | ring_type | ring_id | pdev_id | msg_type |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_base_addr_lo |
  4588. * |----------------------------------------------------------------------|
  4589. * | ring_base_addr_hi |
  4590. * |----------------------------------------------------------------------|
  4591. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4592. * |----------------------------------------------------------------------|
  4593. * | ring_head_offset32_remote_addr_lo |
  4594. * |----------------------------------------------------------------------|
  4595. * | ring_head_offset32_remote_addr_hi |
  4596. * |----------------------------------------------------------------------|
  4597. * | ring_tail_offset32_remote_addr_lo |
  4598. * |----------------------------------------------------------------------|
  4599. * | ring_tail_offset32_remote_addr_hi |
  4600. * |----------------------------------------------------------------------|
  4601. * | ring_msi_addr_lo |
  4602. * |----------------------------------------------------------------------|
  4603. * | ring_msi_addr_hi |
  4604. * |----------------------------------------------------------------------|
  4605. * | ring_msi_data |
  4606. * |----------------------------------------------------------------------|
  4607. * | intr_timer_th |IM| intr_batch_counter_th |
  4608. * |----------------------------------------------------------------------|
  4609. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4610. * |----------------------------------------------------------------------|
  4611. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4612. * |----------------------------------------------------------------------|
  4613. * Where
  4614. * IM = sw_intr_mode
  4615. * RR = response_required
  4616. * PTCF = prefetch_timer_cfg
  4617. * IP = IPA drop flag
  4618. *
  4619. * The message is interpreted as follows:
  4620. * dword0 - b'0:7 - msg_type: This will be set to
  4621. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4622. * b'8:15 - pdev_id:
  4623. * 0 (for rings at SOC/UMAC level),
  4624. * 1/2/3 mac id (for rings at LMAC level)
  4625. * b'16:23 - ring_id: identify which ring is to setup,
  4626. * more details can be got from enum htt_srng_ring_id
  4627. * b'24:31 - ring_type: identify type of host rings,
  4628. * more details can be got from enum htt_srng_ring_type
  4629. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4630. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4631. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4632. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4633. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4634. * SW_TO_HW_RING.
  4635. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4636. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4637. * Lower 32 bits of memory address of the remote variable
  4638. * storing the 4-byte word offset that identifies the head
  4639. * element within the ring.
  4640. * (The head offset variable has type A_UINT32.)
  4641. * Valid for HW_TO_SW and SW_TO_SW rings.
  4642. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4643. * Upper 32 bits of memory address of the remote variable
  4644. * storing the 4-byte word offset that identifies the head
  4645. * element within the ring.
  4646. * (The head offset variable has type A_UINT32.)
  4647. * Valid for HW_TO_SW and SW_TO_SW rings.
  4648. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4649. * Lower 32 bits of memory address of the remote variable
  4650. * storing the 4-byte word offset that identifies the tail
  4651. * element within the ring.
  4652. * (The tail offset variable has type A_UINT32.)
  4653. * Valid for HW_TO_SW and SW_TO_SW rings.
  4654. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4655. * Upper 32 bits of memory address of the remote variable
  4656. * storing the 4-byte word offset that identifies the tail
  4657. * element within the ring.
  4658. * (The tail offset variable has type A_UINT32.)
  4659. * Valid for HW_TO_SW and SW_TO_SW rings.
  4660. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4661. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4662. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4663. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4664. * dword10 - b'0:31 - ring_msi_data: MSI data
  4665. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4666. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4667. * dword11 - b'0:14 - intr_batch_counter_th:
  4668. * batch counter threshold is in units of 4-byte words.
  4669. * HW internally maintains and increments batch count.
  4670. * (see SRING spec for detail description).
  4671. * When batch count reaches threshold value, an interrupt
  4672. * is generated by HW.
  4673. * b'15 - sw_intr_mode:
  4674. * This configuration shall be static.
  4675. * Only programmed at power up.
  4676. * 0: generate pulse style sw interrupts
  4677. * 1: generate level style sw interrupts
  4678. * b'16:31 - intr_timer_th:
  4679. * The timer init value when timer is idle or is
  4680. * initialized to start downcounting.
  4681. * In 8us units (to cover a range of 0 to 524 ms)
  4682. * dword12 - b'0:15 - intr_low_threshold:
  4683. * Used only by Consumer ring to generate ring_sw_int_p.
  4684. * Ring entries low threshold water mark, that is used
  4685. * in combination with the interrupt timer as well as
  4686. * the the clearing of the level interrupt.
  4687. * b'16:18 - prefetch_timer_cfg:
  4688. * Used only by Consumer ring to set timer mode to
  4689. * support Application prefetch handling.
  4690. * The external tail offset/pointer will be updated
  4691. * at following intervals:
  4692. * 3'b000: (Prefetch feature disabled; used only for debug)
  4693. * 3'b001: 1 usec
  4694. * 3'b010: 4 usec
  4695. * 3'b011: 8 usec (default)
  4696. * 3'b100: 16 usec
  4697. * Others: Reserved
  4698. * b'19 - response_required:
  4699. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4700. * b'20 - ipa_drop_flag:
  4701. Indicates that host will config ipa drop threshold percentage
  4702. * b'21:31 - reserved: reserved for future use
  4703. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4704. * b'8:15 - ipa drop high threshold percentage:
  4705. * b'16:31 - Reserved
  4706. */
  4707. PREPACK struct htt_sring_setup_t {
  4708. A_UINT32 msg_type: 8,
  4709. pdev_id: 8,
  4710. ring_id: 8,
  4711. ring_type: 8;
  4712. A_UINT32 ring_base_addr_lo;
  4713. A_UINT32 ring_base_addr_hi;
  4714. A_UINT32 ring_size: 16,
  4715. ring_entry_size: 8,
  4716. ring_misc_cfg_flag: 8;
  4717. A_UINT32 ring_head_offset32_remote_addr_lo;
  4718. A_UINT32 ring_head_offset32_remote_addr_hi;
  4719. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4720. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4721. A_UINT32 ring_msi_addr_lo;
  4722. A_UINT32 ring_msi_addr_hi;
  4723. A_UINT32 ring_msi_data;
  4724. A_UINT32 intr_batch_counter_th: 15,
  4725. sw_intr_mode: 1,
  4726. intr_timer_th: 16;
  4727. A_UINT32 intr_low_threshold: 16,
  4728. prefetch_timer_cfg: 3,
  4729. response_required: 1,
  4730. ipa_drop_flag: 1,
  4731. reserved1: 11;
  4732. A_UINT32 ipa_drop_low_threshold: 8,
  4733. ipa_drop_high_threshold: 8,
  4734. reserved: 16;
  4735. } POSTPACK;
  4736. enum htt_srng_ring_type {
  4737. HTT_HW_TO_SW_RING = 0,
  4738. HTT_SW_TO_HW_RING,
  4739. HTT_SW_TO_SW_RING,
  4740. /* Insert new ring types above this line */
  4741. };
  4742. enum htt_srng_ring_id {
  4743. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4744. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4745. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4746. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4747. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4748. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4749. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4750. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4751. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4752. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4753. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4754. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4755. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4756. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4757. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4758. /* Add Other SRING which can't be directly configured by host software above this line */
  4759. };
  4760. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4761. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4762. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4763. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4764. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4765. HTT_SRING_SETUP_PDEV_ID_S)
  4766. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4769. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4770. } while (0)
  4771. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4772. #define HTT_SRING_SETUP_RING_ID_S 16
  4773. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4774. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4775. HTT_SRING_SETUP_RING_ID_S)
  4776. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4779. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4780. } while (0)
  4781. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4782. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4783. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4784. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4785. HTT_SRING_SETUP_RING_TYPE_S)
  4786. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4789. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4790. } while (0)
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4793. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4794. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4795. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4796. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4797. do { \
  4798. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4799. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4800. } while (0)
  4801. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4802. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4803. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4804. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4805. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4806. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4809. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4810. } while (0)
  4811. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4812. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4813. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4814. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4815. HTT_SRING_SETUP_RING_SIZE_S)
  4816. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4817. do { \
  4818. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4819. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4820. } while (0)
  4821. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4822. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4823. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4824. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4825. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4826. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4827. do { \
  4828. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4829. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4830. } while (0)
  4831. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4832. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4833. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4834. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4835. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4836. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4837. do { \
  4838. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4839. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4840. } while (0)
  4841. /* This control bit is applicable to only Producer, which updates Ring ID field
  4842. * of each descriptor before pushing into the ring.
  4843. * 0: updates ring_id(default)
  4844. * 1: ring_id updating disabled */
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4848. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4849. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4851. do { \
  4852. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4853. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4854. } while (0)
  4855. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4856. * of each descriptor before pushing into the ring.
  4857. * 0: updates Loopcnt(default)
  4858. * 1: Loopcnt updating disabled */
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4862. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4863. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4865. do { \
  4866. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4867. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4868. } while (0)
  4869. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4870. * into security_id port of GXI/AXI. */
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4874. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4875. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4876. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4877. do { \
  4878. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4879. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4880. } while (0)
  4881. /* During MSI write operation, SRNG drives value of this register bit into
  4882. * swap bit of GXI/AXI. */
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4886. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4887. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4891. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4892. } while (0)
  4893. /* During Pointer write operation, SRNG drives value of this register bit into
  4894. * swap bit of GXI/AXI. */
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4898. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4899. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4903. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4904. } while (0)
  4905. /* During any data or TLV write operation, SRNG drives value of this register
  4906. * bit into swap bit of GXI/AXI. */
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4908. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4909. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4910. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4911. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4912. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4915. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4916. } while (0)
  4917. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4918. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4921. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4922. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4923. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4924. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4927. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4928. } while (0)
  4929. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4930. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4931. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4932. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4933. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4934. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4937. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4938. } while (0)
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4941. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4942. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4943. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4944. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4945. do { \
  4946. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4947. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4948. } while (0)
  4949. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4950. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4951. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4952. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4953. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4954. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4957. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4958. } while (0)
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4961. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4962. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4963. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4964. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4967. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4968. } while (0)
  4969. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4970. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4971. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4972. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4973. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4974. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4977. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4978. } while (0)
  4979. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4980. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4981. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4982. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4983. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4984. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4987. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4988. } while (0)
  4989. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4990. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4991. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4992. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4993. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4994. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4997. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4998. } while (0)
  4999. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  5000. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  5001. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5002. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5003. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5004. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5005. do { \
  5006. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5007. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5008. } while (0)
  5009. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5010. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5011. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5012. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5013. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5014. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5017. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5018. } while (0)
  5019. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5020. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5021. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5022. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5023. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5024. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5027. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5028. } while (0)
  5029. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5030. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5031. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5032. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5033. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5034. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5035. do { \
  5036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5037. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5038. } while (0)
  5039. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5040. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5041. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5042. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5043. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5044. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5045. do { \
  5046. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5047. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5048. } while (0)
  5049. /**
  5050. * @brief host -> target RX ring selection config message
  5051. *
  5052. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5053. *
  5054. * @details
  5055. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5056. * configure RXDMA rings.
  5057. * The configuration is per ring based and includes both packet subtypes
  5058. * and PPDU/MPDU TLVs.
  5059. *
  5060. * The message would appear as follows:
  5061. *
  5062. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5063. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5064. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5065. * |-----------------------+-----+-----+--------------------------------|
  5066. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5067. * |--------------------------------------------------------------------|
  5068. * | packet_type_enable_flags_0 |
  5069. * |--------------------------------------------------------------------|
  5070. * | packet_type_enable_flags_1 |
  5071. * |--------------------------------------------------------------------|
  5072. * | packet_type_enable_flags_2 |
  5073. * |--------------------------------------------------------------------|
  5074. * | packet_type_enable_flags_3 |
  5075. * |--------------------------------------------------------------------|
  5076. * | tlv_filter_in_flags |
  5077. * |-----------------------------------+--------------------------------|
  5078. * | rx_header_offset | rx_packet_offset |
  5079. * |-----------------------------------+--------------------------------|
  5080. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5081. * |-----------------------------------+--------------------------------|
  5082. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5083. * |-----------------------------------+--------------------------------|
  5084. * | rsvd3 | rx_attention_offset |
  5085. * |--------------------------------------------------------------------|
  5086. * | rsvd4 | mo| fp| rx_drop_threshold |
  5087. * | |ndp|ndp| |
  5088. * |--------------------------------------------------------------------|
  5089. * Where:
  5090. * PS = pkt_swap
  5091. * SS = status_swap
  5092. * OV = rx_offsets_valid
  5093. * DT = drop_thresh_valid
  5094. * CLM = config_length_mgmt
  5095. * CLC = config_length_ctrl
  5096. * CLD = config_length_data
  5097. * RXHDL = rx_hdr_len
  5098. * RX = rxpcu_filter_enable_flag
  5099. * The message is interpreted as follows:
  5100. * dword0 - b'0:7 - msg_type: This will be set to
  5101. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5102. * b'8:15 - pdev_id:
  5103. * 0 (for rings at SOC/UMAC level),
  5104. * 1/2/3 mac id (for rings at LMAC level)
  5105. * b'16:23 - ring_id : Identify the ring to configure.
  5106. * More details can be got from enum htt_srng_ring_id
  5107. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5108. * BUF_RING_CFG_0 defs within HW .h files,
  5109. * e.g. wmac_top_reg_seq_hwioreg.h
  5110. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5111. * BUF_RING_CFG_0 defs within HW .h files,
  5112. * e.g. wmac_top_reg_seq_hwioreg.h
  5113. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5114. * configuration fields are valid
  5115. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5116. * rx_drop_threshold field is valid
  5117. * b'28 - rx_mon_global_en: Enable/Disable global register
  5118. 8 configuration in Rx monitor module.
  5119. * b'29:31 - rsvd1: reserved for future use
  5120. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5121. * in byte units.
  5122. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5123. * b'16:18 - config_length_mgmt (MGMT):
  5124. * Represents the length of mpdu bytes for mgmt pkt.
  5125. * valid values:
  5126. * 001 - 64bytes
  5127. * 010 - 128bytes
  5128. * 100 - 256bytes
  5129. * 111 - Full mpdu bytes
  5130. * b'19:21 - config_length_ctrl (CTRL):
  5131. * Represents the length of mpdu bytes for ctrl pkt.
  5132. * valid values:
  5133. * 001 - 64bytes
  5134. * 010 - 128bytes
  5135. * 100 - 256bytes
  5136. * 111 - Full mpdu bytes
  5137. * b'22:24 - config_length_data (DATA):
  5138. * Represents the length of mpdu bytes for data pkt.
  5139. * valid values:
  5140. * 001 - 64bytes
  5141. * 010 - 128bytes
  5142. * 100 - 256bytes
  5143. * 111 - Full mpdu bytes
  5144. * b'25:26 - rx_hdr_len:
  5145. * Specifies the number of bytes of recvd packet to copy
  5146. * into the rx_hdr tlv.
  5147. * supported values for now by host:
  5148. * 01 - 64bytes
  5149. * 10 - 128bytes
  5150. * 11 - 256bytes
  5151. * default - 128 bytes
  5152. * b'27 - rxpcu_filter_enable_flag
  5153. * For Scan Radio Host CPU utilization is very high.
  5154. * In order to reduce CPU utilization we need to filter out
  5155. * certain configured MAC frames.
  5156. * To filter out configured MAC address frames, RxPCU should
  5157. * be zero which means allow all frames for MD at RxOLE
  5158. * host wil fiter out frames.
  5159. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5160. * b'28:31 - rsvd2: Reserved for future use
  5161. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5162. * Enable MGMT packet from 0b0000 to 0b1001
  5163. * bits from low to high: FP, MD, MO - 3 bits
  5164. * FP: Filter_Pass
  5165. * MD: Monitor_Direct
  5166. * MO: Monitor_Other
  5167. * 10 mgmt subtypes * 3 bits -> 30 bits
  5168. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5169. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5170. * Enable MGMT packet from 0b1010 to 0b1111
  5171. * bits from low to high: FP, MD, MO - 3 bits
  5172. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5173. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5174. * Enable CTRL packet from 0b0000 to 0b1001
  5175. * bits from low to high: FP, MD, MO - 3 bits
  5176. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5177. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5178. * Enable CTRL packet from 0b1010 to 0b1111,
  5179. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5180. * bits from low to high: FP, MD, MO - 3 bits
  5181. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5182. * dword6 - b'0:31 - tlv_filter_in_flags:
  5183. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5184. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5185. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5186. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5187. * A value of 0 will be considered as ignore this config.
  5188. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5189. * e.g. wmac_top_reg_seq_hwioreg.h
  5190. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5191. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5192. * A value of 0 will be considered as ignore this config.
  5193. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5194. * e.g. wmac_top_reg_seq_hwioreg.h
  5195. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5196. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5197. * A value of 0 will be considered as ignore this config.
  5198. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5199. * e.g. wmac_top_reg_seq_hwioreg.h
  5200. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5201. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5202. * A value of 0 will be considered as ignore this config.
  5203. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5204. * e.g. wmac_top_reg_seq_hwioreg.h
  5205. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5206. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5207. * A value of 0 will be considered as ignore this config.
  5208. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5209. * e.g. wmac_top_reg_seq_hwioreg.h
  5210. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5211. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5212. * A value of 0 will be considered as ignore this config.
  5213. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5214. * e.g. wmac_top_reg_seq_hwioreg.h
  5215. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5216. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5217. * A value of 0 will be considered as ignore this config.
  5218. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5219. * e.g. wmac_top_reg_seq_hwioreg.h
  5220. * - b'16:31 - rsvd3 for future use
  5221. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5222. * to source rings. Consumer drops packets if the available
  5223. * words in the ring falls below the configured threshold
  5224. * value.
  5225. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5226. * by host. 1 -> subscribed
  5227. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5228. * by host. 1 -> subscribed
  5229. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5230. * subscribed by host. 1 -> subscribed
  5231. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5232. * selection for the FP PHY ERR status tlv.
  5233. * 0 - wbm2rxdma_buf_source_ring
  5234. * 1 - fw2rxdma_buf_source_ring
  5235. * 2 - sw2rxdma_buf_source_ring
  5236. * 3 - no_buffer_ring
  5237. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5238. * selection for the FP PHY ERR status tlv.
  5239. * 0 - rxdma_release_ring
  5240. * 1 - rxdma2fw_ring
  5241. * 2 - rxdma2sw_ring
  5242. * 3 - rxdma2reo_ring
  5243. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5244. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5245. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5246. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5247. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5248. * 0: MSDU level logging
  5249. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5250. * 0: MSDU level logging
  5251. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5252. * 0: MSDU level logging
  5253. * - b'23 - word_mask_compaction: enable/disable word mask for
  5254. * mpdu/msdu start/end tlvs
  5255. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5256. * manager override
  5257. * - b'25:28 - rbm_override_val: return buffer manager override value
  5258. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5259. * which have to be posted to host from phy.
  5260. * Corresponding to errors defined in
  5261. * phyrx_abort_request_reason enums 0 to 31.
  5262. * Refer to RXPCU register definition header files for the
  5263. * phyrx_abort_request_reason enum definition.
  5264. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5265. * errors which have to be posted to host from phy.
  5266. * Corresponding to errors defined in
  5267. * phyrx_abort_request_reason enums 32 to 63.
  5268. * Refer to RXPCU register definition header files for the
  5269. * phyrx_abort_request_reason enum definition.
  5270. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5271. * applicable if word mask enabled
  5272. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5273. * applicable if word mask enabled
  5274. * - b'19:31 - rsvd7
  5275. * dword15- b'0:16 - rx_msdu_end_word_mask
  5276. * - b'17:31 - rsvd5
  5277. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5278. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5279. * buffer
  5280. * 1: RX_PKT TLV logging at specified offset for the
  5281. * subsequent buffer
  5282. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5283. */
  5284. PREPACK struct htt_rx_ring_selection_cfg_t {
  5285. A_UINT32 msg_type: 8,
  5286. pdev_id: 8,
  5287. ring_id: 8,
  5288. status_swap: 1,
  5289. pkt_swap: 1,
  5290. rx_offsets_valid: 1,
  5291. drop_thresh_valid: 1,
  5292. rx_mon_global_en: 1,
  5293. rsvd1: 3;
  5294. A_UINT32 ring_buffer_size: 16,
  5295. config_length_mgmt:3,
  5296. config_length_ctrl:3,
  5297. config_length_data:3,
  5298. rx_hdr_len: 2,
  5299. rxpcu_filter_enable_flag:1,
  5300. rsvd2: 4;
  5301. A_UINT32 packet_type_enable_flags_0;
  5302. A_UINT32 packet_type_enable_flags_1;
  5303. A_UINT32 packet_type_enable_flags_2;
  5304. A_UINT32 packet_type_enable_flags_3;
  5305. A_UINT32 tlv_filter_in_flags;
  5306. A_UINT32 rx_packet_offset: 16,
  5307. rx_header_offset: 16;
  5308. A_UINT32 rx_mpdu_end_offset: 16,
  5309. rx_mpdu_start_offset: 16;
  5310. A_UINT32 rx_msdu_end_offset: 16,
  5311. rx_msdu_start_offset: 16;
  5312. A_UINT32 rx_attn_offset: 16,
  5313. rsvd3: 16;
  5314. A_UINT32 rx_drop_threshold: 10,
  5315. fp_ndp: 1,
  5316. mo_ndp: 1,
  5317. fp_phy_err: 1,
  5318. fp_phy_err_buf_src: 2,
  5319. fp_phy_err_buf_dest: 2,
  5320. pkt_type_enable_msdu_or_mpdu_logging:3,
  5321. dma_mpdu_mgmt: 1,
  5322. dma_mpdu_ctrl: 1,
  5323. dma_mpdu_data: 1,
  5324. word_mask_compaction_enable:1,
  5325. rbm_override_enable: 1,
  5326. rbm_override_val: 4,
  5327. rsvd4: 3;
  5328. A_UINT32 phy_err_mask;
  5329. A_UINT32 phy_err_mask_cont;
  5330. A_UINT32 rx_mpdu_start_word_mask:16,
  5331. rx_mpdu_end_word_mask: 3,
  5332. rsvd7: 13;
  5333. A_UINT32 rx_msdu_end_word_mask: 17,
  5334. rsvd5: 15;
  5335. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5336. rx_pkt_tlv_offset: 15,
  5337. rsvd6: 16;
  5338. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5339. rx_mpdu_end_word_mask_v2: 8,
  5340. rsvd8: 4;
  5341. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5342. rsvd9: 12;
  5343. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5344. rsvd10: 12;
  5345. A_UINT32 packet_type_enable_fpmo_flags0;
  5346. A_UINT32 packet_type_enable_fpmo_flags1;
  5347. } POSTPACK;
  5348. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5349. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5350. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5351. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5352. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5353. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5354. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5355. do { \
  5356. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5357. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5358. } while (0)
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5360. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5361. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5362. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5363. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5364. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5365. do { \
  5366. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5367. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5368. } while (0)
  5369. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5370. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5371. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5372. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5373. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5374. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5375. do { \
  5376. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5377. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5378. } while (0)
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5382. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5383. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5385. do { \
  5386. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5387. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5388. } while (0)
  5389. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5390. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5391. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5392. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5393. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5394. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5395. do { \
  5396. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5397. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5398. } while (0)
  5399. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5400. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5401. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5402. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5403. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5404. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5405. do { \
  5406. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5407. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5408. } while (0)
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5410. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5411. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5412. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5413. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5414. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5417. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5418. } while (0)
  5419. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5420. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5421. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5422. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5423. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5424. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5425. do { \
  5426. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5427. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5428. } while (0)
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5430. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5431. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5432. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5433. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5434. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5437. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5438. } while (0)
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5440. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5441. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5442. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5443. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5444. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5445. do { \
  5446. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5447. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5448. } while (0)
  5449. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5450. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5451. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5452. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5453. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5454. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5455. do { \
  5456. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5457. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5458. } while (0)
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5462. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5463. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5464. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5467. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5468. } while(0)
  5469. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5470. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5471. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5472. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5473. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5474. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5477. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5478. } while(0)
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5482. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5483. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5487. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5488. } while (0)
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5492. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5493. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5495. do { \
  5496. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5497. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5498. } while (0)
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5502. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5503. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5505. do { \
  5506. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5507. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5508. } while (0)
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5512. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5513. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5517. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5518. } while (0)
  5519. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5520. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5521. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5522. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5523. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5524. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5528. } while (0)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5532. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5533. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5538. } while (0)
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5542. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5543. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5548. } while (0)
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5552. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5553. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5554. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5558. } while (0)
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5560. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5561. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5562. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5563. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5564. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5568. } while (0)
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5570. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5571. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5572. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5573. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5574. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5578. } while (0)
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5580. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5581. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5582. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5583. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5584. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5588. } while (0)
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5590. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5591. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5592. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5593. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5594. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5598. } while (0)
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5600. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5601. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5602. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5603. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5604. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5605. do { \
  5606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5608. } while (0)
  5609. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5610. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5611. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5612. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5613. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5614. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5615. do { \
  5616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5618. } while (0)
  5619. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5620. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5621. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5622. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5623. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5624. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5628. } while (0)
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5630. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5631. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5632. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5633. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5634. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5638. } while (0)
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5640. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5641. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5642. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5643. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5644. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5645. do { \
  5646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5648. } while (0)
  5649. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5650. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5651. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5652. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5653. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5654. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5655. do { \
  5656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5658. } while (0)
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5662. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5663. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5665. do { \
  5666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5668. } while (0)
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5670. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5671. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5672. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5673. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5674. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5675. do { \
  5676. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5677. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5678. } while (0)
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5680. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5681. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5682. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5683. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5684. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5687. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5688. } while (0)
  5689. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5690. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5691. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5692. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5693. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5694. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5695. do { \
  5696. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5697. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5698. } while (0)
  5699. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5700. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5701. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5702. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5703. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5704. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5707. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5708. } while (0)
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5710. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5711. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5712. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5713. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5714. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5717. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5718. } while (0)
  5719. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5720. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5721. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5722. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5723. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5724. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5725. do { \
  5726. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5727. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5728. } while (0)
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5730. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5731. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5732. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5733. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5734. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5735. do { \
  5736. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5737. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5738. } while (0)
  5739. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5740. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5741. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5742. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5743. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5744. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5747. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5748. } while (0)
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5750. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5751. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5752. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5753. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5754. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5755. do { \
  5756. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5757. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5758. } while (0)
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5760. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5761. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5762. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5763. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5764. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5765. do { \
  5766. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5767. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5768. } while (0)
  5769. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5770. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5771. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5772. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5773. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5774. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5775. do { \
  5776. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5777. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5778. } while (0)
  5779. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5780. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5781. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5782. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5783. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5784. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5785. do { \
  5786. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5787. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5788. } while (0)
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5790. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5791. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5792. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5793. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5794. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5797. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5798. } while (0)
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5800. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5801. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5802. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5803. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5804. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5807. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5808. } while (0)
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5810. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5811. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5812. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5813. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5814. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5815. do { \
  5816. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5817. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5818. } while (0)
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5820. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5821. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5822. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5823. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5824. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5825. do { \
  5826. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5827. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5828. } while (0)
  5829. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5830. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5831. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5832. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5833. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5834. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5835. do { \
  5836. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5837. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5838. } while (0)
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5840. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5841. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5842. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5843. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5844. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5845. do { \
  5846. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5847. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5848. } while (0)
  5849. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5850. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5851. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5852. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5853. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5854. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5855. do { \
  5856. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5857. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5858. } while (0)
  5859. /*
  5860. * Subtype based MGMT frames enable bits.
  5861. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5862. */
  5863. /* association request */
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5870. /* association response */
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5877. /* Reassociation request */
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5884. /* Reassociation response */
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5891. /* Probe request */
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5898. /* Probe response */
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5905. /* Timing Advertisement */
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5912. /* Reserved */
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5919. /* Beacon */
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5926. /* ATIM */
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5933. /* Disassociation */
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5940. /* Authentication */
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5947. /* Deauthentication */
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5954. /* Action */
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5961. /* Action No Ack */
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5968. /* Reserved */
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5975. /*
  5976. * Subtype based CTRL frames enable bits.
  5977. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5978. */
  5979. /* Reserved */
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5986. /* Reserved */
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5993. /* Reserved */
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  6000. /* Reserved */
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6007. /* Reserved */
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6014. /* Reserved */
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6021. /* Reserved */
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6028. /* Control Wrapper */
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6035. /* Block Ack Request */
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6042. /* Block Ack*/
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6049. /* PS-POLL */
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6056. /* RTS */
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6063. /* CTS */
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6070. /* ACK */
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6077. /* CF-END */
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6084. /* CF-END + CF-ACK */
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6091. /* Multicast data */
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6098. /* Unicast data */
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6105. /* NULL data */
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6112. /* FPMO mode flags */
  6113. /* MGMT */
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6146. /* CTRL */
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6179. /* DATA */
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6191. do { \
  6192. HTT_CHECK_SET_VAL(httsym, value); \
  6193. (word) |= (value) << httsym##_S; \
  6194. } while (0)
  6195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6196. (((word) & httsym##_M) >> httsym##_S)
  6197. #define htt_rx_ring_pkt_enable_subtype_set( \
  6198. word, flag, mode, type, subtype, val) \
  6199. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6200. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6201. #define htt_rx_ring_pkt_enable_subtype_get( \
  6202. word, flag, mode, type, subtype) \
  6203. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6204. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6205. /* Definition to filter in TLVs */
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6234. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6235. do { \
  6236. HTT_CHECK_SET_VAL(httsym, enable); \
  6237. (word) |= (enable) << httsym##_S; \
  6238. } while (0)
  6239. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6240. (((word) & httsym##_M) >> httsym##_S)
  6241. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6242. HTT_RX_RING_TLV_ENABLE_SET( \
  6243. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6244. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6245. HTT_RX_RING_TLV_ENABLE_GET( \
  6246. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6247. /**
  6248. * @brief host -> target TX monitor config message
  6249. *
  6250. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6251. *
  6252. * @details
  6253. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6254. * configure RXDMA rings.
  6255. * The configuration is per ring based and includes both packet types
  6256. * and PPDU/MPDU TLVs.
  6257. *
  6258. * The message would appear as follows:
  6259. *
  6260. * |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|
  6261. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6262. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6263. * |-----------+--------+--------+-----+------------------------------------|
  6264. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6265. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6266. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6267. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6268. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6269. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6270. * |------------------------------------------------------------------------|
  6271. * | tlv_filter_mask_in0 |
  6272. * |------------------------------------------------------------------------|
  6273. * | tlv_filter_mask_in1 |
  6274. * |------------------------------------------------------------------------|
  6275. * | tlv_filter_mask_in2 |
  6276. * |------------------------------------------------------------------------|
  6277. * | tlv_filter_mask_in3 |
  6278. * |-----------------+-----------------+---------------------+--------------|
  6279. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6280. * |------------------------------------------------------------------------|
  6281. * | pcu_ppdu_setup_word_mask |
  6282. * |--------------------+--+--+--+-----+---------------------+--------------|
  6283. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6284. * |------------------------------------------------------------------------|
  6285. *
  6286. * Where:
  6287. * PS = pkt_swap
  6288. * SS = status_swap
  6289. * The message is interpreted as follows:
  6290. * dword0 - b'0:7 - msg_type: This will be set to
  6291. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6292. * b'8:15 - pdev_id:
  6293. * 0 (for rings at SOC level),
  6294. * 1/2/3 mac id (for rings at LMAC level)
  6295. * b'16:23 - ring_id : Identify the ring to configure.
  6296. * More details can be got from enum htt_srng_ring_id
  6297. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6298. * BUF_RING_CFG_0 defs within HW .h files,
  6299. * e.g. wmac_top_reg_seq_hwioreg.h
  6300. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6301. * BUF_RING_CFG_0 defs within HW .h files,
  6302. * e.g. wmac_top_reg_seq_hwioreg.h
  6303. * b'26 - tx_mon_global_en: Enable/Disable global register
  6304. * configuration in Tx monitor module.
  6305. * b'27:31 - rsvd1: reserved for future use
  6306. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6307. * in byte units.
  6308. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6309. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6310. * 64, 128, 256.
  6311. * If all 3 bits are set config length is > 256.
  6312. * if val is '0', then ignore this field.
  6313. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6314. * 64, 128, 256.
  6315. * If all 3 bits are set config length is > 256.
  6316. * if val is '0', then ignore this field.
  6317. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6318. * 64, 128, 256.
  6319. * If all 3 bits are set config length is > 256.
  6320. * If val is '0', then ignore this field.
  6321. * - b'25:31 - rsvd2: Reserved for future use
  6322. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6323. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6324. * If packet_type_enable_flags is '1' for MGMT type,
  6325. * monitor will ignore this bit and allow this TLV.
  6326. * If packet_type_enable_flags is '0' for MGMT type,
  6327. * monitor will use this bit to enable/disable logging
  6328. * of this TLV.
  6329. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6330. * If packet_type_enable_flags is '1' for CTRL type,
  6331. * monitor will ignore this bit and allow this TLV.
  6332. * If packet_type_enable_flags is '0' for CTRL type,
  6333. * monitor will use this bit to enable/disable logging
  6334. * of this TLV.
  6335. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6336. * If packet_type_enable_flags is '1' for DATA type,
  6337. * monitor will ignore this bit and allow this TLV.
  6338. * If packet_type_enable_flags is '0' for DATA type,
  6339. * monitor will use this bit to enable/disable logging
  6340. * of this TLV.
  6341. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6342. * If packet_type_enable_flags is '1' for MGMT type,
  6343. * monitor will ignore this bit and allow this TLV.
  6344. * If packet_type_enable_flags is '0' for MGMT type,
  6345. * monitor will use this bit to enable/disable logging
  6346. * of this TLV.
  6347. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6348. * If packet_type_enable_flags is '1' for CTRL type,
  6349. * monitor will ignore this bit and allow this TLV.
  6350. * If packet_type_enable_flags is '0' for CTRL type,
  6351. * monitor will use this bit to enable/disable logging
  6352. * of this TLV.
  6353. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6354. * If packet_type_enable_flags is '1' for DATA type,
  6355. * monitor will ignore this bit and allow this TLV.
  6356. * If packet_type_enable_flags is '0' for DATA type,
  6357. * monitor will use this bit to enable/disable logging
  6358. * of this TLV.
  6359. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6360. * If packet_type_enable_flags is '1' for MGMT type,
  6361. * monitor will ignore this bit and allow this TLV.
  6362. * If packet_type_enable_flags is '0' for MGMT type,
  6363. * monitor will use this bit to enable/disable logging
  6364. * of this TLV.
  6365. * If filter_in_TX_MPDU_START = 1 it is recommended
  6366. * to set this bit.
  6367. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6368. * If packet_type_enable_flags is '1' for CTRL type,
  6369. * monitor will ignore this bit and allow this TLV.
  6370. * If packet_type_enable_flags is '0' for CTRL type,
  6371. * monitor will use this bit to enable/disable logging
  6372. * of this TLV.
  6373. * If filter_in_TX_MPDU_START = 1 it is recommended
  6374. * to set this bit.
  6375. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6376. * If packet_type_enable_flags is '1' for DATA type,
  6377. * monitor will ignore this bit and allow this TLV.
  6378. * If packet_type_enable_flags is '0' for DATA type,
  6379. * monitor will use this bit to enable/disable logging
  6380. * of this TLV.
  6381. * If filter_in_TX_MPDU_START = 1 it is recommended
  6382. * to set this bit.
  6383. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6384. * If packet_type_enable_flags is '1' for MGMT type,
  6385. * monitor will ignore this bit and allow this TLV.
  6386. * If packet_type_enable_flags is '0' for MGMT type,
  6387. * monitor will use this bit to enable/disable logging
  6388. * of this TLV.
  6389. * If filter_in_TX_MSDU_START = 1 it is recommended
  6390. * to set this bit.
  6391. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6392. * If packet_type_enable_flags is '1' for CTRL type,
  6393. * monitor will ignore this bit and allow this TLV.
  6394. * If packet_type_enable_flags is '0' for CTRL type,
  6395. * monitor will use this bit to enable/disable logging
  6396. * of this TLV.
  6397. * If filter_in_TX_MSDU_START = 1 it is recommended
  6398. * to set this bit.
  6399. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6400. * If packet_type_enable_flags is '1' for DATA type,
  6401. * monitor will ignore this bit and allow this TLV.
  6402. * If packet_type_enable_flags is '0' for DATA type,
  6403. * monitor will use this bit to enable/disable logging
  6404. * of this TLV.
  6405. * If filter_in_TX_MSDU_START = 1 it is recommended
  6406. * to set this bit.
  6407. * b'15:31 - rsvd3: Reserved for future use
  6408. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6409. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6410. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6411. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6412. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6413. * - b'8:15 - tx_peer_entry_word_mask:
  6414. * - b'16:23 - tx_queue_ext_word_mask:
  6415. * - b'24:31 - tx_msdu_start_word_mask:
  6416. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6417. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6418. * - b'8:15 - rxpcu_user_setup_word_mask:
  6419. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6420. * MGMT, CTRL, DATA
  6421. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6422. * 0 -> MSDU level logging is enabled
  6423. * (valid only if bit is set in
  6424. * pkt_type_enable_msdu_or_mpdu_logging)
  6425. * 1 -> MPDU level logging is enabled
  6426. * (valid only if bit is set in
  6427. * pkt_type_enable_msdu_or_mpdu_logging)
  6428. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6429. * 0 -> MSDU level logging is enabled
  6430. * (valid only if bit is set in
  6431. * pkt_type_enable_msdu_or_mpdu_logging)
  6432. * 1 -> MPDU level logging is enabled
  6433. * (valid only if bit is set in
  6434. * pkt_type_enable_msdu_or_mpdu_logging)
  6435. * - b'21 - dma_mpdu_data(D) : For DATA
  6436. * 0 -> MSDU level logging is enabled
  6437. * (valid only if bit is set in
  6438. * pkt_type_enable_msdu_or_mpdu_logging)
  6439. * 1 -> MPDU level logging is enabled
  6440. * (valid only if bit is set in
  6441. * pkt_type_enable_msdu_or_mpdu_logging)
  6442. * - b'22:31 - rsvd4 for future use
  6443. */
  6444. PREPACK struct htt_tx_monitor_cfg_t {
  6445. A_UINT32 msg_type: 8,
  6446. pdev_id: 8,
  6447. ring_id: 8,
  6448. status_swap: 1,
  6449. pkt_swap: 1,
  6450. tx_mon_global_en: 1,
  6451. rsvd1: 5;
  6452. A_UINT32 ring_buffer_size: 16,
  6453. config_length_mgmt: 3,
  6454. config_length_ctrl: 3,
  6455. config_length_data: 3,
  6456. rsvd2: 7;
  6457. A_UINT32 pkt_type_enable_flags: 3,
  6458. filter_in_tx_mpdu_start_mgmt: 1,
  6459. filter_in_tx_mpdu_start_ctrl: 1,
  6460. filter_in_tx_mpdu_start_data: 1,
  6461. filter_in_tx_msdu_start_mgmt: 1,
  6462. filter_in_tx_msdu_start_ctrl: 1,
  6463. filter_in_tx_msdu_start_data: 1,
  6464. filter_in_tx_mpdu_end_mgmt: 1,
  6465. filter_in_tx_mpdu_end_ctrl: 1,
  6466. filter_in_tx_mpdu_end_data: 1,
  6467. filter_in_tx_msdu_end_mgmt: 1,
  6468. filter_in_tx_msdu_end_ctrl: 1,
  6469. filter_in_tx_msdu_end_data: 1,
  6470. word_mask_compaction_enable: 1,
  6471. rsvd3: 16;
  6472. A_UINT32 tlv_filter_mask_in0;
  6473. A_UINT32 tlv_filter_mask_in1;
  6474. A_UINT32 tlv_filter_mask_in2;
  6475. A_UINT32 tlv_filter_mask_in3;
  6476. A_UINT32 tx_fes_setup_word_mask: 8,
  6477. tx_peer_entry_word_mask: 8,
  6478. tx_queue_ext_word_mask: 8,
  6479. tx_msdu_start_word_mask: 8;
  6480. A_UINT32 pcu_ppdu_setup_word_mask;
  6481. A_UINT32 tx_mpdu_start_word_mask: 8,
  6482. rxpcu_user_setup_word_mask: 8,
  6483. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6484. dma_mpdu_mgmt: 1,
  6485. dma_mpdu_ctrl: 1,
  6486. dma_mpdu_data: 1,
  6487. rsvd4: 10;
  6488. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6489. tx_peer_entry_v2_word_mask: 12,
  6490. rsvd5: 10;
  6491. A_UINT32 fes_status_end_word_mask: 16,
  6492. response_end_status_word_mask: 16;
  6493. A_UINT32 fes_status_prot_word_mask: 11,
  6494. rsvd6: 21;
  6495. } POSTPACK;
  6496. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6497. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6498. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6499. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6500. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6501. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6502. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6503. do { \
  6504. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6505. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6506. } while (0)
  6507. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6508. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6509. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6510. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6511. HTT_TX_MONITOR_CFG_RING_ID_S)
  6512. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6515. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6516. } while (0)
  6517. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6518. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6519. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6520. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6521. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6522. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6525. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6526. } while (0)
  6527. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6528. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6529. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6530. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6531. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6532. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6533. do { \
  6534. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6535. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6536. } while (0)
  6537. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6538. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6539. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6540. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6541. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6542. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6545. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6546. } while (0)
  6547. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6548. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6549. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6550. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6551. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6552. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6553. do { \
  6554. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6555. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6556. } while (0)
  6557. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6558. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6559. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6560. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6561. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6562. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6563. do { \
  6564. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6565. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6566. } while (0)
  6567. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6568. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6569. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6570. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6571. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6572. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6573. do { \
  6574. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6575. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6576. } while (0)
  6577. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6578. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6579. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6580. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6581. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6582. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6585. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6586. } while (0)
  6587. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6590. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6591. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6592. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6593. do { \
  6594. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6595. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6596. } while (0)
  6597. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6598. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6599. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6600. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6601. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6602. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6605. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6606. } while (0)
  6607. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6608. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6609. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6610. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6611. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6612. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6615. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6616. } while (0)
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6619. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6620. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6621. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6622. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6625. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6626. } while (0)
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6629. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6630. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6631. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6632. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6633. do { \
  6634. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6635. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6636. } while (0)
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6639. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6640. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6641. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6642. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6643. do { \
  6644. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6645. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6646. } while (0)
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6649. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6650. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6651. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6652. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6653. do { \
  6654. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6655. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6656. } while (0)
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6659. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6660. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6661. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6662. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6663. do { \
  6664. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6665. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6666. } while (0)
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6669. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6670. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6671. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6672. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6675. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6676. } while (0)
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6679. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6680. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6681. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6682. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6683. do { \
  6684. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6685. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6686. } while (0)
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6689. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6690. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6691. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6692. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6693. do { \
  6694. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6695. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6696. } while (0)
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6699. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6700. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6701. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6702. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6703. do { \
  6704. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6705. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6706. } while (0)
  6707. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6708. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6709. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6710. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6711. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6712. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6713. do { \
  6714. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6715. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6716. } while (0)
  6717. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6718. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6719. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6720. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6721. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6722. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6723. do { \
  6724. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6725. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6726. } while (0)
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6730. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6731. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6733. do { \
  6734. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6735. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6736. } while (0)
  6737. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6738. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6739. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6740. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6741. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6742. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6743. do { \
  6744. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6745. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6746. } while (0)
  6747. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6748. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6749. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6750. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6751. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6752. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6753. do { \
  6754. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6755. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6756. } while (0)
  6757. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6758. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6759. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6760. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6761. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6762. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6763. do { \
  6764. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6765. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6766. } while (0)
  6767. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6768. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6769. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6770. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6771. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6772. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6773. do { \
  6774. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6775. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6776. } while (0)
  6777. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6778. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6779. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6780. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6781. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6782. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6783. do { \
  6784. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6785. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6786. } while (0)
  6787. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6788. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6789. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6790. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6791. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6792. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6793. do { \
  6794. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6795. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6796. } while (0)
  6797. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6798. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6799. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6800. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6801. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6802. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6803. do { \
  6804. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6805. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6806. } while (0)
  6807. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6808. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6809. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6810. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6811. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6812. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6813. do { \
  6814. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6815. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6816. } while (0)
  6817. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6818. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6819. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6820. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6821. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6822. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6823. do { \
  6824. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6825. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6826. } while (0)
  6827. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6828. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6829. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6830. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6831. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6832. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6833. do { \
  6834. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6835. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6836. } while (0)
  6837. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6838. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6839. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6840. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6841. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6842. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6843. do { \
  6844. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6845. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6846. } while (0)
  6847. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6848. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6849. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6850. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6851. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6852. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6853. do { \
  6854. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6855. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6856. } while (0)
  6857. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6858. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6859. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6860. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6861. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6862. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6863. do { \
  6864. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6865. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6866. } while (0)
  6867. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6868. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6869. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6870. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6871. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6872. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6873. do { \
  6874. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6875. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6876. } while (0)
  6877. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6878. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6879. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6880. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6881. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6882. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6883. do { \
  6884. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6885. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6886. } while (0)
  6887. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6888. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6889. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6890. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6891. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6892. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6893. do { \
  6894. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6895. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6896. } while (0)
  6897. /*
  6898. * pkt_type_enable_flags
  6899. */
  6900. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6902. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6903. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6904. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6905. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6906. /*
  6907. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6908. */
  6909. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6910. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6911. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6912. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6913. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6914. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6915. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6916. do { \
  6917. HTT_CHECK_SET_VAL(httsym, value); \
  6918. (word) |= (value) << httsym##_S; \
  6919. } while (0)
  6920. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6921. (((word) & httsym##_M) >> httsym##_S)
  6922. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6923. * type -> MGMT, CTRL, DATA*/
  6924. #define htt_tx_ring_pkt_type_set( \
  6925. word, mode, type, val) \
  6926. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6927. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6928. #define htt_tx_ring_pkt_type_get( \
  6929. word, mode, type) \
  6930. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6931. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6932. /* Definition to filter in TLVs */
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6997. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6998. do { \
  6999. HTT_CHECK_SET_VAL(httsym, enable); \
  7000. (word) |= (enable) << httsym##_S; \
  7001. } while (0)
  7002. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7003. (((word) & httsym##_M) >> httsym##_S)
  7004. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7005. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7006. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7007. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7008. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7009. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7074. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7075. do { \
  7076. HTT_CHECK_SET_VAL(httsym, enable); \
  7077. (word) |= (enable) << httsym##_S; \
  7078. } while (0)
  7079. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7080. (((word) & httsym##_M) >> httsym##_S)
  7081. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7082. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7083. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7084. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7085. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7086. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7151. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7152. do { \
  7153. HTT_CHECK_SET_VAL(httsym, enable); \
  7154. (word) |= (enable) << httsym##_S; \
  7155. } while (0)
  7156. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7157. (((word) & httsym##_M) >> httsym##_S)
  7158. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7159. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7160. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7161. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7162. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7163. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7208. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7209. do { \
  7210. HTT_CHECK_SET_VAL(httsym, enable); \
  7211. (word) |= (enable) << httsym##_S; \
  7212. } while (0)
  7213. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7214. (((word) & httsym##_M) >> httsym##_S)
  7215. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7216. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7217. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7218. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7219. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7220. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7221. /**
  7222. * @brief host --> target Receive Flow Steering configuration message definition
  7223. *
  7224. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7225. *
  7226. * host --> target Receive Flow Steering configuration message definition.
  7227. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7228. * The reason for this is we want RFS to be configured and ready before MAC
  7229. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7230. *
  7231. * |31 24|23 16|15 9|8|7 0|
  7232. * |----------------+----------------+----------------+----------------|
  7233. * | reserved |E| msg type |
  7234. * |-------------------------------------------------------------------|
  7235. * Where E = RFS enable flag
  7236. *
  7237. * The RFS_CONFIG message consists of a single 4-byte word.
  7238. *
  7239. * Header fields:
  7240. * - MSG_TYPE
  7241. * Bits 7:0
  7242. * Purpose: identifies this as a RFS config msg
  7243. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7244. * - RFS_CONFIG
  7245. * Bit 8
  7246. * Purpose: Tells target whether to enable (1) or disable (0)
  7247. * flow steering feature when sending rx indication messages to host
  7248. */
  7249. #define HTT_H2T_RFS_CONFIG_M 0x100
  7250. #define HTT_H2T_RFS_CONFIG_S 8
  7251. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7252. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7253. HTT_H2T_RFS_CONFIG_S)
  7254. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7255. do { \
  7256. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7257. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7258. } while (0)
  7259. #define HTT_RFS_CFG_REQ_BYTES 4
  7260. /**
  7261. * @brief host -> target FW extended statistics request
  7262. *
  7263. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7264. *
  7265. * @details
  7266. * The following field definitions describe the format of the HTT host
  7267. * to target FW extended stats retrieve message.
  7268. * The message specifies the type of stats the host wants to retrieve.
  7269. *
  7270. * |31 24|23 16|15 8|7 0|
  7271. * |-----------------------------------------------------------|
  7272. * | reserved | stats type | pdev_mask | msg type |
  7273. * |-----------------------------------------------------------|
  7274. * | config param [0] |
  7275. * |-----------------------------------------------------------|
  7276. * | config param [1] |
  7277. * |-----------------------------------------------------------|
  7278. * | config param [2] |
  7279. * |-----------------------------------------------------------|
  7280. * | config param [3] |
  7281. * |-----------------------------------------------------------|
  7282. * | reserved |
  7283. * |-----------------------------------------------------------|
  7284. * | cookie LSBs |
  7285. * |-----------------------------------------------------------|
  7286. * | cookie MSBs |
  7287. * |-----------------------------------------------------------|
  7288. * Header fields:
  7289. * - MSG_TYPE
  7290. * Bits 7:0
  7291. * Purpose: identifies this is a extended stats upload request message
  7292. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7293. * - PDEV_MASK
  7294. * Bits 8:15
  7295. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7296. * Value: This is a overloaded field, refer to usage and interpretation of
  7297. * PDEV in interface document.
  7298. * Bit 8 : Reserved for SOC stats
  7299. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7300. * Indicates MACID_MASK in DBS
  7301. * - STATS_TYPE
  7302. * Bits 23:16
  7303. * Purpose: identifies which FW statistics to upload
  7304. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7305. * - Reserved
  7306. * Bits 31:24
  7307. * - CONFIG_PARAM [0]
  7308. * Bits 31:0
  7309. * Purpose: give an opaque configuration value to the specified stats type
  7310. * Value: stats-type specific configuration value
  7311. * Refer to htt_stats.h for interpretation for each stats sub_type
  7312. * - CONFIG_PARAM [1]
  7313. * Bits 31:0
  7314. * Purpose: give an opaque configuration value to the specified stats type
  7315. * Value: stats-type specific configuration value
  7316. * Refer to htt_stats.h for interpretation for each stats sub_type
  7317. * - CONFIG_PARAM [2]
  7318. * Bits 31:0
  7319. * Purpose: give an opaque configuration value to the specified stats type
  7320. * Value: stats-type specific configuration value
  7321. * Refer to htt_stats.h for interpretation for each stats sub_type
  7322. * - CONFIG_PARAM [3]
  7323. * Bits 31:0
  7324. * Purpose: give an opaque configuration value to the specified stats type
  7325. * Value: stats-type specific configuration value
  7326. * Refer to htt_stats.h for interpretation for each stats sub_type
  7327. * - Reserved [31:0] for future use.
  7328. * - COOKIE_LSBS
  7329. * Bits 31:0
  7330. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7331. * message with its preceding host->target stats request message.
  7332. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7333. * - COOKIE_MSBS
  7334. * Bits 31:0
  7335. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7336. * message with its preceding host->target stats request message.
  7337. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7338. */
  7339. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7340. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7341. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7342. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7343. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7344. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7345. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7346. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7347. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7348. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7349. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7352. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7353. } while (0)
  7354. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7355. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7356. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7357. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7358. do { \
  7359. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7360. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7361. } while (0)
  7362. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7363. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7364. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7365. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7368. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7369. } while (0)
  7370. /**
  7371. * @brief host -> target FW streaming statistics request
  7372. *
  7373. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7374. *
  7375. * @details
  7376. * The following field definitions describe the format of the HTT host
  7377. * to target message that requests the target to start or stop producing
  7378. * ongoing stats of the specified type.
  7379. *
  7380. * |31|30 |23 16|15 8|7 0|
  7381. * |-----------------------------------------------------------|
  7382. * |EN| reserved | stats type | reserved | msg type |
  7383. * |-----------------------------------------------------------|
  7384. * | config param [0] |
  7385. * |-----------------------------------------------------------|
  7386. * | config param [1] |
  7387. * |-----------------------------------------------------------|
  7388. * | config param [2] |
  7389. * |-----------------------------------------------------------|
  7390. * | config param [3] |
  7391. * |-----------------------------------------------------------|
  7392. * Where:
  7393. * - EN is an enable/disable flag
  7394. * Header fields:
  7395. * - MSG_TYPE
  7396. * Bits 7:0
  7397. * Purpose: identifies this is a streaming stats upload request message
  7398. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7399. * - STATS_TYPE
  7400. * Bits 23:16
  7401. * Purpose: identifies which FW statistics to upload
  7402. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7403. * Only the htt_dbg_ext_stats_type values identified as streaming
  7404. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7405. * - ENABLE
  7406. * Bit 31
  7407. * Purpose: enable/disable the target's ongoing stats of the specified type
  7408. * Value:
  7409. * 0 - disable ongoing production of the specified stats type
  7410. * 1 - enable ongoing production of the specified stats type
  7411. * - CONFIG_PARAM [0]
  7412. * Bits 31:0
  7413. * Purpose: give an opaque configuration value to the specified stats type
  7414. * Value: stats-type specific configuration value
  7415. * Refer to htt_stats.h for interpretation for each stats sub_type
  7416. * - CONFIG_PARAM [1]
  7417. * Bits 31:0
  7418. * Purpose: give an opaque configuration value to the specified stats type
  7419. * Value: stats-type specific configuration value
  7420. * Refer to htt_stats.h for interpretation for each stats sub_type
  7421. * - CONFIG_PARAM [2]
  7422. * Bits 31:0
  7423. * Purpose: give an opaque configuration value to the specified stats type
  7424. * Value: stats-type specific configuration value
  7425. * Refer to htt_stats.h for interpretation for each stats sub_type
  7426. * - CONFIG_PARAM [3]
  7427. * Bits 31:0
  7428. * Purpose: give an opaque configuration value to the specified stats type
  7429. * Value: stats-type specific configuration value
  7430. * Refer to htt_stats.h for interpretation for each stats sub_type
  7431. */
  7432. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7433. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7434. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7435. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7436. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7437. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7438. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7439. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7440. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7441. do { \
  7442. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7443. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7444. } while (0)
  7445. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7446. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7447. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7448. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7449. do { \
  7450. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7451. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7452. } while (0)
  7453. /**
  7454. * @brief host -> target FW PPDU_STATS request message
  7455. *
  7456. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7457. *
  7458. * @details
  7459. * The following field definitions describe the format of the HTT host
  7460. * to target FW for PPDU_STATS_CFG msg.
  7461. * The message allows the host to configure the PPDU_STATS_IND messages
  7462. * produced by the target.
  7463. *
  7464. * |31 24|23 16|15 8|7 0|
  7465. * |-----------------------------------------------------------|
  7466. * | REQ bit mask | pdev_mask | msg type |
  7467. * |-----------------------------------------------------------|
  7468. * Header fields:
  7469. * - MSG_TYPE
  7470. * Bits 7:0
  7471. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7472. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7473. * - PDEV_MASK
  7474. * Bits 8:15
  7475. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7476. * Value: This is a overloaded field, refer to usage and interpretation of
  7477. * PDEV in interface document.
  7478. * Bit 8 : Reserved for SOC stats
  7479. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7480. * Indicates MACID_MASK in DBS
  7481. * - REQ_TLV_BIT_MASK
  7482. * Bits 16:31
  7483. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7484. * needs to be included in the target's PPDU_STATS_IND messages.
  7485. * Value: refer htt_ppdu_stats_tlv_tag_t
  7486. *
  7487. */
  7488. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7489. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7490. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7491. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7492. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7493. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7494. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7495. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7496. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7499. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7500. } while (0)
  7501. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7502. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7503. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7504. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7505. do { \
  7506. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7507. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7508. } while (0)
  7509. /**
  7510. * @brief Host-->target HTT RX FSE setup message
  7511. *
  7512. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7513. *
  7514. * @details
  7515. * Through this message, the host will provide details of the flow tables
  7516. * in host DDR along with hash keys.
  7517. * This message can be sent per SOC or per PDEV, which is differentiated
  7518. * by pdev id values.
  7519. * The host will allocate flow search table and sends table size,
  7520. * physical DMA address of flow table, and hash keys to firmware to
  7521. * program into the RXOLE FSE HW block.
  7522. *
  7523. * The following field definitions describe the format of the RX FSE setup
  7524. * message sent from the host to target
  7525. *
  7526. * Header fields:
  7527. * dword0 - b'7:0 - msg_type: This will be set to
  7528. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7529. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7530. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7531. * pdev's LMAC ring.
  7532. * b'31:16 - reserved : Reserved for future use
  7533. * dword1 - b'19:0 - number of records: This field indicates the number of
  7534. * entries in the flow table. For example: 8k number of
  7535. * records is equivalent to
  7536. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7537. * b'27:20 - max search: This field specifies the skid length to FSE
  7538. * parser HW module whenever match is not found at the
  7539. * exact index pointed by hash.
  7540. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7541. * Refer htt_ip_da_sa_prefix below for more details.
  7542. * b'31:30 - reserved: Reserved for future use
  7543. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7544. * table allocated by host in DDR
  7545. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7546. * table allocated by host in DDR
  7547. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7548. * entry hashing
  7549. *
  7550. *
  7551. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7552. * |---------------------------------------------------------------|
  7553. * | reserved | pdev_id | MSG_TYPE |
  7554. * |---------------------------------------------------------------|
  7555. * |resvd|IPDSA| max_search | Number of records |
  7556. * |---------------------------------------------------------------|
  7557. * | base address lo |
  7558. * |---------------------------------------------------------------|
  7559. * | base address high |
  7560. * |---------------------------------------------------------------|
  7561. * | toeplitz key 31_0 |
  7562. * |---------------------------------------------------------------|
  7563. * | toeplitz key 63_32 |
  7564. * |---------------------------------------------------------------|
  7565. * | toeplitz key 95_64 |
  7566. * |---------------------------------------------------------------|
  7567. * | toeplitz key 127_96 |
  7568. * |---------------------------------------------------------------|
  7569. * | toeplitz key 159_128 |
  7570. * |---------------------------------------------------------------|
  7571. * | toeplitz key 191_160 |
  7572. * |---------------------------------------------------------------|
  7573. * | toeplitz key 223_192 |
  7574. * |---------------------------------------------------------------|
  7575. * | toeplitz key 255_224 |
  7576. * |---------------------------------------------------------------|
  7577. * | toeplitz key 287_256 |
  7578. * |---------------------------------------------------------------|
  7579. * | reserved | toeplitz key 314_288(26:0 bits) |
  7580. * |---------------------------------------------------------------|
  7581. * where:
  7582. * IPDSA = ip_da_sa
  7583. */
  7584. /**
  7585. * @brief: htt_ip_da_sa_prefix
  7586. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7587. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7588. * documentation per RFC3849
  7589. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7590. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7591. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7592. */
  7593. enum htt_ip_da_sa_prefix {
  7594. HTT_RX_IPV6_20010db8,
  7595. HTT_RX_IPV4_MAPPED_IPV6,
  7596. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7597. HTT_RX_IPV6_64FF9B,
  7598. };
  7599. /**
  7600. * @brief Host-->target HTT RX FISA configure and enable
  7601. *
  7602. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7603. *
  7604. * @details
  7605. * The host will send this command down to configure and enable the FISA
  7606. * operational params.
  7607. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7608. * register.
  7609. * Should configure both the MACs.
  7610. *
  7611. * dword0 - b'7:0 - msg_type:
  7612. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7613. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7614. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7615. * pdev's LMAC ring.
  7616. * b'31:16 - reserved : Reserved for future use
  7617. *
  7618. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7619. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7620. * packets. 1 flow search will be skipped
  7621. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7622. * tcp,udp packets
  7623. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7624. * calculation
  7625. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7626. * calculation
  7627. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7628. * calculation
  7629. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7630. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7631. * length
  7632. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7633. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7634. * length
  7635. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7636. * num jump
  7637. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7638. * num jump
  7639. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7640. * data type switch has happened for MPDU Sequence num jump
  7641. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7642. * for MPDU Sequence num jump
  7643. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7644. * for decrypt errors
  7645. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7646. * while aggregating a msdu
  7647. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7648. * The aggregation is done until (number of MSDUs aggregated
  7649. * < LIMIT + 1)
  7650. * b'31:18 - Reserved
  7651. *
  7652. * fisa_control_value - 32bit value FW can write to register
  7653. *
  7654. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7655. * Threshold value for FISA timeout (units are microseconds).
  7656. * When the global timestamp exceeds this threshold, FISA
  7657. * aggregation will be restarted.
  7658. * A value of 0 means timeout is disabled.
  7659. * Compare the threshold register with timestamp field in
  7660. * flow entry to generate timeout for the flow.
  7661. *
  7662. * |31 18 |17 16|15 8|7 0|
  7663. * |-------------------------------------------------------------|
  7664. * | reserved | pdev_mask | msg type |
  7665. * |-------------------------------------------------------------|
  7666. * | reserved | FISA_CTRL |
  7667. * |-------------------------------------------------------------|
  7668. * | FISA_TIMEOUT_THRESH |
  7669. * |-------------------------------------------------------------|
  7670. */
  7671. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7672. A_UINT32 msg_type:8,
  7673. pdev_id:8,
  7674. reserved0:16;
  7675. /**
  7676. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7677. * [17:0]
  7678. */
  7679. union {
  7680. /*
  7681. * fisa_control_bits structure is deprecated.
  7682. * Please use fisa_control_bits_v2 going forward.
  7683. */
  7684. struct {
  7685. A_UINT32 fisa_enable: 1,
  7686. ipsec_skip_search: 1,
  7687. nontcp_skip_search: 1,
  7688. add_ipv4_fixed_hdr_len: 1,
  7689. add_ipv6_fixed_hdr_len: 1,
  7690. add_tcp_fixed_hdr_len: 1,
  7691. add_udp_hdr_len: 1,
  7692. chksum_cum_ip_len_en: 1,
  7693. disable_tid_check: 1,
  7694. disable_ta_check: 1,
  7695. disable_qos_check: 1,
  7696. disable_raw_check: 1,
  7697. disable_decrypt_err_check: 1,
  7698. disable_msdu_drop_check: 1,
  7699. fisa_aggr_limit: 4,
  7700. reserved: 14;
  7701. } fisa_control_bits;
  7702. struct {
  7703. A_UINT32 fisa_enable: 1,
  7704. fisa_aggr_limit: 4,
  7705. reserved: 27;
  7706. } fisa_control_bits_v2;
  7707. A_UINT32 fisa_control_value;
  7708. } u_fisa_control;
  7709. /**
  7710. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7711. * timeout threshold for aggregation. Unit in usec.
  7712. * [31:0]
  7713. */
  7714. A_UINT32 fisa_timeout_threshold;
  7715. } POSTPACK;
  7716. /* DWord 0: pdev-ID */
  7717. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7718. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7719. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7720. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7721. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7722. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7725. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7726. } while (0)
  7727. /* Dword 1: fisa_control_value fisa config */
  7728. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7729. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7730. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7731. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7732. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7733. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7736. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7737. } while (0)
  7738. /* Dword 1: fisa_control_value ipsec_skip_search */
  7739. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7740. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7741. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7742. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7743. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7744. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7745. do { \
  7746. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7747. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7748. } while (0)
  7749. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7750. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7751. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7752. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7753. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7754. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7755. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7756. do { \
  7757. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7758. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7759. } while (0)
  7760. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7761. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7762. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7763. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7764. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7765. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7766. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7767. do { \
  7768. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7769. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7770. } while (0)
  7771. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7772. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7773. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7774. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7775. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7776. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7777. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7778. do { \
  7779. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7780. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7781. } while (0)
  7782. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7783. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7784. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7785. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7786. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7787. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7788. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7791. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7792. } while (0)
  7793. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7794. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7795. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7796. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7797. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7798. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7799. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7800. do { \
  7801. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7802. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7803. } while (0)
  7804. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7805. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7806. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7807. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7808. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7809. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7810. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7811. do { \
  7812. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7813. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7814. } while (0)
  7815. /* Dword 1: fisa_control_value disable_tid_check */
  7816. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7817. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7818. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7819. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7820. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7821. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7822. do { \
  7823. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7824. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7825. } while (0)
  7826. /* Dword 1: fisa_control_value disable_ta_check */
  7827. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7828. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7829. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7830. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7831. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7832. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7833. do { \
  7834. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7835. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7836. } while (0)
  7837. /* Dword 1: fisa_control_value disable_qos_check */
  7838. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7840. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7841. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7842. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7843. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7844. do { \
  7845. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7846. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7847. } while (0)
  7848. /* Dword 1: fisa_control_value disable_raw_check */
  7849. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7851. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7852. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7853. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7854. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7855. do { \
  7856. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7857. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7858. } while (0)
  7859. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7860. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7861. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7862. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7863. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7864. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7865. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7866. do { \
  7867. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7868. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7869. } while (0)
  7870. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7871. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7872. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7873. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7874. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7875. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7876. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7877. do { \
  7878. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7879. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7880. } while (0)
  7881. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7882. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7883. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7884. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7885. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7886. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7887. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7890. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7891. } while (0)
  7892. /* Dword 1: fisa_control_value fisa config */
  7893. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7894. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7895. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7896. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7897. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7898. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7899. do { \
  7900. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7901. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7902. } while (0)
  7903. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7904. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7905. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7906. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7907. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7908. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7909. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7910. do { \
  7911. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7912. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7913. } while (0)
  7914. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7915. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7916. pdev_id:8,
  7917. reserved0:16;
  7918. A_UINT32 num_records:20,
  7919. max_search:8,
  7920. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7921. reserved1:2;
  7922. A_UINT32 base_addr_lo;
  7923. A_UINT32 base_addr_hi;
  7924. A_UINT32 toeplitz31_0;
  7925. A_UINT32 toeplitz63_32;
  7926. A_UINT32 toeplitz95_64;
  7927. A_UINT32 toeplitz127_96;
  7928. A_UINT32 toeplitz159_128;
  7929. A_UINT32 toeplitz191_160;
  7930. A_UINT32 toeplitz223_192;
  7931. A_UINT32 toeplitz255_224;
  7932. A_UINT32 toeplitz287_256;
  7933. A_UINT32 toeplitz314_288:27,
  7934. reserved2:5;
  7935. } POSTPACK;
  7936. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7937. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7938. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7939. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7940. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7941. /* DWORD 0: Pdev ID */
  7942. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7943. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7944. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7945. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7946. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7947. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7948. do { \
  7949. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7950. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7951. } while (0)
  7952. /* DWORD 1:num of records */
  7953. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7954. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7955. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7956. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7957. HTT_RX_FSE_SETUP_NUM_REC_S)
  7958. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7959. do { \
  7960. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7961. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7962. } while (0)
  7963. /* DWORD 1:max_search */
  7964. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7965. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7966. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7967. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7968. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7969. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7972. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7973. } while (0)
  7974. /* DWORD 1:ip_da_sa prefix */
  7975. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7976. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7977. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7978. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7979. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7980. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7981. do { \
  7982. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7983. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7984. } while (0)
  7985. /* DWORD 2: Base Address LO */
  7986. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7987. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7988. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7989. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7990. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7991. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7992. do { \
  7993. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7994. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7995. } while (0)
  7996. /* DWORD 3: Base Address High */
  7997. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7998. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7999. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  8000. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  8001. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8002. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8003. do { \
  8004. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8005. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8006. } while (0)
  8007. /* DWORD 4-12: Hash Value */
  8008. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8009. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8010. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8011. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8012. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8013. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8014. do { \
  8015. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8016. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8017. } while (0)
  8018. /* DWORD 13: Hash Value 314:288 bits */
  8019. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8020. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8021. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8022. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8023. do { \
  8024. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8025. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8026. } while (0)
  8027. /**
  8028. * @brief Host-->target HTT RX FSE operation message
  8029. *
  8030. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8031. *
  8032. * @details
  8033. * The host will send this Flow Search Engine (FSE) operation message for
  8034. * every flow add/delete operation.
  8035. * The FSE operation includes FSE full cache invalidation or individual entry
  8036. * invalidation.
  8037. * This message can be sent per SOC or per PDEV which is differentiated
  8038. * by pdev id values.
  8039. *
  8040. * |31 16|15 8|7 1|0|
  8041. * |-------------------------------------------------------------|
  8042. * | reserved | pdev_id | MSG_TYPE |
  8043. * |-------------------------------------------------------------|
  8044. * | reserved | operation |I|
  8045. * |-------------------------------------------------------------|
  8046. * | ip_src_addr_31_0 |
  8047. * |-------------------------------------------------------------|
  8048. * | ip_src_addr_63_32 |
  8049. * |-------------------------------------------------------------|
  8050. * | ip_src_addr_95_64 |
  8051. * |-------------------------------------------------------------|
  8052. * | ip_src_addr_127_96 |
  8053. * |-------------------------------------------------------------|
  8054. * | ip_dst_addr_31_0 |
  8055. * |-------------------------------------------------------------|
  8056. * | ip_dst_addr_63_32 |
  8057. * |-------------------------------------------------------------|
  8058. * | ip_dst_addr_95_64 |
  8059. * |-------------------------------------------------------------|
  8060. * | ip_dst_addr_127_96 |
  8061. * |-------------------------------------------------------------|
  8062. * | l4_dst_port | l4_src_port |
  8063. * | (32-bit SPI incase of IPsec) |
  8064. * |-------------------------------------------------------------|
  8065. * | reserved | l4_proto |
  8066. * |-------------------------------------------------------------|
  8067. *
  8068. * where I is 1-bit ipsec_valid.
  8069. *
  8070. * The following field definitions describe the format of the RX FSE operation
  8071. * message sent from the host to target for every add/delete flow entry to flow
  8072. * table.
  8073. *
  8074. * Header fields:
  8075. * dword0 - b'7:0 - msg_type: This will be set to
  8076. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8077. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8078. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8079. * specified pdev's LMAC ring.
  8080. * b'31:16 - reserved : Reserved for future use
  8081. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8082. * (Internet Protocol Security).
  8083. * IPsec describes the framework for providing security at
  8084. * IP layer. IPsec is defined for both versions of IP:
  8085. * IPV4 and IPV6.
  8086. * Please refer to htt_rx_flow_proto enumeration below for
  8087. * more info.
  8088. * ipsec_valid = 1 for IPSEC packets
  8089. * ipsec_valid = 0 for IP Packets
  8090. * b'7:1 - operation: This indicates types of FSE operation.
  8091. * Refer to htt_rx_fse_operation enumeration:
  8092. * 0 - No Cache Invalidation required
  8093. * 1 - Cache invalidate only one entry given by IP
  8094. * src/dest address at DWORD[2:9]
  8095. * 2 - Complete FSE Cache Invalidation
  8096. * 3 - FSE Disable
  8097. * 4 - FSE Enable
  8098. * b'31:8 - reserved: Reserved for future use
  8099. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8100. * for per flow addition/deletion
  8101. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8102. * and the subsequent 3 A_UINT32 will be padding bytes.
  8103. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8104. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8105. * from 0 to 65535 but only 0 to 1023 are designated as
  8106. * well-known ports. Refer to [RFC1700] for more details.
  8107. * This field is valid only if
  8108. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8109. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8110. * range from 0 to 65535 but only 0 to 1023 are designated
  8111. * as well-known ports. Refer to [RFC1700] for more details.
  8112. * This field is valid only if
  8113. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8114. * - SPI (31:0): Security Parameters Index is an
  8115. * identification tag added to the header while using IPsec
  8116. * for tunneling the IP traffici.
  8117. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8118. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8119. * Assigned Internet Protocol Numbers.
  8120. * l4_proto numbers for standard protocol like UDP/TCP
  8121. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8122. * l4_proto = 17 for UDP etc.
  8123. * b'31:8 - reserved: Reserved for future use.
  8124. *
  8125. */
  8126. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8127. A_UINT32 msg_type:8,
  8128. pdev_id:8,
  8129. reserved0:16;
  8130. A_UINT32 ipsec_valid:1,
  8131. operation:7,
  8132. reserved1:24;
  8133. A_UINT32 ip_src_addr_31_0;
  8134. A_UINT32 ip_src_addr_63_32;
  8135. A_UINT32 ip_src_addr_95_64;
  8136. A_UINT32 ip_src_addr_127_96;
  8137. A_UINT32 ip_dest_addr_31_0;
  8138. A_UINT32 ip_dest_addr_63_32;
  8139. A_UINT32 ip_dest_addr_95_64;
  8140. A_UINT32 ip_dest_addr_127_96;
  8141. union {
  8142. A_UINT32 spi;
  8143. struct {
  8144. A_UINT32 l4_src_port:16,
  8145. l4_dest_port:16;
  8146. } ip;
  8147. } u;
  8148. A_UINT32 l4_proto:8,
  8149. reserved:24;
  8150. } POSTPACK;
  8151. /**
  8152. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8153. *
  8154. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8155. *
  8156. * @details
  8157. * The host will send this Full monitor mode register configuration message.
  8158. * This message can be sent per SOC or per PDEV which is differentiated
  8159. * by pdev id values.
  8160. *
  8161. * |31 16|15 11|10 8|7 3|2|1|0|
  8162. * |-------------------------------------------------------------|
  8163. * | reserved | pdev_id | MSG_TYPE |
  8164. * |-------------------------------------------------------------|
  8165. * | reserved |Release Ring |N|Z|E|
  8166. * |-------------------------------------------------------------|
  8167. *
  8168. * where E is 1-bit full monitor mode enable/disable.
  8169. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8170. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8171. *
  8172. * The following field definitions describe the format of the full monitor
  8173. * mode configuration message sent from the host to target for each pdev.
  8174. *
  8175. * Header fields:
  8176. * dword0 - b'7:0 - msg_type: This will be set to
  8177. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8178. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8179. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8180. * specified pdev's LMAC ring.
  8181. * b'31:16 - reserved : Reserved for future use.
  8182. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8183. * monitor mode rxdma register is to be enabled or disabled.
  8184. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8185. * additional descriptors at ppdu end for zero mpdus
  8186. * enabled or disabled.
  8187. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8188. * additional descriptors at ppdu end for non zero mpdus
  8189. * enabled or disabled.
  8190. * b'10:3 - release_ring: This indicates the destination ring
  8191. * selection for the descriptor at the end of PPDU
  8192. * 0 - REO ring select
  8193. * 1 - FW ring select
  8194. * 2 - SW ring select
  8195. * 3 - Release ring select
  8196. * Refer to htt_rx_full_mon_release_ring.
  8197. * b'31:11 - reserved for future use
  8198. */
  8199. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8200. A_UINT32 msg_type:8,
  8201. pdev_id:8,
  8202. reserved0:16;
  8203. A_UINT32 full_monitor_mode_enable:1,
  8204. addnl_descs_zero_mpdus_end:1,
  8205. addnl_descs_non_zero_mpdus_end:1,
  8206. release_ring:8,
  8207. reserved1:21;
  8208. } POSTPACK;
  8209. /**
  8210. * Enumeration for full monitor mode destination ring select
  8211. * 0 - REO destination ring select
  8212. * 1 - FW destination ring select
  8213. * 2 - SW destination ring select
  8214. * 3 - Release destination ring select
  8215. */
  8216. enum htt_rx_full_mon_release_ring {
  8217. HTT_RX_MON_RING_REO,
  8218. HTT_RX_MON_RING_FW,
  8219. HTT_RX_MON_RING_SW,
  8220. HTT_RX_MON_RING_RELEASE,
  8221. };
  8222. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8223. /* DWORD 0: Pdev ID */
  8224. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8225. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8226. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8227. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8228. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8229. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8230. do { \
  8231. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8232. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8233. } while (0)
  8234. /* DWORD 1:ENABLE */
  8235. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8236. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8237. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8240. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8241. } while (0)
  8242. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8243. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8244. /* DWORD 1:ZERO_MPDU */
  8245. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8246. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8247. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8248. do { \
  8249. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8250. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8251. } while (0)
  8252. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8253. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8254. /* DWORD 1:NON_ZERO_MPDU */
  8255. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8256. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8257. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8258. do { \
  8259. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8260. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8261. } while (0)
  8262. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8263. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8264. /* DWORD 1:RELEASE_RINGS */
  8265. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8266. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8267. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8268. do { \
  8269. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8270. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8271. } while (0)
  8272. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8273. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8274. /**
  8275. * Enumeration for IP Protocol or IPSEC Protocol
  8276. * IPsec describes the framework for providing security at IP layer.
  8277. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8278. */
  8279. enum htt_rx_flow_proto {
  8280. HTT_RX_FLOW_IP_PROTO,
  8281. HTT_RX_FLOW_IPSEC_PROTO,
  8282. };
  8283. /**
  8284. * Enumeration for FSE Cache Invalidation
  8285. * 0 - No Cache Invalidation required
  8286. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8287. * 2 - Complete FSE Cache Invalidation
  8288. * 3 - FSE Disable
  8289. * 4 - FSE Enable
  8290. */
  8291. enum htt_rx_fse_operation {
  8292. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8293. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8294. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8295. HTT_RX_FSE_DISABLE,
  8296. HTT_RX_FSE_ENABLE,
  8297. };
  8298. /* DWORD 0: Pdev ID */
  8299. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8300. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8301. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8302. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8303. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8304. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8305. do { \
  8306. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8307. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8308. } while (0)
  8309. /* DWORD 1:IP PROTO or IPSEC */
  8310. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8311. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8312. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8313. do { \
  8314. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8315. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8316. } while (0)
  8317. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8318. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8319. /* DWORD 1:FSE Operation */
  8320. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8321. #define HTT_RX_FSE_OPERATION_S 1
  8322. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8325. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8326. } while (0)
  8327. #define HTT_RX_FSE_OPERATION_GET(word) \
  8328. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8329. /* DWORD 2-9:IP Address */
  8330. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8331. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8332. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8333. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8334. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8335. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8338. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8339. } while (0)
  8340. /* DWORD 10:Source Port Number */
  8341. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8342. #define HTT_RX_FSE_SOURCEPORT_S 0
  8343. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8344. do { \
  8345. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8346. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8347. } while (0)
  8348. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8349. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8350. /* DWORD 11:Destination Port Number */
  8351. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8352. #define HTT_RX_FSE_DESTPORT_S 16
  8353. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8356. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8357. } while (0)
  8358. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8359. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8360. /* DWORD 10-11:SPI (In case of IPSEC) */
  8361. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8362. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8363. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8364. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8365. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8366. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8367. do { \
  8368. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8369. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8370. } while (0)
  8371. /* DWORD 12:L4 PROTO */
  8372. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8373. #define HTT_RX_FSE_L4_PROTO_S 0
  8374. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8375. do { \
  8376. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8377. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8378. } while (0)
  8379. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8380. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8381. /**
  8382. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8383. *
  8384. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8385. *
  8386. * |31 24|23 |15 8|7 2|1|0|
  8387. * |----------------+----------------+----------------+----------------|
  8388. * | reserved | pdev_id | msg_type |
  8389. * |---------------------------------+----------------+----------------|
  8390. * | reserved |E|F|
  8391. * |---------------------------------+----------------+----------------|
  8392. * Where E = Configure the target to provide the 3-tuple hash value in
  8393. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8394. * F = Configure the target to provide the 3-tuple hash value in
  8395. * flow_id_toeplitz field of rx_msdu_start tlv
  8396. *
  8397. * The following field definitions describe the format of the 3 tuple hash value
  8398. * message sent from the host to target as part of initialization sequence.
  8399. *
  8400. * Header fields:
  8401. * dword0 - b'7:0 - msg_type: This will be set to
  8402. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8403. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8404. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8405. * specified pdev's LMAC ring.
  8406. * b'31:16 - reserved : Reserved for future use
  8407. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8408. * b'1 - toeplitz_hash_2_or_4_field_enable
  8409. * b'31:2 - reserved : Reserved for future use
  8410. * ---------+------+----------------------------------------------------------
  8411. * bit1 | bit0 | Functionality
  8412. * ---------+------+----------------------------------------------------------
  8413. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8414. * | | in flow_id_toeplitz field
  8415. * ---------+------+----------------------------------------------------------
  8416. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8417. * | | in toeplitz_hash_2_or_4 field
  8418. * ---------+------+----------------------------------------------------------
  8419. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8420. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8421. * ---------+------+----------------------------------------------------------
  8422. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8423. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8424. * | | toeplitz_hash_2_or_4 field
  8425. *----------------------------------------------------------------------------
  8426. */
  8427. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8428. A_UINT32 msg_type :8,
  8429. pdev_id :8,
  8430. reserved0 :16;
  8431. A_UINT32 flow_id_toeplitz_field_enable :1,
  8432. toeplitz_hash_2_or_4_field_enable :1,
  8433. reserved1 :30;
  8434. } POSTPACK;
  8435. /* DWORD0 : pdev_id configuration Macros */
  8436. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8437. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8438. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8439. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8440. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8441. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8444. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8445. } while (0)
  8446. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8447. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8448. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8449. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8450. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8451. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8452. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8453. do { \
  8454. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8455. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8456. } while (0)
  8457. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8458. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8459. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8460. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8461. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8462. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8463. do { \
  8464. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8465. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8466. } while (0)
  8467. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8468. /**
  8469. * @brief host --> target Host PA Address Size
  8470. *
  8471. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8472. *
  8473. * @details
  8474. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8475. * provide the physical start address and size of each of the memory
  8476. * areas within host DDR that the target FW may need to access.
  8477. *
  8478. * For example, the host can use this message to allow the target FW
  8479. * to set up access to the host's pools of TQM link descriptors.
  8480. * The message would appear as follows:
  8481. *
  8482. * |31 24|23 16|15 8|7 0|
  8483. * |----------------+----------------+----------------+----------------|
  8484. * | reserved | num_entries | msg_type |
  8485. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8486. * | mem area 0 size |
  8487. * |----------------+----------------+----------------+----------------|
  8488. * | mem area 0 physical_address_lo |
  8489. * |----------------+----------------+----------------+----------------|
  8490. * | mem area 0 physical_address_hi |
  8491. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8492. * | mem area 1 size |
  8493. * |----------------+----------------+----------------+----------------|
  8494. * | mem area 1 physical_address_lo |
  8495. * |----------------+----------------+----------------+----------------|
  8496. * | mem area 1 physical_address_hi |
  8497. * |----------------+----------------+----------------+----------------|
  8498. * ...
  8499. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8500. * | mem area N size |
  8501. * |----------------+----------------+----------------+----------------|
  8502. * | mem area N physical_address_lo |
  8503. * |----------------+----------------+----------------+----------------|
  8504. * | mem area N physical_address_hi |
  8505. * |----------------+----------------+----------------+----------------|
  8506. *
  8507. * The message is interpreted as follows:
  8508. * dword0 - b'0:7 - msg_type: This will be set to
  8509. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8510. * b'8:15 - number_entries: Indicated the number of host memory
  8511. * areas specified within the remainder of the message
  8512. * b'16:31 - reserved.
  8513. * dword1 - b'0:31 - memory area 0 size in bytes
  8514. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8515. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8516. * and similar for memory area 1 through memory area N.
  8517. */
  8518. PREPACK struct htt_h2t_host_paddr_size {
  8519. A_UINT32 msg_type: 8,
  8520. num_entries: 8,
  8521. reserved: 16;
  8522. } POSTPACK;
  8523. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8524. A_UINT32 size;
  8525. A_UINT32 physical_address_lo;
  8526. A_UINT32 physical_address_hi;
  8527. } POSTPACK;
  8528. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8529. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8530. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8531. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8532. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8533. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8534. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8535. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8536. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8537. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8538. do { \
  8539. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8540. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8541. } while (0)
  8542. /**
  8543. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8544. *
  8545. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8546. *
  8547. * @details
  8548. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8549. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8550. *
  8551. * The message would appear as follows:
  8552. *
  8553. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8554. * |---------------------------------+---+---+----------+-+-----------|
  8555. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8556. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8557. *
  8558. *
  8559. * The message is interpreted as follows:
  8560. * dword0 - b'0:7 - msg_type: This will be set to
  8561. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8562. * b'8 - override bit to drive MSDUs to PPE ring
  8563. * b'9:13 - REO destination ring indication
  8564. * b'14 - Multi buffer msdu override enable bit
  8565. * b'15 - Intra BSS override
  8566. * b'16 - Decap raw override
  8567. * b'17 - Decap Native wifi override
  8568. * b'18 - IP frag override
  8569. * b'19:31 - reserved
  8570. */
  8571. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8572. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8573. override: 1,
  8574. reo_destination_indication: 5,
  8575. multi_buffer_msdu_override_en: 1,
  8576. intra_bss_override: 1,
  8577. decap_raw_override: 1,
  8578. decap_nwifi_override: 1,
  8579. ip_frag_override: 1,
  8580. reserved: 13;
  8581. } POSTPACK;
  8582. /* DWORD 0: Override */
  8583. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8584. #define HTT_PPE_CFG_OVERRIDE_S 8
  8585. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8586. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8587. HTT_PPE_CFG_OVERRIDE_S)
  8588. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8589. do { \
  8590. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8591. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8592. } while (0)
  8593. /* DWORD 0: REO Destination Indication*/
  8594. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8595. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8596. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8597. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8598. HTT_PPE_CFG_REO_DEST_IND_S)
  8599. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8602. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8603. } while (0)
  8604. /* DWORD 0: Multi buffer MSDU override */
  8605. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8606. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8607. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8608. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8609. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8610. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8613. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8614. } while (0)
  8615. /* DWORD 0: Intra BSS override */
  8616. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8617. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8618. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8619. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8620. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8621. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8624. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8625. } while (0)
  8626. /* DWORD 0: Decap RAW override */
  8627. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8628. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8629. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8630. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8631. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8632. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8635. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8636. } while (0)
  8637. /* DWORD 0: Decap NWIFI override */
  8638. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8639. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8640. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8641. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8642. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8643. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8644. do { \
  8645. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8646. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8647. } while (0)
  8648. /* DWORD 0: IP frag override */
  8649. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8650. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8651. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8652. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8653. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8654. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8655. do { \
  8656. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8657. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8658. } while (0)
  8659. /*
  8660. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8661. *
  8662. * @details
  8663. * The following field definitions describe the format of the HTT host
  8664. * to target FW VDEV TX RX stats retrieve message.
  8665. * The message specifies the type of stats the host wants to retrieve.
  8666. *
  8667. * |31 27|26 25|24 17|16|15 8|7 0|
  8668. * |-----------------------------------------------------------|
  8669. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8670. * |-----------------------------------------------------------|
  8671. * | vdev_id lower bitmask |
  8672. * |-----------------------------------------------------------|
  8673. * | vdev_id upper bitmask |
  8674. * |-----------------------------------------------------------|
  8675. * Header fields:
  8676. * Where:
  8677. * dword0 - b'7:0 - msg_type: This will be set to
  8678. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8679. * b'15:8 - pdev id
  8680. * b'16(E) - Enable/Disable the vdev HW stats
  8681. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8682. * b'25:26(R) - Reset stats bits
  8683. * 0: don't reset stats
  8684. * 1: reset stats once
  8685. * 2: reset stats at the start of each periodic interval
  8686. * b'27:31 - reserved for future use
  8687. * dword1 - b'0:31 - vdev_id lower bitmask
  8688. * dword2 - b'0:31 - vdev_id upper bitmask
  8689. */
  8690. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8691. A_UINT32 msg_type :8,
  8692. pdev_id :8,
  8693. enable :1,
  8694. periodic_interval :8,
  8695. reset_stats_bits :2,
  8696. reserved0 :5;
  8697. A_UINT32 vdev_id_lower_bitmask;
  8698. A_UINT32 vdev_id_upper_bitmask;
  8699. } POSTPACK;
  8700. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8701. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8702. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8703. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8704. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8705. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8706. do { \
  8707. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8708. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8709. } while (0)
  8710. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8711. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8712. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8713. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8714. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8715. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8716. do { \
  8717. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8718. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8719. } while (0)
  8720. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8721. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8722. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8723. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8724. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8725. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8726. do { \
  8727. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8728. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8729. } while (0)
  8730. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8731. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8732. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8733. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8734. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8735. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8736. do { \
  8737. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8738. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8739. } while (0)
  8740. /*
  8741. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8742. *
  8743. * @details
  8744. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8745. * the default MSDU queues for one of the TIDs within the specified peer
  8746. * to the specified service class.
  8747. * The TID is indirectly specified - each service class is associated
  8748. * with a TID. All default MSDU queues for this peer-TID will be
  8749. * linked to the service class in question.
  8750. *
  8751. * |31 16|15 8|7 0|
  8752. * |------------------------------+--------------+--------------|
  8753. * | peer ID | svc class ID | msg type |
  8754. * |------------------------------------------------------------|
  8755. * Header fields:
  8756. * dword0 - b'7:0 - msg_type: This will be set to
  8757. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8758. * b'15:8 - service class ID
  8759. * b'31:16 - peer ID
  8760. */
  8761. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8762. A_UINT32 msg_type :8,
  8763. svc_class_id :8,
  8764. peer_id :16;
  8765. } POSTPACK;
  8766. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8767. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8768. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8769. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8770. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8771. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8772. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8773. do { \
  8774. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8775. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8776. } while (0)
  8777. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8778. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8779. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8780. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8781. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8782. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8783. do { \
  8784. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8785. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8786. } while (0)
  8787. /*
  8788. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8789. *
  8790. * @details
  8791. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8792. * remove the linkage of the specified peer-TID's MSDU queues to
  8793. * service classes.
  8794. *
  8795. * |31 16|15 8|7 0|
  8796. * |------------------------------+--------------+--------------|
  8797. * | peer ID | svc class ID | msg type |
  8798. * |------------------------------------------------------------|
  8799. * Header fields:
  8800. * dword0 - b'7:0 - msg_type: This will be set to
  8801. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8802. * b'15:8 - service class ID
  8803. * b'31:16 - peer ID
  8804. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8805. * value for peer ID indicates that the target should
  8806. * apply the UNMAP_REQ to all peers.
  8807. */
  8808. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8809. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8810. A_UINT32 msg_type :8,
  8811. svc_class_id :8,
  8812. peer_id :16;
  8813. } POSTPACK;
  8814. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8815. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8816. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8817. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8818. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8819. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8820. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8821. do { \
  8822. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8823. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8824. } while (0)
  8825. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8826. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8827. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8828. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8829. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8830. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8831. do { \
  8832. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8833. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8834. } while (0)
  8835. /*
  8836. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8837. *
  8838. * @details
  8839. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8840. * request the target to report what service class the default MSDU queues
  8841. * of the specified TIDs within the peer are linked to.
  8842. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8843. * to report what service class (if any) the default MSDU queues for
  8844. * each of the specified TIDs are linked to.
  8845. *
  8846. * |31 16|15 8|7 1| 0|
  8847. * |------------------------------+--------------+--------------|
  8848. * | peer ID | TID mask | msg type |
  8849. * |------------------------------------------------------------|
  8850. * | reserved |ETO|
  8851. * |------------------------------------------------------------|
  8852. * Header fields:
  8853. * dword0 - b'7:0 - msg_type: This will be set to
  8854. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8855. * b'15:8 - TID mask
  8856. * b'31:16 - peer ID
  8857. * dword1 - b'0 - "Existing Tids Only" flag
  8858. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8859. * message generated by this REQ will only show the
  8860. * mapping for TIDs that actually exist in the target's
  8861. * peer object.
  8862. * Any TIDs that are covered by a MAP_REQ but which
  8863. * do not actually exist will be shown as being
  8864. * unmapped (i.e. svc class ID 0xff).
  8865. * If this flag is cleared, the MAP_REPORT_CONF message
  8866. * will consider not only the mapping of TIDs currently
  8867. * existing in the peer, but also the mapping that will
  8868. * be applied for any TID objects created within this
  8869. * peer in the future.
  8870. * b'31:1 - reserved for future use
  8871. */
  8872. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8873. A_UINT32 msg_type :8,
  8874. tid_mask :8,
  8875. peer_id :16;
  8876. A_UINT32 existing_tids_only:1,
  8877. reserved :31;
  8878. } POSTPACK;
  8879. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8880. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8881. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8882. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8883. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8884. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8885. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8886. do { \
  8887. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8888. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8889. } while (0)
  8890. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8891. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8892. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8893. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8894. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8895. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8896. do { \
  8897. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8898. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8899. } while (0)
  8900. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8901. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8902. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8903. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8904. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8905. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8906. do { \
  8907. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8908. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8909. } while (0)
  8910. /**
  8911. * @brief Format of shared memory between Host and Target
  8912. * for UMAC hang recovery feature messaging.
  8913. * @details
  8914. * This is shared memory between Host and Target allocated
  8915. * and used in chips where UMAC hang recovery feature is supported.
  8916. * This shared memory is allocated per SOC level by Host since each
  8917. * SOC's target Q6FW needs to communicate independently to the Host
  8918. * through its own shared memory.
  8919. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8920. * then host interprets it as a new message from target.
  8921. * Host clears that particular read bit in t2h_msg after each read
  8922. * operation. It is vice versa for h2t_msg. At any given point
  8923. * of time there is expected to be only one bit set
  8924. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8925. *
  8926. * The message is interpreted as follows:
  8927. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8928. * added for debuggability purpose.
  8929. * dword1 - b'0 - do_pre_reset
  8930. * b'1 - do_post_reset_start
  8931. * b'2 - do_post_reset_complete
  8932. * b'3 - initiate_umac_recovery
  8933. * b'4:31 - rsvd_t2h
  8934. * dword2 - b'0 - pre_reset_done
  8935. * b'1 - post_reset_start_done
  8936. * b'2 - post_reset_complete_done
  8937. * b'3 - start_pre_reset
  8938. * b'4:31 - rsvd_h2t
  8939. */
  8940. PREPACK typedef struct {
  8941. /** Magic number added for debuggability. */
  8942. A_UINT32 magic_num;
  8943. union {
  8944. /*
  8945. * BIT [0] :- T2H msg to do pre-reset
  8946. * BIT [1] :- T2H msg to do post-reset start
  8947. * BIT [2] :- T2H msg to do post-reset complete
  8948. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8949. * This is needed to synchronize UMAC recovery
  8950. * across all SOCs.
  8951. * BIT [31 : 4] :- reserved
  8952. */
  8953. A_UINT32 t2h_msg;
  8954. struct {
  8955. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8956. do_post_reset_start : 1, /* BIT [1] */
  8957. do_post_reset_complete : 1, /* BIT [2] */
  8958. initiate_umac_recovery : 1, /* BIT [3] */
  8959. rsvd_t2h : 28; /* BIT [31 : 4] */
  8960. };
  8961. };
  8962. union {
  8963. /*
  8964. * BIT [0] :- H2T msg to send pre-reset done
  8965. * BIT [1] :- H2T msg to send post-reset start done
  8966. * BIT [2] :- H2T msg to send post-reset complete done
  8967. * BIT [3] :- H2T msg to start pre-reset.
  8968. * This is expected only after T2H
  8969. * initiate_umac_recovery was received by Host
  8970. * from one of the SOCs.
  8971. * BIT [31 : 4] :- reserved
  8972. */
  8973. A_UINT32 h2t_msg;
  8974. struct {
  8975. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8976. post_reset_start_done : 1, /* BIT [1] */
  8977. post_reset_complete_done : 1, /* BIT [2] */
  8978. start_pre_reset : 1, /* BIT [3] */
  8979. rsvd_h2t : 28; /* BIT [31 : 4] */
  8980. };
  8981. };
  8982. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8983. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8984. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8985. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8986. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8987. /* dword1 - b'0 - do_pre_reset */
  8988. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8989. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8990. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8991. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8992. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8993. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8996. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8997. } while (0)
  8998. /* dword1 - b'1 - do_post_reset_start */
  8999. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  9000. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  9001. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9002. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9003. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9004. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9005. do { \
  9006. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9007. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9008. } while (0)
  9009. /* dword1 - b'2 - do_post_reset_complete */
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9012. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9013. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9014. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9015. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9016. do { \
  9017. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9018. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9019. } while (0)
  9020. /* dword1 - b'3 - initiate_umac_recovery */
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9023. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9024. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9025. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9026. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9029. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9030. } while (0)
  9031. /* dword2 - b'0 - pre_reset_done */
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9034. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9035. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9036. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9037. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9038. do { \
  9039. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9040. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9041. } while (0)
  9042. /* dword2 - b'1 - post_reset_start_done */
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9045. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9046. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9047. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9048. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9049. do { \
  9050. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9051. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9052. } while (0)
  9053. /* dword2 - b'2 - post_reset_complete_done */
  9054. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9055. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9056. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9057. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9058. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9059. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9060. do { \
  9061. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9062. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9063. } while (0)
  9064. /* dword2 - b'3 - start_pre_reset */
  9065. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9066. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9067. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9068. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9069. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9070. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9073. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9074. } while (0)
  9075. /**
  9076. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9077. *
  9078. * @details
  9079. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9080. * by the host to provide prerequisite info to target for the UMAC hang
  9081. * recovery feature.
  9082. * The info sent in this H2T message are T2H message method, H2T message
  9083. * method, T2H MSI interrupt number and physical start address, size of
  9084. * the shared memory (refers to the shared memory dedicated for messaging
  9085. * between host and target when the DUT is in UMAC hang recovery mode).
  9086. * This H2T message is expected to be only sent if the WMI service bit
  9087. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9088. *
  9089. * |31 16|15 12|11 8|7 0|
  9090. * |-------------------------------+--------------+--------------+------------|
  9091. * | reserved |h2t msg method|t2h msg method| msg_type |
  9092. * |--------------------------------------------------------------------------|
  9093. * | t2h msi interrupt number |
  9094. * |--------------------------------------------------------------------------|
  9095. * | shared memory area size |
  9096. * |--------------------------------------------------------------------------|
  9097. * | shared memory area physical address low |
  9098. * |--------------------------------------------------------------------------|
  9099. * | shared memory area physical address high |
  9100. * |--------------------------------------------------------------------------|
  9101. *
  9102. * The message is interpreted as follows:
  9103. * dword0 - b'0:7 - msg_type
  9104. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9105. * b'8:11 - t2h_msg_method: indicates method to be used for
  9106. * T2H communication in UMAC hang recovery mode.
  9107. * Value zero indicates MSI interrupt (default method).
  9108. * Refer to htt_umac_hang_recovery_msg_method enum.
  9109. * b'12:15 - h2t_msg_method: indicates method to be used for
  9110. * H2T communication in UMAC hang recovery mode.
  9111. * Value zero indicates polling by target for this h2t msg
  9112. * during UMAC hang recovery mode.
  9113. * Refer to htt_umac_hang_recovery_msg_method enum.
  9114. * b'16:31 - reserved.
  9115. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9116. * T2H communication in UMAC hang recovery mode.
  9117. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9118. * only when in UMAC hang recovery mode.
  9119. * This refers to size in bytes.
  9120. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9121. * of the shared memory dedicated for messaging only when
  9122. * in UMAC hang recovery mode.
  9123. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9124. * of the shared memory dedicated for messaging only when
  9125. * in UMAC hang recovery mode.
  9126. */
  9127. /* t2h_msg_method and h2t_msg_method */
  9128. enum htt_umac_hang_recovery_msg_method {
  9129. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9130. };
  9131. PREPACK typedef struct {
  9132. A_UINT32 msg_type : 8,
  9133. t2h_msg_method : 4,
  9134. h2t_msg_method : 4,
  9135. reserved : 16;
  9136. A_UINT32 t2h_msi_data;
  9137. /* size bytes and physical address of shared memory. */
  9138. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9139. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9140. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9141. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9142. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9143. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9144. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9145. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9146. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9147. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9148. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9149. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9150. do { \
  9151. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9152. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9153. } while (0)
  9154. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9155. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9156. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9157. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9158. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9159. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9160. do { \
  9161. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9162. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9163. } while (0)
  9164. /**
  9165. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9166. *
  9167. * @details
  9168. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9169. * HTT message sent by the host to indicate that the target needs to start the
  9170. * UMAC hang recovery feature from the point of pre-reset routine.
  9171. * The purpose of this H2T message is to have host synchronize and trigger
  9172. * UMAC recovery across all targets.
  9173. * The info sent in this H2T message is the flag to indicate whether the
  9174. * target needs to execute UMAC-recovery in context of the Initiator or
  9175. * Non-Initiator.
  9176. * This H2T message is expected to be sent as response to the
  9177. * initiate_umac_recovery indication from the Initiator target attached to
  9178. * this same host.
  9179. * This H2T message is expected to be only sent if the WMI service bit
  9180. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9181. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9182. * beforehand.
  9183. *
  9184. * |31 9|8|7 0|
  9185. * |-----------------------------------------------------------|
  9186. * | reserved |I| msg_type |
  9187. * |-----------------------------------------------------------|
  9188. * Where:
  9189. * I = is_initiator
  9190. *
  9191. * The message is interpreted as follows:
  9192. * dword0 - b'0:7 - msg_type
  9193. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9194. * b'8 - is_initiator: indicates whether the target needs to
  9195. * execute the UMAC-recovery in context of the Initiator or
  9196. * Non-Initiator.
  9197. * The value zero indicates this target is Non-Initiator.
  9198. * b'9:31 - reserved.
  9199. */
  9200. PREPACK typedef struct {
  9201. A_UINT32 msg_type : 8,
  9202. is_initiator : 1,
  9203. reserved : 23;
  9204. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9205. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9206. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9207. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9208. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9209. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9210. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9211. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9212. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9213. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9214. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9217. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9218. } while (0)
  9219. /*
  9220. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9221. *
  9222. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9223. *
  9224. * @details
  9225. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9226. * install or uninstall rx cce super rules to match certain kind of packets
  9227. * with specific parameters. Target sets up HW registers based on setup message
  9228. * and always confirms back to Host.
  9229. *
  9230. * The message would appear as follows:
  9231. * |31 24|23 16|15 8|7 0|
  9232. * |-----------------+-----------------+-----------------+-----------------|
  9233. * | reserved | operation | vdev_id | msg_type |
  9234. * |-----------------------------------------------------------------------|
  9235. * | cce_super_rule_param[0] |
  9236. * |-----------------------------------------------------------------------|
  9237. * | cce_super_rule_param[1] |
  9238. * |-----------------------------------------------------------------------|
  9239. *
  9240. * The message is interpreted as follows:
  9241. * dword0 - b'0:7 - msg_type: This will be set to
  9242. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9243. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9244. * b'16:23 - operation: Identify operation to be taken,
  9245. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9246. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9247. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9248. * b'24:31 - reserved
  9249. * dword1~10 - cce_super_rule_param[0]:
  9250. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9251. * dword11~20 - cce_super_rule_param[1]:
  9252. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9253. *
  9254. * Each cce_super_rule_param structure would appear as follows:
  9255. * |31 24|23 16|15 8|7 0|
  9256. * |-----------------+-----------------+-----------------+-----------------|
  9257. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9258. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9259. * |-----------------------------------------------------------------------|
  9260. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9261. * |-----------------------------------------------------------------------|
  9262. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9263. * |-----------------------------------------------------------------------|
  9264. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9265. * |-----------------------------------------------------------------------|
  9266. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9267. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9268. * |-----------------------------------------------------------------------|
  9269. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9270. * |-----------------------------------------------------------------------|
  9271. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9272. * |-----------------------------------------------------------------------|
  9273. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9274. * |-----------------------------------------------------------------------|
  9275. * | is_valid | l4_type | l3_type |
  9276. * |-----------------------------------------------------------------------|
  9277. * | l4_dst_port | l4_src_port |
  9278. * |-----------------------------------------------------------------------|
  9279. *
  9280. * The cce_super_rule_param[0] structure is interpreted as follows:
  9281. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9282. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9283. * in case of ipv4)
  9284. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9285. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9286. * in case of ipv4)
  9287. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9288. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9289. * in case of ipv4)
  9290. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9291. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9292. * in case of ipv4)
  9293. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9294. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9295. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9296. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9297. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9298. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9299. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9300. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9301. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9302. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9303. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9304. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9305. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9306. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9307. * ipv4 address, in case of ipv4)
  9308. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9309. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9310. * ipv4 address, in case of ipv4)
  9311. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9312. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9313. * ipv4 address, in case of ipv4)
  9314. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9315. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9316. * ipv4 address, in case of ipv4)
  9317. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9318. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9319. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9320. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9321. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9322. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9323. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9324. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9325. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9326. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9327. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9328. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9329. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9330. * 0x0008: ipv4
  9331. * 0xdd86: ipv6
  9332. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9333. * 6: TCP
  9334. * 17: UDP
  9335. * b'24:31 - is_valid: indicate whether this parameter is valid
  9336. * 0: invalid
  9337. * 1: valid
  9338. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9339. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9340. *
  9341. * The cce_super_rule_param[1] structure is similar.
  9342. */
  9343. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9344. enum htt_rx_cce_super_rule_setup_operation {
  9345. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9346. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9347. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9348. /* All operation should be before this */
  9349. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9350. };
  9351. typedef struct {
  9352. union {
  9353. A_UINT8 src_ipv4_addr[4];
  9354. A_UINT8 src_ipv6_addr[16];
  9355. };
  9356. union {
  9357. A_UINT8 dst_ipv4_addr[4];
  9358. A_UINT8 dst_ipv6_addr[16];
  9359. };
  9360. A_UINT32 l3_type: 16,
  9361. l4_type: 8,
  9362. is_valid: 8;
  9363. A_UINT32 l4_src_port: 16,
  9364. l4_dst_port: 16;
  9365. } htt_rx_cce_super_rule_param_t;
  9366. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9367. A_UINT32 msg_type: 8,
  9368. vdev_id: 8,
  9369. operation: 8,
  9370. reserved: 8;
  9371. htt_rx_cce_super_rule_param_t
  9372. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9373. } POSTPACK;
  9374. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9375. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9376. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9377. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9378. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9379. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9380. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9381. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9382. do { \
  9383. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9384. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9385. } while (0)
  9386. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9387. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9388. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9389. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9390. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9391. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9392. do { \
  9393. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9394. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9395. } while (0)
  9396. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9397. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9398. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9399. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9400. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9401. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9402. do { \
  9403. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9404. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9405. } while (0)
  9406. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9407. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9408. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9409. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9410. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9411. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9412. do { \
  9413. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9414. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9415. } while (0)
  9416. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9417. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9418. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9419. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9420. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9421. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9424. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9425. } while (0)
  9426. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9427. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9428. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9429. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9430. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9431. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9432. do { \
  9433. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9434. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9435. } while (0)
  9436. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9437. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9438. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9439. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9440. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9441. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9444. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9445. } while (0)
  9446. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9447. do { \
  9448. A_MEMCPY(_array, _ptr, 4); \
  9449. } while (0)
  9450. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9451. do { \
  9452. A_MEMCPY(_ptr, _array, 4); \
  9453. } while (0)
  9454. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9455. do { \
  9456. A_MEMCPY(_array, _ptr, 16); \
  9457. } while (0)
  9458. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9459. do { \
  9460. A_MEMCPY(_ptr, _array, 16); \
  9461. } while (0)
  9462. /*=== target -> host messages ===============================================*/
  9463. enum htt_t2h_msg_type {
  9464. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9465. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9466. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9467. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9468. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9469. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9470. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9471. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9472. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9473. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9474. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9475. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9476. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9477. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9478. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9479. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9480. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9481. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9482. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9483. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9484. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9485. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9486. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9487. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9488. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9489. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9490. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9491. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9492. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9493. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9494. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9495. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9496. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9497. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9498. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9499. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9500. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9501. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9502. /* TX_OFFLOAD_DELIVER_IND:
  9503. * Forward the target's locally-generated packets to the host,
  9504. * to provide to the monitor mode interface.
  9505. */
  9506. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9507. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9508. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9509. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9510. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9511. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9512. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9513. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9514. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9515. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9516. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9517. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9518. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9519. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9520. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9521. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9522. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9523. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9524. HTT_T2H_MSG_TYPE_RX_DATA_IND = 0x35,
  9525. HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND = 0x36,
  9526. HTT_T2H_MSG_TYPE_TEST,
  9527. /* keep this last */
  9528. HTT_T2H_NUM_MSGS
  9529. };
  9530. /*
  9531. * HTT target to host message type -
  9532. * stored in bits 7:0 of the first word of the message
  9533. */
  9534. #define HTT_T2H_MSG_TYPE_M 0xff
  9535. #define HTT_T2H_MSG_TYPE_S 0
  9536. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9537. do { \
  9538. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9539. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9540. } while (0)
  9541. #define HTT_T2H_MSG_TYPE_GET(word) \
  9542. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9543. /**
  9544. * @brief target -> host version number confirmation message definition
  9545. *
  9546. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9547. *
  9548. * |31 24|23 16|15 8|7 0|
  9549. * |----------------+----------------+----------------+----------------|
  9550. * | reserved | major number | minor number | msg type |
  9551. * |-------------------------------------------------------------------|
  9552. * : option request TLV (optional) |
  9553. * :...................................................................:
  9554. *
  9555. * The VER_CONF message may consist of a single 4-byte word, or may be
  9556. * extended with TLVs that specify HTT options selected by the target.
  9557. * The following option TLVs may be appended to the VER_CONF message:
  9558. * - LL_BUS_ADDR_SIZE
  9559. * - HL_SUPPRESS_TX_COMPL_IND
  9560. * - MAX_TX_QUEUE_GROUPS
  9561. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9562. * may be appended to the VER_CONF message (but only one TLV of each type).
  9563. *
  9564. * Header fields:
  9565. * - MSG_TYPE
  9566. * Bits 7:0
  9567. * Purpose: identifies this as a version number confirmation message
  9568. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9569. * - VER_MINOR
  9570. * Bits 15:8
  9571. * Purpose: Specify the minor number of the HTT message library version
  9572. * in use by the target firmware.
  9573. * The minor number specifies the specific revision within a range
  9574. * of fundamentally compatible HTT message definition revisions.
  9575. * Compatible revisions involve adding new messages or perhaps
  9576. * adding new fields to existing messages, in a backwards-compatible
  9577. * manner.
  9578. * Incompatible revisions involve changing the message type values,
  9579. * or redefining existing messages.
  9580. * Value: minor number
  9581. * - VER_MAJOR
  9582. * Bits 15:8
  9583. * Purpose: Specify the major number of the HTT message library version
  9584. * in use by the target firmware.
  9585. * The major number specifies the family of minor revisions that are
  9586. * fundamentally compatible with each other, but not with prior or
  9587. * later families.
  9588. * Value: major number
  9589. */
  9590. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9591. #define HTT_VER_CONF_MINOR_S 8
  9592. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9593. #define HTT_VER_CONF_MAJOR_S 16
  9594. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9597. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9598. } while (0)
  9599. #define HTT_VER_CONF_MINOR_GET(word) \
  9600. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9601. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9602. do { \
  9603. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9604. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9605. } while (0)
  9606. #define HTT_VER_CONF_MAJOR_GET(word) \
  9607. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9608. #define HTT_VER_CONF_BYTES 4
  9609. /**
  9610. * @brief - target -> host HTT Rx In order indication message
  9611. *
  9612. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9613. *
  9614. * @details
  9615. *
  9616. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9617. * |----------------+-------------------+---------------------+---------------|
  9618. * | peer ID | P| F| O| ext TID | msg type |
  9619. * |--------------------------------------------------------------------------|
  9620. * | MSDU count | Reserved | vdev id |
  9621. * |--------------------------------------------------------------------------|
  9622. * | MSDU 0 bus address (bits 31:0) |
  9623. #if HTT_PADDR64
  9624. * | MSDU 0 bus address (bits 63:32) |
  9625. #endif
  9626. * |--------------------------------------------------------------------------|
  9627. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9628. * |--------------------------------------------------------------------------|
  9629. * | MSDU 1 bus address (bits 31:0) |
  9630. #if HTT_PADDR64
  9631. * | MSDU 1 bus address (bits 63:32) |
  9632. #endif
  9633. * |--------------------------------------------------------------------------|
  9634. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9635. * |--------------------------------------------------------------------------|
  9636. */
  9637. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9638. *
  9639. * @details
  9640. * bits
  9641. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9642. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9643. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9644. * | | frag | | | | fail |chksum fail|
  9645. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9646. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9647. */
  9648. struct htt_rx_in_ord_paddr_ind_hdr_t
  9649. {
  9650. A_UINT32 /* word 0 */
  9651. msg_type: 8,
  9652. ext_tid: 5,
  9653. offload: 1,
  9654. frag: 1,
  9655. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9656. peer_id: 16;
  9657. A_UINT32 /* word 1 */
  9658. vap_id: 8,
  9659. /* NOTE:
  9660. * This reserved_1 field is not truly reserved - certain targets use
  9661. * this field internally to store debug information, and do not zero
  9662. * out the contents of the field before uploading the message to the
  9663. * host. Thus, any host-target communication supported by this field
  9664. * is limited to using values that are never used by the debug
  9665. * information stored by certain targets in the reserved_1 field.
  9666. * In particular, the targets in question don't use the value 0x3
  9667. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9668. * so this previously-unused value within these bits is available to
  9669. * use as the host / target PKT_CAPTURE_MODE flag.
  9670. */
  9671. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9672. /* if pkt_capture_mode == 0x3, host should
  9673. * send rx frames to monitor mode interface
  9674. */
  9675. msdu_cnt: 16;
  9676. };
  9677. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9678. {
  9679. A_UINT32 dma_addr;
  9680. A_UINT32
  9681. length: 16,
  9682. fw_desc: 8,
  9683. msdu_info:8;
  9684. };
  9685. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9686. {
  9687. A_UINT32 dma_addr_lo;
  9688. A_UINT32 dma_addr_hi;
  9689. A_UINT32
  9690. length: 16,
  9691. fw_desc: 8,
  9692. msdu_info:8;
  9693. };
  9694. #if HTT_PADDR64
  9695. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9696. #else
  9697. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9698. #endif
  9699. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9700. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9704. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9705. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9706. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9707. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9708. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9709. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9710. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9711. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9712. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9713. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9714. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9715. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9716. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9717. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9718. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9719. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9720. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9721. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9722. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9723. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9724. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9725. /* for systems using 64-bit format for bus addresses */
  9726. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9727. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9728. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9729. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9730. /* for systems using 32-bit format for bus addresses */
  9731. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9732. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9733. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9734. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9735. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9736. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9737. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9738. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9739. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9740. do { \
  9741. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9742. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9743. } while (0)
  9744. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9745. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9746. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9747. do { \
  9748. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9749. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9750. } while (0)
  9751. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9752. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9753. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9754. do { \
  9755. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9756. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9757. } while (0)
  9758. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9759. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9760. /*
  9761. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9762. * deliver the rx frames to the monitor mode interface.
  9763. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9764. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9765. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9766. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9767. */
  9768. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9769. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9770. do { \
  9771. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9772. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9773. } while (0)
  9774. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9775. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9776. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9777. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9778. do { \
  9779. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9780. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9781. } while (0)
  9782. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9783. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9784. /* for systems using 64-bit format for bus addresses */
  9785. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9786. do { \
  9787. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9788. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9789. } while (0)
  9790. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9791. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9792. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9793. do { \
  9794. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9795. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9796. } while (0)
  9797. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9798. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9799. /* for systems using 32-bit format for bus addresses */
  9800. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9803. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9804. } while (0)
  9805. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9806. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9807. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9808. do { \
  9809. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9810. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9811. } while (0)
  9812. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9813. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9814. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9815. do { \
  9816. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9817. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9818. } while (0)
  9819. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9820. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9821. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9822. do { \
  9823. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9824. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9825. } while (0)
  9826. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9827. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9828. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9829. do { \
  9830. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9831. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9832. } while (0)
  9833. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9834. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9835. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9836. do { \
  9837. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9838. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9839. } while (0)
  9840. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9841. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9842. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9843. do { \
  9844. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9845. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9846. } while (0)
  9847. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9848. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9849. /* definitions used within target -> host rx indication message */
  9850. PREPACK struct htt_rx_ind_hdr_prefix_t
  9851. {
  9852. A_UINT32 /* word 0 */
  9853. msg_type: 8,
  9854. ext_tid: 5,
  9855. release_valid: 1,
  9856. flush_valid: 1,
  9857. reserved0: 1,
  9858. peer_id: 16;
  9859. A_UINT32 /* word 1 */
  9860. flush_start_seq_num: 6,
  9861. flush_end_seq_num: 6,
  9862. release_start_seq_num: 6,
  9863. release_end_seq_num: 6,
  9864. num_mpdu_ranges: 8;
  9865. } POSTPACK;
  9866. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9867. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9868. #define HTT_TGT_RSSI_INVALID 0x80
  9869. PREPACK struct htt_rx_ppdu_desc_t
  9870. {
  9871. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9872. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9873. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9874. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9875. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9876. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9877. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9878. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9879. A_UINT32 /* word 0 */
  9880. rssi_cmb: 8,
  9881. timestamp_submicrosec: 8,
  9882. phy_err_code: 8,
  9883. phy_err: 1,
  9884. legacy_rate: 4,
  9885. legacy_rate_sel: 1,
  9886. end_valid: 1,
  9887. start_valid: 1;
  9888. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9889. union {
  9890. A_UINT32 /* word 1 */
  9891. rssi0_pri20: 8,
  9892. rssi0_ext20: 8,
  9893. rssi0_ext40: 8,
  9894. rssi0_ext80: 8;
  9895. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9896. } u0;
  9897. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9898. union {
  9899. A_UINT32 /* word 2 */
  9900. rssi1_pri20: 8,
  9901. rssi1_ext20: 8,
  9902. rssi1_ext40: 8,
  9903. rssi1_ext80: 8;
  9904. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9905. } u1;
  9906. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9907. union {
  9908. A_UINT32 /* word 3 */
  9909. rssi2_pri20: 8,
  9910. rssi2_ext20: 8,
  9911. rssi2_ext40: 8,
  9912. rssi2_ext80: 8;
  9913. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9914. } u2;
  9915. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9916. union {
  9917. A_UINT32 /* word 4 */
  9918. rssi3_pri20: 8,
  9919. rssi3_ext20: 8,
  9920. rssi3_ext40: 8,
  9921. rssi3_ext80: 8;
  9922. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9923. } u3;
  9924. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9925. A_UINT32 tsf32; /* word 5 */
  9926. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9927. A_UINT32 timestamp_microsec; /* word 6 */
  9928. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9929. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9930. A_UINT32 /* word 7 */
  9931. vht_sig_a1: 24,
  9932. preamble_type: 8;
  9933. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9934. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9935. A_UINT32 /* word 8 */
  9936. vht_sig_a2: 24,
  9937. /* sa_ant_matrix
  9938. * For cases where a single rx chain has options to be connected to
  9939. * different rx antennas, show which rx antennas were in use during
  9940. * receipt of a given PPDU.
  9941. * This sa_ant_matrix provides a bitmask of the antennas used while
  9942. * receiving this frame.
  9943. */
  9944. sa_ant_matrix: 8;
  9945. } POSTPACK;
  9946. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9947. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9948. PREPACK struct htt_rx_ind_hdr_suffix_t
  9949. {
  9950. A_UINT32 /* word 0 */
  9951. fw_rx_desc_bytes: 16,
  9952. reserved0: 16;
  9953. } POSTPACK;
  9954. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9955. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9956. PREPACK struct htt_rx_ind_hdr_t
  9957. {
  9958. struct htt_rx_ind_hdr_prefix_t prefix;
  9959. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9960. struct htt_rx_ind_hdr_suffix_t suffix;
  9961. } POSTPACK;
  9962. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9963. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9964. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9965. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9966. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9967. /*
  9968. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9969. * the offset into the HTT rx indication message at which the
  9970. * FW rx PPDU descriptor resides
  9971. */
  9972. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9973. /*
  9974. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9975. * the offset into the HTT rx indication message at which the
  9976. * header suffix (FW rx MSDU byte count) resides
  9977. */
  9978. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9979. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9980. /*
  9981. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9982. * the offset into the HTT rx indication message at which the per-MSDU
  9983. * information starts
  9984. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9985. * per-MSDU information portion of the message. The per-MSDU info itself
  9986. * starts at byte 12.
  9987. */
  9988. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9989. /**
  9990. * @brief target -> host rx indication message definition
  9991. *
  9992. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9993. *
  9994. * @details
  9995. * The following field definitions describe the format of the rx indication
  9996. * message sent from the target to the host.
  9997. * The message consists of three major sections:
  9998. * 1. a fixed-length header
  9999. * 2. a variable-length list of firmware rx MSDU descriptors
  10000. * 3. one or more 4-octet MPDU range information elements
  10001. * The fixed length header itself has two sub-sections
  10002. * 1. the message meta-information, including identification of the
  10003. * sender and type of the received data, and a 4-octet flush/release IE
  10004. * 2. the firmware rx PPDU descriptor
  10005. *
  10006. * The format of the message is depicted below.
  10007. * in this depiction, the following abbreviations are used for information
  10008. * elements within the message:
  10009. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10010. * elements associated with the PPDU start are valid.
  10011. * Specifically, the following fields are valid only if SV is set:
  10012. * RSSI (all variants), L, legacy rate, preamble type, service,
  10013. * VHT-SIG-A
  10014. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10015. * elements associated with the PPDU end are valid.
  10016. * Specifically, the following fields are valid only if EV is set:
  10017. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10018. * - L - Legacy rate selector - if legacy rates are used, this flag
  10019. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10020. * (L == 0) PHY.
  10021. * - P - PHY error flag - boolean indication of whether the rx frame had
  10022. * a PHY error
  10023. *
  10024. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10025. * |----------------+-------------------+---------------------+---------------|
  10026. * | peer ID | |RV|FV| ext TID | msg type |
  10027. * |--------------------------------------------------------------------------|
  10028. * | num | release | release | flush | flush |
  10029. * | MPDU | end | start | end | start |
  10030. * | ranges | seq num | seq num | seq num | seq num |
  10031. * |==========================================================================|
  10032. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10033. * |V|V| | rate | | | timestamp | RSSI |
  10034. * |--------------------------------------------------------------------------|
  10035. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10036. * |--------------------------------------------------------------------------|
  10037. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10038. * |--------------------------------------------------------------------------|
  10039. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10040. * |--------------------------------------------------------------------------|
  10041. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10042. * |--------------------------------------------------------------------------|
  10043. * | TSF LSBs |
  10044. * |--------------------------------------------------------------------------|
  10045. * | microsec timestamp |
  10046. * |--------------------------------------------------------------------------|
  10047. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10048. * |--------------------------------------------------------------------------|
  10049. * | service | HT-SIG / VHT-SIG-A2 |
  10050. * |==========================================================================|
  10051. * | reserved | FW rx desc bytes |
  10052. * |--------------------------------------------------------------------------|
  10053. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10054. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10055. * |--------------------------------------------------------------------------|
  10056. * : : :
  10057. * |--------------------------------------------------------------------------|
  10058. * | alignment | MSDU Rx |
  10059. * | padding | desc Bn |
  10060. * |--------------------------------------------------------------------------|
  10061. * | reserved | MPDU range status | MPDU count |
  10062. * |--------------------------------------------------------------------------|
  10063. * : reserved : MPDU range status : MPDU count :
  10064. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10065. *
  10066. * Header fields:
  10067. * - MSG_TYPE
  10068. * Bits 7:0
  10069. * Purpose: identifies this as an rx indication message
  10070. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10071. * - EXT_TID
  10072. * Bits 12:8
  10073. * Purpose: identify the traffic ID of the rx data, including
  10074. * special "extended" TID values for multicast, broadcast, and
  10075. * non-QoS data frames
  10076. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10077. * - FLUSH_VALID (FV)
  10078. * Bit 13
  10079. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10080. * is valid
  10081. * Value:
  10082. * 1 -> flush IE is valid and needs to be processed
  10083. * 0 -> flush IE is not valid and should be ignored
  10084. * - REL_VALID (RV)
  10085. * Bit 13
  10086. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10087. * is valid
  10088. * Value:
  10089. * 1 -> release IE is valid and needs to be processed
  10090. * 0 -> release IE is not valid and should be ignored
  10091. * - PEER_ID
  10092. * Bits 31:16
  10093. * Purpose: Identify, by ID, which peer sent the rx data
  10094. * Value: ID of the peer who sent the rx data
  10095. * - FLUSH_SEQ_NUM_START
  10096. * Bits 5:0
  10097. * Purpose: Indicate the start of a series of MPDUs to flush
  10098. * Not all MPDUs within this series are necessarily valid - the host
  10099. * must check each sequence number within this range to see if the
  10100. * corresponding MPDU is actually present.
  10101. * This field is only valid if the FV bit is set.
  10102. * Value:
  10103. * The sequence number for the first MPDUs to check to flush.
  10104. * The sequence number is masked by 0x3f.
  10105. * - FLUSH_SEQ_NUM_END
  10106. * Bits 11:6
  10107. * Purpose: Indicate the end of a series of MPDUs to flush
  10108. * Value:
  10109. * The sequence number one larger than the sequence number of the
  10110. * last MPDU to check to flush.
  10111. * The sequence number is masked by 0x3f.
  10112. * Not all MPDUs within this series are necessarily valid - the host
  10113. * must check each sequence number within this range to see if the
  10114. * corresponding MPDU is actually present.
  10115. * This field is only valid if the FV bit is set.
  10116. * - REL_SEQ_NUM_START
  10117. * Bits 17:12
  10118. * Purpose: Indicate the start of a series of MPDUs to release.
  10119. * All MPDUs within this series are present and valid - the host
  10120. * need not check each sequence number within this range to see if
  10121. * the corresponding MPDU is actually present.
  10122. * This field is only valid if the RV bit is set.
  10123. * Value:
  10124. * The sequence number for the first MPDUs to check to release.
  10125. * The sequence number is masked by 0x3f.
  10126. * - REL_SEQ_NUM_END
  10127. * Bits 23:18
  10128. * Purpose: Indicate the end of a series of MPDUs to release.
  10129. * Value:
  10130. * The sequence number one larger than the sequence number of the
  10131. * last MPDU to check to release.
  10132. * The sequence number is masked by 0x3f.
  10133. * All MPDUs within this series are present and valid - the host
  10134. * need not check each sequence number within this range to see if
  10135. * the corresponding MPDU is actually present.
  10136. * This field is only valid if the RV bit is set.
  10137. * - NUM_MPDU_RANGES
  10138. * Bits 31:24
  10139. * Purpose: Indicate how many ranges of MPDUs are present.
  10140. * Each MPDU range consists of a series of contiguous MPDUs within the
  10141. * rx frame sequence which all have the same MPDU status.
  10142. * Value: 1-63 (typically a small number, like 1-3)
  10143. *
  10144. * Rx PPDU descriptor fields:
  10145. * - RSSI_CMB
  10146. * Bits 7:0
  10147. * Purpose: Combined RSSI from all active rx chains, across the active
  10148. * bandwidth.
  10149. * Value: RSSI dB units w.r.t. noise floor
  10150. * - TIMESTAMP_SUBMICROSEC
  10151. * Bits 15:8
  10152. * Purpose: high-resolution timestamp
  10153. * Value:
  10154. * Sub-microsecond time of PPDU reception.
  10155. * This timestamp ranges from [0,MAC clock MHz).
  10156. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10157. * to form a high-resolution, large range rx timestamp.
  10158. * - PHY_ERR_CODE
  10159. * Bits 23:16
  10160. * Purpose:
  10161. * If the rx frame processing resulted in a PHY error, indicate what
  10162. * type of rx PHY error occurred.
  10163. * Value:
  10164. * This field is valid if the "P" (PHY_ERR) flag is set.
  10165. * TBD: document/specify the values for this field
  10166. * - PHY_ERR
  10167. * Bit 24
  10168. * Purpose: indicate whether the rx PPDU had a PHY error
  10169. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10170. * - LEGACY_RATE
  10171. * Bits 28:25
  10172. * Purpose:
  10173. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10174. * specify which rate was used.
  10175. * Value:
  10176. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10177. * flag.
  10178. * If LEGACY_RATE_SEL is 0:
  10179. * 0x8: OFDM 48 Mbps
  10180. * 0x9: OFDM 24 Mbps
  10181. * 0xA: OFDM 12 Mbps
  10182. * 0xB: OFDM 6 Mbps
  10183. * 0xC: OFDM 54 Mbps
  10184. * 0xD: OFDM 36 Mbps
  10185. * 0xE: OFDM 18 Mbps
  10186. * 0xF: OFDM 9 Mbps
  10187. * If LEGACY_RATE_SEL is 1:
  10188. * 0x8: CCK 11 Mbps long preamble
  10189. * 0x9: CCK 5.5 Mbps long preamble
  10190. * 0xA: CCK 2 Mbps long preamble
  10191. * 0xB: CCK 1 Mbps long preamble
  10192. * 0xC: CCK 11 Mbps short preamble
  10193. * 0xD: CCK 5.5 Mbps short preamble
  10194. * 0xE: CCK 2 Mbps short preamble
  10195. * - LEGACY_RATE_SEL
  10196. * Bit 29
  10197. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10198. * Value:
  10199. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10200. * used a legacy rate.
  10201. * 0 -> OFDM, 1 -> CCK
  10202. * - END_VALID
  10203. * Bit 30
  10204. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10205. * the start of the PPDU are valid. Specifically, the following
  10206. * fields are only valid if END_VALID is set:
  10207. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10208. * TIMESTAMP_SUBMICROSEC
  10209. * Value:
  10210. * 0 -> rx PPDU desc end fields are not valid
  10211. * 1 -> rx PPDU desc end fields are valid
  10212. * - START_VALID
  10213. * Bit 31
  10214. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10215. * the end of the PPDU are valid. Specifically, the following
  10216. * fields are only valid if START_VALID is set:
  10217. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10218. * VHT-SIG-A
  10219. * Value:
  10220. * 0 -> rx PPDU desc start fields are not valid
  10221. * 1 -> rx PPDU desc start fields are valid
  10222. * - RSSI0_PRI20
  10223. * Bits 7:0
  10224. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10225. * Value: RSSI dB units w.r.t. noise floor
  10226. *
  10227. * - RSSI0_EXT20
  10228. * Bits 7:0
  10229. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10230. * (if the rx bandwidth was >= 40 MHz)
  10231. * Value: RSSI dB units w.r.t. noise floor
  10232. * - RSSI0_EXT40
  10233. * Bits 7:0
  10234. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10235. * (if the rx bandwidth was >= 80 MHz)
  10236. * Value: RSSI dB units w.r.t. noise floor
  10237. * - RSSI0_EXT80
  10238. * Bits 7:0
  10239. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10240. * (if the rx bandwidth was >= 160 MHz)
  10241. * Value: RSSI dB units w.r.t. noise floor
  10242. *
  10243. * - RSSI1_PRI20
  10244. * Bits 7:0
  10245. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10246. * Value: RSSI dB units w.r.t. noise floor
  10247. * - RSSI1_EXT20
  10248. * Bits 7:0
  10249. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10250. * (if the rx bandwidth was >= 40 MHz)
  10251. * Value: RSSI dB units w.r.t. noise floor
  10252. * - RSSI1_EXT40
  10253. * Bits 7:0
  10254. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10255. * (if the rx bandwidth was >= 80 MHz)
  10256. * Value: RSSI dB units w.r.t. noise floor
  10257. * - RSSI1_EXT80
  10258. * Bits 7:0
  10259. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10260. * (if the rx bandwidth was >= 160 MHz)
  10261. * Value: RSSI dB units w.r.t. noise floor
  10262. *
  10263. * - RSSI2_PRI20
  10264. * Bits 7:0
  10265. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10266. * Value: RSSI dB units w.r.t. noise floor
  10267. * - RSSI2_EXT20
  10268. * Bits 7:0
  10269. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10270. * (if the rx bandwidth was >= 40 MHz)
  10271. * Value: RSSI dB units w.r.t. noise floor
  10272. * - RSSI2_EXT40
  10273. * Bits 7:0
  10274. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10275. * (if the rx bandwidth was >= 80 MHz)
  10276. * Value: RSSI dB units w.r.t. noise floor
  10277. * - RSSI2_EXT80
  10278. * Bits 7:0
  10279. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10280. * (if the rx bandwidth was >= 160 MHz)
  10281. * Value: RSSI dB units w.r.t. noise floor
  10282. *
  10283. * - RSSI3_PRI20
  10284. * Bits 7:0
  10285. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10286. * Value: RSSI dB units w.r.t. noise floor
  10287. * - RSSI3_EXT20
  10288. * Bits 7:0
  10289. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10290. * (if the rx bandwidth was >= 40 MHz)
  10291. * Value: RSSI dB units w.r.t. noise floor
  10292. * - RSSI3_EXT40
  10293. * Bits 7:0
  10294. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10295. * (if the rx bandwidth was >= 80 MHz)
  10296. * Value: RSSI dB units w.r.t. noise floor
  10297. * - RSSI3_EXT80
  10298. * Bits 7:0
  10299. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10300. * (if the rx bandwidth was >= 160 MHz)
  10301. * Value: RSSI dB units w.r.t. noise floor
  10302. *
  10303. * - TSF32
  10304. * Bits 31:0
  10305. * Purpose: specify the time the rx PPDU was received, in TSF units
  10306. * Value: 32 LSBs of the TSF
  10307. * - TIMESTAMP_MICROSEC
  10308. * Bits 31:0
  10309. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10310. * Value: PPDU rx time, in microseconds
  10311. * - VHT_SIG_A1
  10312. * Bits 23:0
  10313. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10314. * from the rx PPDU
  10315. * Value:
  10316. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10317. * VHT-SIG-A1 data.
  10318. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10319. * first 24 bits of the HT-SIG data.
  10320. * Otherwise, this field is invalid.
  10321. * Refer to the the 802.11 protocol for the definition of the
  10322. * HT-SIG and VHT-SIG-A1 fields
  10323. * - VHT_SIG_A2
  10324. * Bits 23:0
  10325. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10326. * from the rx PPDU
  10327. * Value:
  10328. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10329. * VHT-SIG-A2 data.
  10330. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10331. * last 24 bits of the HT-SIG data.
  10332. * Otherwise, this field is invalid.
  10333. * Refer to the the 802.11 protocol for the definition of the
  10334. * HT-SIG and VHT-SIG-A2 fields
  10335. * - PREAMBLE_TYPE
  10336. * Bits 31:24
  10337. * Purpose: indicate the PHY format of the received burst
  10338. * Value:
  10339. * 0x4: Legacy (OFDM/CCK)
  10340. * 0x8: HT
  10341. * 0x9: HT with TxBF
  10342. * 0xC: VHT
  10343. * 0xD: VHT with TxBF
  10344. * - SERVICE
  10345. * Bits 31:24
  10346. * Purpose: TBD
  10347. * Value: TBD
  10348. *
  10349. * Rx MSDU descriptor fields:
  10350. * - FW_RX_DESC_BYTES
  10351. * Bits 15:0
  10352. * Purpose: Indicate how many bytes in the Rx indication are used for
  10353. * FW Rx descriptors
  10354. *
  10355. * Payload fields:
  10356. * - MPDU_COUNT
  10357. * Bits 7:0
  10358. * Purpose: Indicate how many sequential MPDUs share the same status.
  10359. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10360. * - MPDU_STATUS
  10361. * Bits 15:8
  10362. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10363. * received successfully.
  10364. * Value:
  10365. * 0x1: success
  10366. * 0x2: FCS error
  10367. * 0x3: duplicate error
  10368. * 0x4: replay error
  10369. * 0x5: invalid peer
  10370. */
  10371. /* header fields */
  10372. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10373. #define HTT_RX_IND_EXT_TID_S 8
  10374. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10375. #define HTT_RX_IND_FLUSH_VALID_S 13
  10376. #define HTT_RX_IND_REL_VALID_M 0x4000
  10377. #define HTT_RX_IND_REL_VALID_S 14
  10378. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10379. #define HTT_RX_IND_PEER_ID_S 16
  10380. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10381. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10382. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10383. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10384. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10385. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10386. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10387. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10388. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10389. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10390. /* rx PPDU descriptor fields */
  10391. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10392. #define HTT_RX_IND_RSSI_CMB_S 0
  10393. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10394. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10395. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10396. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10397. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10398. #define HTT_RX_IND_PHY_ERR_S 24
  10399. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10400. #define HTT_RX_IND_LEGACY_RATE_S 25
  10401. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10402. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10403. #define HTT_RX_IND_END_VALID_M 0x40000000
  10404. #define HTT_RX_IND_END_VALID_S 30
  10405. #define HTT_RX_IND_START_VALID_M 0x80000000
  10406. #define HTT_RX_IND_START_VALID_S 31
  10407. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10408. #define HTT_RX_IND_RSSI_PRI20_S 0
  10409. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10410. #define HTT_RX_IND_RSSI_EXT20_S 8
  10411. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10412. #define HTT_RX_IND_RSSI_EXT40_S 16
  10413. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10414. #define HTT_RX_IND_RSSI_EXT80_S 24
  10415. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10416. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10417. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10418. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10419. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10420. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10421. #define HTT_RX_IND_SERVICE_M 0xff000000
  10422. #define HTT_RX_IND_SERVICE_S 24
  10423. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10424. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10425. /* rx MSDU descriptor fields */
  10426. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10427. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10428. /* payload fields */
  10429. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10430. #define HTT_RX_IND_MPDU_COUNT_S 0
  10431. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10432. #define HTT_RX_IND_MPDU_STATUS_S 8
  10433. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10434. do { \
  10435. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10436. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10437. } while (0)
  10438. #define HTT_RX_IND_EXT_TID_GET(word) \
  10439. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10440. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10443. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10444. } while (0)
  10445. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10446. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10447. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10450. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10451. } while (0)
  10452. #define HTT_RX_IND_REL_VALID_GET(word) \
  10453. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10454. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10457. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10458. } while (0)
  10459. #define HTT_RX_IND_PEER_ID_GET(word) \
  10460. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10461. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10464. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10465. } while (0)
  10466. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10467. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10468. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10471. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10472. } while (0)
  10473. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10474. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10475. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10476. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10477. do { \
  10478. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10479. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10480. } while (0)
  10481. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10482. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10483. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10484. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10485. do { \
  10486. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10487. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10488. } while (0)
  10489. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10490. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10491. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10492. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10495. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10496. } while (0)
  10497. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10498. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10499. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10500. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10501. do { \
  10502. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10503. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10504. } while (0)
  10505. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10506. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10507. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10508. /* FW rx PPDU descriptor fields */
  10509. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10512. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10513. } while (0)
  10514. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10515. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10516. HTT_RX_IND_RSSI_CMB_S)
  10517. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10520. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10521. } while (0)
  10522. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10523. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10524. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10525. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10526. do { \
  10527. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10528. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10529. } while (0)
  10530. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10531. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10532. HTT_RX_IND_PHY_ERR_CODE_S)
  10533. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10534. do { \
  10535. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10536. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10537. } while (0)
  10538. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10539. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10540. HTT_RX_IND_PHY_ERR_S)
  10541. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10542. do { \
  10543. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10544. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10545. } while (0)
  10546. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10547. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10548. HTT_RX_IND_LEGACY_RATE_S)
  10549. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10550. do { \
  10551. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10552. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10553. } while (0)
  10554. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10555. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10556. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10557. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10558. do { \
  10559. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10560. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10561. } while (0)
  10562. #define HTT_RX_IND_END_VALID_GET(word) \
  10563. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10564. HTT_RX_IND_END_VALID_S)
  10565. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10566. do { \
  10567. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10568. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10569. } while (0)
  10570. #define HTT_RX_IND_START_VALID_GET(word) \
  10571. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10572. HTT_RX_IND_START_VALID_S)
  10573. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10574. do { \
  10575. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10576. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10577. } while (0)
  10578. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10579. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10580. HTT_RX_IND_RSSI_PRI20_S)
  10581. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10582. do { \
  10583. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10584. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10585. } while (0)
  10586. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10587. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10588. HTT_RX_IND_RSSI_EXT20_S)
  10589. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10590. do { \
  10591. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10592. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10593. } while (0)
  10594. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10595. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10596. HTT_RX_IND_RSSI_EXT40_S)
  10597. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10598. do { \
  10599. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10600. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10601. } while (0)
  10602. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10603. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10604. HTT_RX_IND_RSSI_EXT80_S)
  10605. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10606. do { \
  10607. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10608. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10609. } while (0)
  10610. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10611. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10612. HTT_RX_IND_VHT_SIG_A1_S)
  10613. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10614. do { \
  10615. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10616. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10617. } while (0)
  10618. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10619. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10620. HTT_RX_IND_VHT_SIG_A2_S)
  10621. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10622. do { \
  10623. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10624. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10625. } while (0)
  10626. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10627. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10628. HTT_RX_IND_PREAMBLE_TYPE_S)
  10629. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10630. do { \
  10631. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10632. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10633. } while (0)
  10634. #define HTT_RX_IND_SERVICE_GET(word) \
  10635. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10636. HTT_RX_IND_SERVICE_S)
  10637. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10638. do { \
  10639. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10640. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10641. } while (0)
  10642. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10643. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10644. HTT_RX_IND_SA_ANT_MATRIX_S)
  10645. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10646. do { \
  10647. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10648. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10649. } while (0)
  10650. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10651. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10652. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10653. do { \
  10654. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10655. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10656. } while (0)
  10657. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10658. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10659. #define HTT_RX_IND_HL_BYTES \
  10660. (HTT_RX_IND_HDR_BYTES + \
  10661. 4 /* single FW rx MSDU descriptor */ + \
  10662. 4 /* single MPDU range information element */)
  10663. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10664. /* Could we use one macro entry? */
  10665. #define HTT_WORD_SET(word, field, value) \
  10666. do { \
  10667. HTT_CHECK_SET_VAL(field, value); \
  10668. (word) |= ((value) << field ## _S); \
  10669. } while (0)
  10670. #define HTT_WORD_GET(word, field) \
  10671. (((word) & field ## _M) >> field ## _S)
  10672. PREPACK struct hl_htt_rx_ind_base {
  10673. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10674. } POSTPACK;
  10675. /*
  10676. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10677. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10678. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10679. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10680. * htt_rx_ind_hl_rx_desc_t.
  10681. */
  10682. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10683. struct htt_rx_ind_hl_rx_desc_t {
  10684. A_UINT8 ver;
  10685. A_UINT8 len;
  10686. struct {
  10687. A_UINT8
  10688. first_msdu: 1,
  10689. last_msdu: 1,
  10690. c3_failed: 1,
  10691. c4_failed: 1,
  10692. ipv6: 1,
  10693. tcp: 1,
  10694. udp: 1,
  10695. reserved: 1;
  10696. } flags;
  10697. /* NOTE: no reserved space - don't append any new fields here */
  10698. };
  10699. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10700. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10701. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10702. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10703. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10704. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10705. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10706. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10707. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10708. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10709. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10710. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10711. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10712. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10713. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10714. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10715. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10716. /* This structure is used in HL, the basic descriptor information
  10717. * used by host. the structure is translated by FW from HW desc
  10718. * or generated by FW. But in HL monitor mode, the host would use
  10719. * the same structure with LL.
  10720. */
  10721. PREPACK struct hl_htt_rx_desc_base {
  10722. A_UINT32
  10723. seq_num:12,
  10724. encrypted:1,
  10725. chan_info_present:1,
  10726. resv0:2,
  10727. mcast_bcast:1,
  10728. fragment:1,
  10729. key_id_oct:8,
  10730. resv1:6;
  10731. A_UINT32
  10732. pn_31_0;
  10733. union {
  10734. struct {
  10735. A_UINT16 pn_47_32;
  10736. A_UINT16 pn_63_48;
  10737. } pn16;
  10738. A_UINT32 pn_63_32;
  10739. } u0;
  10740. A_UINT32
  10741. pn_95_64;
  10742. A_UINT32
  10743. pn_127_96;
  10744. } POSTPACK;
  10745. /*
  10746. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10747. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10748. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10749. * Please see htt_chan_change_t for description of the fields.
  10750. */
  10751. PREPACK struct htt_chan_info_t
  10752. {
  10753. A_UINT32 primary_chan_center_freq_mhz: 16,
  10754. contig_chan1_center_freq_mhz: 16;
  10755. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10756. phy_mode: 8,
  10757. reserved: 8;
  10758. } POSTPACK;
  10759. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10760. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10761. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10762. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10763. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10764. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10765. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10766. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10767. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10768. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10769. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10770. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10771. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10772. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10773. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10774. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10775. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10776. /* Channel information */
  10777. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10778. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10779. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10780. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10781. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10782. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10783. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10784. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10785. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10786. do { \
  10787. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10788. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10789. } while (0)
  10790. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10791. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10792. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10795. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10796. } while (0)
  10797. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10798. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10799. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10800. do { \
  10801. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10802. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10803. } while (0)
  10804. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10805. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10806. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10807. do { \
  10808. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10809. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10810. } while (0)
  10811. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10812. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10813. /*
  10814. * @brief target -> host message definition for FW offloaded pkts
  10815. *
  10816. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10817. *
  10818. * @details
  10819. * The following field definitions describe the format of the firmware
  10820. * offload deliver message sent from the target to the host.
  10821. *
  10822. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10823. *
  10824. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10825. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10826. * | reserved_1 | msg type |
  10827. * |--------------------------------------------------------------------------|
  10828. * | phy_timestamp_l32 |
  10829. * |--------------------------------------------------------------------------|
  10830. * | WORD2 (see below) |
  10831. * |--------------------------------------------------------------------------|
  10832. * | seqno | framectrl |
  10833. * |--------------------------------------------------------------------------|
  10834. * | reserved_3 | vdev_id | tid_num|
  10835. * |--------------------------------------------------------------------------|
  10836. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10837. * |--------------------------------------------------------------------------|
  10838. *
  10839. * where:
  10840. * STAT = status
  10841. * F = format (802.3 vs. 802.11)
  10842. *
  10843. * definition for word 2
  10844. *
  10845. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10846. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10847. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10848. * |--------------------------------------------------------------------------|
  10849. *
  10850. * where:
  10851. * PR = preamble
  10852. * BF = beamformed
  10853. */
  10854. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10855. {
  10856. A_UINT32 /* word 0 */
  10857. msg_type:8, /* [ 7: 0] */
  10858. reserved_1:24; /* [31: 8] */
  10859. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10860. A_UINT32 /* word 2 */
  10861. /* preamble:
  10862. * 0-OFDM,
  10863. * 1-CCk,
  10864. * 2-HT,
  10865. * 3-VHT
  10866. */
  10867. preamble: 2, /* [1:0] */
  10868. /* mcs:
  10869. * In case of HT preamble interpret
  10870. * MCS along with NSS.
  10871. * Valid values for HT are 0 to 7.
  10872. * HT mcs 0 with NSS 2 is mcs 8.
  10873. * Valid values for VHT are 0 to 9.
  10874. */
  10875. mcs: 4, /* [5:2] */
  10876. /* rate:
  10877. * This is applicable only for
  10878. * CCK and OFDM preamble type
  10879. * rate 0: OFDM 48 Mbps,
  10880. * 1: OFDM 24 Mbps,
  10881. * 2: OFDM 12 Mbps
  10882. * 3: OFDM 6 Mbps
  10883. * 4: OFDM 54 Mbps
  10884. * 5: OFDM 36 Mbps
  10885. * 6: OFDM 18 Mbps
  10886. * 7: OFDM 9 Mbps
  10887. * rate 0: CCK 11 Mbps Long
  10888. * 1: CCK 5.5 Mbps Long
  10889. * 2: CCK 2 Mbps Long
  10890. * 3: CCK 1 Mbps Long
  10891. * 4: CCK 11 Mbps Short
  10892. * 5: CCK 5.5 Mbps Short
  10893. * 6: CCK 2 Mbps Short
  10894. */
  10895. rate : 3, /* [ 8: 6] */
  10896. rssi : 8, /* [16: 9] units=dBm */
  10897. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10898. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10899. stbc : 1, /* [22] */
  10900. sgi : 1, /* [23] */
  10901. ldpc : 1, /* [24] */
  10902. beamformed: 1, /* [25] */
  10903. reserved_2: 6; /* [31:26] */
  10904. A_UINT32 /* word 3 */
  10905. framectrl:16, /* [15: 0] */
  10906. seqno:16; /* [31:16] */
  10907. A_UINT32 /* word 4 */
  10908. tid_num:5, /* [ 4: 0] actual TID number */
  10909. vdev_id:8, /* [12: 5] */
  10910. reserved_3:19; /* [31:13] */
  10911. A_UINT32 /* word 5 */
  10912. /* status:
  10913. * 0: tx_ok
  10914. * 1: retry
  10915. * 2: drop
  10916. * 3: filtered
  10917. * 4: abort
  10918. * 5: tid delete
  10919. * 6: sw abort
  10920. * 7: dropped by peer migration
  10921. */
  10922. status:3, /* [2:0] */
  10923. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10924. tx_mpdu_bytes:16, /* [19:4] */
  10925. /* Indicates retry count of offloaded/local generated Data tx frames */
  10926. tx_retry_cnt:6, /* [25:20] */
  10927. reserved_4:6; /* [31:26] */
  10928. } POSTPACK;
  10929. /* FW offload deliver ind message header fields */
  10930. /* DWORD one */
  10931. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10932. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10933. /* DWORD two */
  10934. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10935. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10936. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10937. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10938. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10939. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10940. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10941. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10942. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10943. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10944. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10945. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10946. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10947. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10948. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10949. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10950. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10951. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10952. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10953. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10954. /* DWORD three*/
  10955. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10956. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10957. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10958. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10959. /* DWORD four */
  10960. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10961. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10962. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10963. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10964. /* DWORD five */
  10965. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10966. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10967. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10968. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10969. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10970. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10971. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10972. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10973. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10974. do { \
  10975. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10976. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10977. } while (0)
  10978. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10979. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10980. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10981. do { \
  10982. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10983. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10984. } while (0)
  10985. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10986. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10987. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10988. do { \
  10989. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10990. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10991. } while (0)
  10992. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10993. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10994. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10997. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10998. } while (0)
  10999. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  11000. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  11001. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11004. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11005. } while (0)
  11006. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11007. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11008. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11009. do { \
  11010. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11011. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11012. } while (0)
  11013. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11014. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11015. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11016. do { \
  11017. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11018. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11019. } while (0)
  11020. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11021. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11022. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11023. do { \
  11024. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11025. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11026. } while (0)
  11027. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11028. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11029. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11030. do { \
  11031. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11032. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11033. } while (0)
  11034. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11035. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11036. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11037. do { \
  11038. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11039. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11040. } while (0)
  11041. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11042. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11043. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11044. do { \
  11045. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11046. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11047. } while (0)
  11048. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11049. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11050. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11053. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11054. } while (0)
  11055. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11056. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11057. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11058. do { \
  11059. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11060. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11061. } while (0)
  11062. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11063. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11064. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11065. do { \
  11066. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11067. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11068. } while (0)
  11069. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11070. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11071. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11072. do { \
  11073. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11074. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11075. } while (0)
  11076. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11077. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11078. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11079. do { \
  11080. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11081. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11082. } while (0)
  11083. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11084. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11085. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11086. do { \
  11087. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11088. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11089. } while (0)
  11090. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11091. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11092. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11093. do { \
  11094. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11095. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11096. } while (0)
  11097. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11098. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11099. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11100. do { \
  11101. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11102. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11103. } while (0)
  11104. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11105. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11106. /*
  11107. * @brief target -> host rx reorder flush message definition
  11108. *
  11109. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11110. *
  11111. * @details
  11112. * The following field definitions describe the format of the rx flush
  11113. * message sent from the target to the host.
  11114. * The message consists of a 4-octet header, followed by one or more
  11115. * 4-octet payload information elements.
  11116. *
  11117. * |31 24|23 8|7 0|
  11118. * |--------------------------------------------------------------|
  11119. * | TID | peer ID | msg type |
  11120. * |--------------------------------------------------------------|
  11121. * | seq num end | seq num start | MPDU status | reserved |
  11122. * |--------------------------------------------------------------|
  11123. * First DWORD:
  11124. * - MSG_TYPE
  11125. * Bits 7:0
  11126. * Purpose: identifies this as an rx flush message
  11127. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11128. * - PEER_ID
  11129. * Bits 23:8 (only bits 18:8 actually used)
  11130. * Purpose: identify which peer's rx data is being flushed
  11131. * Value: (rx) peer ID
  11132. * - TID
  11133. * Bits 31:24 (only bits 27:24 actually used)
  11134. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11135. * Value: traffic identifier
  11136. * Second DWORD:
  11137. * - MPDU_STATUS
  11138. * Bits 15:8
  11139. * Purpose:
  11140. * Indicate whether the flushed MPDUs should be discarded or processed.
  11141. * Value:
  11142. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11143. * stages of rx processing
  11144. * other: discard the MPDUs
  11145. * It is anticipated that flush messages will always have
  11146. * MPDU status == 1, but the status flag is included for
  11147. * flexibility.
  11148. * - SEQ_NUM_START
  11149. * Bits 23:16
  11150. * Purpose:
  11151. * Indicate the start of a series of consecutive MPDUs being flushed.
  11152. * Not all MPDUs within this range are necessarily valid - the host
  11153. * must check each sequence number within this range to see if the
  11154. * corresponding MPDU is actually present.
  11155. * Value:
  11156. * The sequence number for the first MPDU in the sequence.
  11157. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11158. * - SEQ_NUM_END
  11159. * Bits 30:24
  11160. * Purpose:
  11161. * Indicate the end of a series of consecutive MPDUs being flushed.
  11162. * Value:
  11163. * The sequence number one larger than the sequence number of the
  11164. * last MPDU being flushed.
  11165. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11166. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11167. * are to be released for further rx processing.
  11168. * Not all MPDUs within this range are necessarily valid - the host
  11169. * must check each sequence number within this range to see if the
  11170. * corresponding MPDU is actually present.
  11171. */
  11172. /* first DWORD */
  11173. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11174. #define HTT_RX_FLUSH_PEER_ID_S 8
  11175. #define HTT_RX_FLUSH_TID_M 0xff000000
  11176. #define HTT_RX_FLUSH_TID_S 24
  11177. /* second DWORD */
  11178. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11179. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11180. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11181. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11182. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11183. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11184. #define HTT_RX_FLUSH_BYTES 8
  11185. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11186. do { \
  11187. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11188. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11189. } while (0)
  11190. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11191. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11192. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11193. do { \
  11194. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11195. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11196. } while (0)
  11197. #define HTT_RX_FLUSH_TID_GET(word) \
  11198. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11199. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11200. do { \
  11201. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11202. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11203. } while (0)
  11204. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11205. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11206. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11207. do { \
  11208. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11209. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11210. } while (0)
  11211. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11212. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11213. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11214. do { \
  11215. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11216. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11217. } while (0)
  11218. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11219. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11220. /*
  11221. * @brief target -> host rx pn check indication message
  11222. *
  11223. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11224. *
  11225. * @details
  11226. * The following field definitions describe the format of the Rx PN check
  11227. * indication message sent from the target to the host.
  11228. * The message consists of a 4-octet header, followed by the start and
  11229. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11230. * IE is one octet containing the sequence number that failed the PN
  11231. * check.
  11232. *
  11233. * |31 24|23 8|7 0|
  11234. * |--------------------------------------------------------------|
  11235. * | TID | peer ID | msg type |
  11236. * |--------------------------------------------------------------|
  11237. * | Reserved | PN IE count | seq num end | seq num start|
  11238. * |--------------------------------------------------------------|
  11239. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11240. * |--------------------------------------------------------------|
  11241. * First DWORD:
  11242. * - MSG_TYPE
  11243. * Bits 7:0
  11244. * Purpose: Identifies this as an rx pn check indication message
  11245. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11246. * - PEER_ID
  11247. * Bits 23:8 (only bits 18:8 actually used)
  11248. * Purpose: identify which peer
  11249. * Value: (rx) peer ID
  11250. * - TID
  11251. * Bits 31:24 (only bits 27:24 actually used)
  11252. * Purpose: identify traffic identifier
  11253. * Value: traffic identifier
  11254. * Second DWORD:
  11255. * - SEQ_NUM_START
  11256. * Bits 7:0
  11257. * Purpose:
  11258. * Indicates the starting sequence number of the MPDU in this
  11259. * series of MPDUs that went though PN check.
  11260. * Value:
  11261. * The sequence number for the first MPDU in the sequence.
  11262. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11263. * - SEQ_NUM_END
  11264. * Bits 15:8
  11265. * Purpose:
  11266. * Indicates the ending sequence number of the MPDU in this
  11267. * series of MPDUs that went though PN check.
  11268. * Value:
  11269. * The sequence number one larger then the sequence number of the last
  11270. * MPDU being flushed.
  11271. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11272. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11273. * for invalid PN numbers and are ready to be released for further processing.
  11274. * Not all MPDUs within this range are necessarily valid - the host
  11275. * must check each sequence number within this range to see if the
  11276. * corresponding MPDU is actually present.
  11277. * - PN_IE_COUNT
  11278. * Bits 23:16
  11279. * Purpose:
  11280. * Used to determine the variable number of PN information elements in this
  11281. * message
  11282. *
  11283. * PN information elements:
  11284. * - PN_IE_x-
  11285. * Purpose:
  11286. * Each PN information element contains the sequence number of the MPDU that
  11287. * has failed the target PN check.
  11288. * Value:
  11289. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11290. * that failed the PN check.
  11291. */
  11292. /* first DWORD */
  11293. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11294. #define HTT_RX_PN_IND_PEER_ID_S 8
  11295. #define HTT_RX_PN_IND_TID_M 0xff000000
  11296. #define HTT_RX_PN_IND_TID_S 24
  11297. /* second DWORD */
  11298. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11299. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11300. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11301. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11302. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11303. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11304. #define HTT_RX_PN_IND_BYTES 8
  11305. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11306. do { \
  11307. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11308. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11309. } while (0)
  11310. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11311. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11312. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11315. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11316. } while (0)
  11317. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11318. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11319. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11320. do { \
  11321. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11322. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11323. } while (0)
  11324. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11325. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11326. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11327. do { \
  11328. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11329. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11330. } while (0)
  11331. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11332. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11333. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11334. do { \
  11335. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11336. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11337. } while (0)
  11338. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11339. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11340. /*
  11341. * @brief target -> host rx offload deliver message for LL system
  11342. *
  11343. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11344. *
  11345. * @details
  11346. * In a low latency system this message is sent whenever the offload
  11347. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11348. * The DMA of the actual packets into host memory is done before sending out
  11349. * this message. This message indicates only how many MSDUs to reap. The
  11350. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11351. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11352. * DMA'd by the MAC directly into host memory these packets do not contain
  11353. * the MAC descriptors in the header portion of the packet. Instead they contain
  11354. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11355. * message, the packets are delivered directly to the NW stack without going
  11356. * through the regular reorder buffering and PN checking path since it has
  11357. * already been done in target.
  11358. *
  11359. * |31 24|23 16|15 8|7 0|
  11360. * |-----------------------------------------------------------------------|
  11361. * | Total MSDU count | reserved | msg type |
  11362. * |-----------------------------------------------------------------------|
  11363. *
  11364. * @brief target -> host rx offload deliver message for HL system
  11365. *
  11366. * @details
  11367. * In a high latency system this message is sent whenever the offload manager
  11368. * flushes out the packets it has coalesced in its coalescing buffer. The
  11369. * actual packets are also carried along with this message. When the host
  11370. * receives this message, it is expected to deliver these packets to the NW
  11371. * stack directly instead of routing them through the reorder buffering and
  11372. * PN checking path since it has already been done in target.
  11373. *
  11374. * |31 24|23 16|15 8|7 0|
  11375. * |-----------------------------------------------------------------------|
  11376. * | Total MSDU count | reserved | msg type |
  11377. * |-----------------------------------------------------------------------|
  11378. * | peer ID | MSDU length |
  11379. * |-----------------------------------------------------------------------|
  11380. * | MSDU payload | FW Desc | tid | vdev ID |
  11381. * |-----------------------------------------------------------------------|
  11382. * | MSDU payload contd. |
  11383. * |-----------------------------------------------------------------------|
  11384. * | peer ID | MSDU length |
  11385. * |-----------------------------------------------------------------------|
  11386. * | MSDU payload | FW Desc | tid | vdev ID |
  11387. * |-----------------------------------------------------------------------|
  11388. * | MSDU payload contd. |
  11389. * |-----------------------------------------------------------------------|
  11390. *
  11391. */
  11392. /* first DWORD */
  11393. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11403. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11404. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11405. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11406. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11407. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11408. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11409. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11410. do { \
  11411. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11412. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11413. } while (0)
  11414. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11415. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11416. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11417. do { \
  11418. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11419. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11420. } while (0)
  11421. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11422. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11423. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11424. do { \
  11425. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11426. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11427. } while (0)
  11428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11429. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11431. do { \
  11432. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11433. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11434. } while (0)
  11435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11436. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11438. do { \
  11439. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11440. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11441. } while (0)
  11442. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11443. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11444. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11445. do { \
  11446. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11447. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11448. } while (0)
  11449. /**
  11450. * @brief target -> host rx peer map/unmap message definition
  11451. *
  11452. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11453. *
  11454. * @details
  11455. * The following diagram shows the format of the rx peer map message sent
  11456. * from the target to the host. This layout assumes the target operates
  11457. * as little-endian.
  11458. *
  11459. * This message always contains a SW peer ID. The main purpose of the
  11460. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11461. * with, so that the host can use that peer ID to determine which peer
  11462. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11463. * other purposes, such as identifying during tx completions which peer
  11464. * the tx frames in question were transmitted to.
  11465. *
  11466. * In certain generations of chips, the peer map message also contains
  11467. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11468. * to identify which peer the frame needs to be forwarded to (i.e. the
  11469. * peer associated with the Destination MAC Address within the packet),
  11470. * and particularly which vdev needs to transmit the frame (for cases
  11471. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11472. * meaning as AST_INDEX_0.
  11473. * This DA-based peer ID that is provided for certain rx frames
  11474. * (the rx frames that need to be re-transmitted as tx frames)
  11475. * is the ID that the HW uses for referring to the peer in question,
  11476. * rather than the peer ID that the SW+FW use to refer to the peer.
  11477. *
  11478. *
  11479. * |31 24|23 16|15 8|7 0|
  11480. * |-----------------------------------------------------------------------|
  11481. * | SW peer ID | VDEV ID | msg type |
  11482. * |-----------------------------------------------------------------------|
  11483. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11484. * |-----------------------------------------------------------------------|
  11485. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11486. * |-----------------------------------------------------------------------|
  11487. *
  11488. *
  11489. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11490. *
  11491. * The following diagram shows the format of the rx peer unmap message sent
  11492. * from the target to the host.
  11493. *
  11494. * |31 24|23 16|15 8|7 0|
  11495. * |-----------------------------------------------------------------------|
  11496. * | SW peer ID | VDEV ID | msg type |
  11497. * |-----------------------------------------------------------------------|
  11498. *
  11499. * The following field definitions describe the format of the rx peer map
  11500. * and peer unmap messages sent from the target to the host.
  11501. * - MSG_TYPE
  11502. * Bits 7:0
  11503. * Purpose: identifies this as an rx peer map or peer unmap message
  11504. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11505. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11506. * - VDEV_ID
  11507. * Bits 15:8
  11508. * Purpose: Indicates which virtual device the peer is associated
  11509. * with.
  11510. * Value: vdev ID (used in the host to look up the vdev object)
  11511. * - PEER_ID (a.k.a. SW_PEER_ID)
  11512. * Bits 31:16
  11513. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11514. * freeing (unmap)
  11515. * Value: (rx) peer ID
  11516. * - MAC_ADDR_L32 (peer map only)
  11517. * Bits 31:0
  11518. * Purpose: Identifies which peer node the peer ID is for.
  11519. * Value: lower 4 bytes of peer node's MAC address
  11520. * - MAC_ADDR_U16 (peer map only)
  11521. * Bits 15:0
  11522. * Purpose: Identifies which peer node the peer ID is for.
  11523. * Value: upper 2 bytes of peer node's MAC address
  11524. * - HW_PEER_ID
  11525. * Bits 31:16
  11526. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11527. * address, so for rx frames marked for rx --> tx forwarding, the
  11528. * host can determine from the HW peer ID provided as meta-data with
  11529. * the rx frame which peer the frame is supposed to be forwarded to.
  11530. * Value: ID used by the MAC HW to identify the peer
  11531. */
  11532. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11533. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11534. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11535. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11536. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11537. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11538. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11539. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11540. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11541. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11542. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11543. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11544. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11545. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11546. do { \
  11547. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11548. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11549. } while (0)
  11550. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11551. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11552. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11553. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11554. do { \
  11555. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11556. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11557. } while (0)
  11558. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11559. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11560. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11561. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11562. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11563. do { \
  11564. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11565. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11566. } while (0)
  11567. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11568. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11569. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11570. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11571. #define HTT_RX_PEER_MAP_BYTES 12
  11572. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11573. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11574. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11575. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11576. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11577. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11578. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11579. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11580. #define HTT_RX_PEER_UNMAP_BYTES 4
  11581. /**
  11582. * @brief target -> host rx peer map V2 message definition
  11583. *
  11584. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11585. *
  11586. * @details
  11587. * The following diagram shows the format of the rx peer map v2 message sent
  11588. * from the target to the host. This layout assumes the target operates
  11589. * as little-endian.
  11590. *
  11591. * This message always contains a SW peer ID. The main purpose of the
  11592. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11593. * with, so that the host can use that peer ID to determine which peer
  11594. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11595. * other purposes, such as identifying during tx completions which peer
  11596. * the tx frames in question were transmitted to.
  11597. *
  11598. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11599. * is used during rx --> tx frame forwarding to identify which peer the
  11600. * frame needs to be forwarded to (i.e. the peer associated with the
  11601. * Destination MAC Address within the packet), and particularly which vdev
  11602. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11603. * This DA-based peer ID that is provided for certain rx frames
  11604. * (the rx frames that need to be re-transmitted as tx frames)
  11605. * is the ID that the HW uses for referring to the peer in question,
  11606. * rather than the peer ID that the SW+FW use to refer to the peer.
  11607. *
  11608. * The HW peer id here is the same meaning as AST_INDEX_0.
  11609. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11610. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11611. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11612. * AST is valid.
  11613. *
  11614. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11615. * |-------------------------------------------------------------------------|
  11616. * | SW peer ID | VDEV ID | msg type |
  11617. * |-------------------------------------------------------------------------|
  11618. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11619. * |-------------------------------------------------------------------------|
  11620. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11621. * |-------------------------------------------------------------------------|
  11622. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11623. * |-------------------------------------------------------------------------|
  11624. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11625. * |-------------------------------------------------------------------------|
  11626. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11627. * |-------------------------------------------------------------------------|
  11628. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11629. * |-------------------------------------------------------------------------|
  11630. * | Reserved_2 |
  11631. * |-------------------------------------------------------------------------|
  11632. * Where:
  11633. * NH = Next Hop
  11634. * ASTVM = AST valid mask
  11635. * OA = on-chip AST valid bit
  11636. * ASTFM = AST flow mask
  11637. *
  11638. * The following field definitions describe the format of the rx peer map v2
  11639. * messages sent from the target to the host.
  11640. * - MSG_TYPE
  11641. * Bits 7:0
  11642. * Purpose: identifies this as an rx peer map v2 message
  11643. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11644. * - VDEV_ID
  11645. * Bits 15:8
  11646. * Purpose: Indicates which virtual device the peer is associated with.
  11647. * Value: vdev ID (used in the host to look up the vdev object)
  11648. * - SW_PEER_ID
  11649. * Bits 31:16
  11650. * Purpose: The peer ID (index) that WAL is allocating
  11651. * Value: (rx) peer ID
  11652. * - MAC_ADDR_L32
  11653. * Bits 31:0
  11654. * Purpose: Identifies which peer node the peer ID is for.
  11655. * Value: lower 4 bytes of peer node's MAC address
  11656. * - MAC_ADDR_U16
  11657. * Bits 15:0
  11658. * Purpose: Identifies which peer node the peer ID is for.
  11659. * Value: upper 2 bytes of peer node's MAC address
  11660. * - HW_PEER_ID / AST_INDEX_0
  11661. * Bits 31:16
  11662. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11663. * address, so for rx frames marked for rx --> tx forwarding, the
  11664. * host can determine from the HW peer ID provided as meta-data with
  11665. * the rx frame which peer the frame is supposed to be forwarded to.
  11666. * Value: ID used by the MAC HW to identify the peer
  11667. * - AST_HASH_VALUE
  11668. * Bits 15:0
  11669. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11670. * override feature.
  11671. * - NEXT_HOP
  11672. * Bit 16
  11673. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11674. * (Wireless Distribution System).
  11675. * - AST_VALID_MASK
  11676. * Bits 19:17
  11677. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11678. * - ONCHIP_AST_VALID_FLAG
  11679. * Bit 20
  11680. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11681. * is valid.
  11682. * - AST_INDEX_1
  11683. * Bits 15:0
  11684. * Purpose: indicate the second AST index for this peer
  11685. * - AST_0_FLOW_MASK
  11686. * Bits 19:16
  11687. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11688. * - AST_1_FLOW_MASK
  11689. * Bits 23:20
  11690. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11691. * - AST_2_FLOW_MASK
  11692. * Bits 27:24
  11693. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11694. * - AST_3_FLOW_MASK
  11695. * Bits 31:28
  11696. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11697. * - AST_INDEX_2
  11698. * Bits 15:0
  11699. * Purpose: indicate the third AST index for this peer
  11700. * - TID_VALID_HI_PRI
  11701. * Bits 23:16
  11702. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11703. * - TID_VALID_LOW_PRI
  11704. * Bits 31:24
  11705. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11706. * - AST_INDEX_3
  11707. * Bits 15:0
  11708. * Purpose: indicate the fourth AST index for this peer
  11709. * - ONCHIP_AST_IDX / RESERVED
  11710. * Bits 31:16
  11711. * Purpose: This field is valid only when split AST feature is enabled.
  11712. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11713. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11714. * address, this ast_idx is used for LMAC modules for RXPCU.
  11715. * Value: ID used by the LMAC HW to identify the peer
  11716. */
  11717. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11718. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11719. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11720. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11721. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11722. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11723. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11724. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11725. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11726. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11727. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11728. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11729. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11730. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11731. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11732. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11733. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11734. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11735. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11736. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11737. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11738. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11739. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11740. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11741. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11742. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11743. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11744. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11745. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11746. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11747. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11748. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11749. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11750. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11751. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11752. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11753. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11754. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11755. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11758. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11759. } while (0)
  11760. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11761. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11762. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11765. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11766. } while (0)
  11767. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11768. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11769. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11770. do { \
  11771. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11772. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11773. } while (0)
  11774. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11775. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11776. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11777. do { \
  11778. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11779. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11780. } while (0)
  11781. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11782. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11783. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11784. do { \
  11785. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11786. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11787. } while (0)
  11788. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11789. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11790. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11791. do { \
  11792. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11793. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11794. } while (0)
  11795. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11796. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11797. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11798. do { \
  11799. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11800. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11801. } while (0)
  11802. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11803. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11804. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11805. do { \
  11806. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11807. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11808. } while (0)
  11809. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11810. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11811. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11814. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11815. } while (0)
  11816. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11817. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11818. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11819. do { \
  11820. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11821. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11822. } while (0)
  11823. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11824. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11825. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11826. do { \
  11827. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11828. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11829. } while (0)
  11830. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11831. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11832. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11833. do { \
  11834. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11835. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11836. } while (0)
  11837. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11838. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11839. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11840. do { \
  11841. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11842. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11843. } while (0)
  11844. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11845. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11846. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11847. do { \
  11848. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11849. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11850. } while (0)
  11851. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11852. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11853. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11854. do { \
  11855. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11856. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11857. } while (0)
  11858. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11859. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11860. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11861. do { \
  11862. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11863. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11864. } while (0)
  11865. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11866. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11867. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11868. do { \
  11869. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11870. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11871. } while (0)
  11872. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11873. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11874. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11875. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11876. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11877. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11878. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11879. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11880. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11881. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11882. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11883. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11884. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11885. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11886. /**
  11887. * @brief target -> host rx peer map V3 message definition
  11888. *
  11889. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11890. *
  11891. * @details
  11892. * The following diagram shows the format of the rx peer map v3 message sent
  11893. * from the target to the host.
  11894. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11895. * This layout assumes the target operates as little-endian.
  11896. *
  11897. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11898. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11899. * | SW peer ID | VDEV ID | msg type |
  11900. * |-----------------+--------------------+-----------------+-----------------|
  11901. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11902. * |-----------------+--------------------+-----------------+-----------------|
  11903. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11904. * |-----------------+--------+-----------+-----------------+-----------------|
  11905. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11906. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11907. * | (8bits) | | (4bits) | |
  11908. * |-----------------+--------+--+--+--+--------------------------------------|
  11909. * | RESERVED |E |O | | |
  11910. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11911. * | |V |V | | |
  11912. * |-----------------+--------------------+-----------------------------------|
  11913. * | HTT_MSDU_IDX_ | RESERVED | |
  11914. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11915. * | (8bits) | | |
  11916. * |-----------------+--------------------+-----------------------------------|
  11917. * | Reserved_2 |
  11918. * |--------------------------------------------------------------------------|
  11919. * | Reserved_3 |
  11920. * |--------------------------------------------------------------------------|
  11921. *
  11922. * Where:
  11923. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11924. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11925. * NH = Next Hop
  11926. * The following field definitions describe the format of the rx peer map v3
  11927. * messages sent from the target to the host.
  11928. * - MSG_TYPE
  11929. * Bits 7:0
  11930. * Purpose: identifies this as a peer map v3 message
  11931. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11932. * - VDEV_ID
  11933. * Bits 15:8
  11934. * Purpose: Indicates which virtual device the peer is associated with.
  11935. * - SW_PEER_ID
  11936. * Bits 31:16
  11937. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11938. * - MAC_ADDR_L32
  11939. * Bits 31:0
  11940. * Purpose: Identifies which peer node the peer ID is for.
  11941. * Value: lower 4 bytes of peer node's MAC address
  11942. * - MAC_ADDR_U16
  11943. * Bits 15:0
  11944. * Purpose: Identifies which peer node the peer ID is for.
  11945. * Value: upper 2 bytes of peer node's MAC address
  11946. * - MULTICAST_SW_PEER_ID
  11947. * Bits 31:16
  11948. * Purpose: The multicast peer ID (index)
  11949. * Value: set to HTT_INVALID_PEER if not valid
  11950. * - HW_PEER_ID / AST_INDEX
  11951. * Bits 15:0
  11952. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11953. * address, so for rx frames marked for rx --> tx forwarding, the
  11954. * host can determine from the HW peer ID provided as meta-data with
  11955. * the rx frame which peer the frame is supposed to be forwarded to.
  11956. * - CACHE_SET_NUM
  11957. * Bits 19:16
  11958. * Purpose: Cache Set Number for AST_INDEX
  11959. * Cache set number that should be used to cache the index based
  11960. * search results, for address and flow search.
  11961. * This value should be equal to LSB 4 bits of the hash value
  11962. * of match data, in case of search index points to an entry which
  11963. * may be used in content based search also. The value can be
  11964. * anything when the entry pointed by search index will not be
  11965. * used for content based search.
  11966. * - HTT_MSDU_IDX_VALID_MASK
  11967. * Bits 31:24
  11968. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11969. * - ONCHIP_AST_IDX / RESERVED
  11970. * Bits 15:0
  11971. * Purpose: This field is valid only when split AST feature is enabled.
  11972. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11973. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11974. * address, this ast_idx is used for LMAC modules for RXPCU.
  11975. * - NEXT_HOP
  11976. * Bits 16
  11977. * Purpose: Flag indicates next_hop AST entry used for WDS
  11978. * (Wireless Distribution System).
  11979. * - ONCHIP_AST_VALID
  11980. * Bits 17
  11981. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11982. * - EXT_AST_VALID
  11983. * Bits 18
  11984. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11985. * - EXT_AST_INDEX
  11986. * Bits 15:0
  11987. * Purpose: This field describes Extended AST index
  11988. * Valid if EXT_AST_VALID flag set
  11989. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11990. * Bits 31:24
  11991. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11992. */
  11993. /* dword 0 */
  11994. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11995. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11996. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11997. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11998. /* dword 1 */
  11999. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  12000. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  12001. /* dword 2 */
  12002. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  12003. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12004. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12005. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12006. /* dword 3 */
  12007. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12008. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12009. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12010. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12011. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12012. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12013. /* dword 4 */
  12014. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12015. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12016. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12017. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12018. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12019. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12020. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12021. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12022. /* dword 5 */
  12023. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12024. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12025. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12026. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12027. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12028. do { \
  12029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12030. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12031. } while (0)
  12032. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12033. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12034. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12035. do { \
  12036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12037. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12038. } while (0)
  12039. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12040. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12041. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12042. do { \
  12043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12044. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12045. } while (0)
  12046. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12047. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12048. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12049. do { \
  12050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12051. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12052. } while (0)
  12053. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12054. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12055. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12058. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12059. } while (0)
  12060. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12061. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12062. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12063. do { \
  12064. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12065. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12066. } while (0)
  12067. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12068. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12069. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12070. do { \
  12071. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12072. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12073. } while (0)
  12074. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12075. (((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)
  12076. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12079. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12080. } while (0)
  12081. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12082. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12083. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12086. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12087. } while (0)
  12088. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12089. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12090. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12093. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12094. } while (0)
  12095. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12096. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12097. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12098. do { \
  12099. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12100. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12101. } while (0)
  12102. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12103. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12104. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12105. do { \
  12106. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12107. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12108. } while (0)
  12109. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12110. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12111. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12112. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12113. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12114. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12115. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12116. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12117. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12118. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12119. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12120. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12121. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12122. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12123. /**
  12124. * @brief target -> host rx peer unmap V2 message definition
  12125. *
  12126. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12127. *
  12128. * The following diagram shows the format of the rx peer unmap message sent
  12129. * from the target to the host.
  12130. *
  12131. * |31 24|23 16|15 8|7 0|
  12132. * |-----------------------------------------------------------------------|
  12133. * | SW peer ID | VDEV ID | msg type |
  12134. * |-----------------------------------------------------------------------|
  12135. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12136. * |-----------------------------------------------------------------------|
  12137. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12138. * |-----------------------------------------------------------------------|
  12139. * | Peer Delete Duration |
  12140. * |-----------------------------------------------------------------------|
  12141. * | Reserved_0 | WDS Free Count |
  12142. * |-----------------------------------------------------------------------|
  12143. * | Reserved_1 |
  12144. * |-----------------------------------------------------------------------|
  12145. * | Reserved_2 |
  12146. * |-----------------------------------------------------------------------|
  12147. *
  12148. *
  12149. * The following field definitions describe the format of the rx peer unmap
  12150. * messages sent from the target to the host.
  12151. * - MSG_TYPE
  12152. * Bits 7:0
  12153. * Purpose: identifies this as an rx peer unmap v2 message
  12154. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12155. * - VDEV_ID
  12156. * Bits 15:8
  12157. * Purpose: Indicates which virtual device the peer is associated
  12158. * with.
  12159. * Value: vdev ID (used in the host to look up the vdev object)
  12160. * - SW_PEER_ID
  12161. * Bits 31:16
  12162. * Purpose: The peer ID (index) that WAL is freeing
  12163. * Value: (rx) peer ID
  12164. * - MAC_ADDR_L32
  12165. * Bits 31:0
  12166. * Purpose: Identifies which peer node the peer ID is for.
  12167. * Value: lower 4 bytes of peer node's MAC address
  12168. * - MAC_ADDR_U16
  12169. * Bits 15:0
  12170. * Purpose: Identifies which peer node the peer ID is for.
  12171. * Value: upper 2 bytes of peer node's MAC address
  12172. * - NEXT_HOP
  12173. * Bits 16
  12174. * Purpose: Bit indicates next_hop AST entry used for WDS
  12175. * (Wireless Distribution System).
  12176. * - PEER_DELETE_DURATION
  12177. * Bits 31:0
  12178. * Purpose: Time taken to delete peer, in msec,
  12179. * Used for monitoring / debugging PEER delete response delay
  12180. * - PEER_WDS_FREE_COUNT
  12181. * Bits 15:0
  12182. * Purpose: Count of WDS entries deleted associated to peer deleted
  12183. */
  12184. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12185. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12186. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12187. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12188. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12189. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12190. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12191. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12192. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12193. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12194. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12195. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12196. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12197. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12198. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12199. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12200. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12201. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12202. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12203. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12204. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12205. do { \
  12206. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12207. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12208. } while (0)
  12209. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12210. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12211. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12212. do { \
  12213. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12214. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12215. } while (0)
  12216. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12217. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12218. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12219. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12220. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12221. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12222. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12223. /**
  12224. * @brief target -> host rx peer mlo map message definition
  12225. *
  12226. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12227. *
  12228. * @details
  12229. * The following diagram shows the format of the rx mlo peer map message sent
  12230. * from the target to the host. This layout assumes the target operates
  12231. * as little-endian.
  12232. *
  12233. * MCC:
  12234. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12235. *
  12236. * WIN:
  12237. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12238. * It will be sent on the Assoc Link.
  12239. *
  12240. * This message always contains a MLO peer ID. The main purpose of the
  12241. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12242. * with, so that the host can use that MLO peer ID to determine which peer
  12243. * transmitted the rx frame.
  12244. *
  12245. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12246. * |-------------------------------------------------------------------------|
  12247. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12248. * |-------------------------------------------------------------------------|
  12249. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12250. * |-------------------------------------------------------------------------|
  12251. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12252. * |-------------------------------------------------------------------------|
  12253. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12254. * |-------------------------------------------------------------------------|
  12255. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12256. * |-------------------------------------------------------------------------|
  12257. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12258. * |-------------------------------------------------------------------------|
  12259. * |RSVD |
  12260. * |-------------------------------------------------------------------------|
  12261. * |RSVD |
  12262. * |-------------------------------------------------------------------------|
  12263. * | htt_tlv_hdr_t |
  12264. * |-------------------------------------------------------------------------|
  12265. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12266. * |-------------------------------------------------------------------------|
  12267. * | htt_tlv_hdr_t |
  12268. * |-------------------------------------------------------------------------|
  12269. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12270. * |-------------------------------------------------------------------------|
  12271. * | htt_tlv_hdr_t |
  12272. * |-------------------------------------------------------------------------|
  12273. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12274. * |-------------------------------------------------------------------------|
  12275. *
  12276. * Where:
  12277. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12278. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12279. * V (valid) - 1 Bit Bit17
  12280. * CHIPID - 3 Bits
  12281. * TIDMASK - 8 Bits
  12282. * CACHE_SET_NUM - 8 Bits
  12283. *
  12284. * The following field definitions describe the format of the rx MLO peer map
  12285. * messages sent from the target to the host.
  12286. * - MSG_TYPE
  12287. * Bits 7:0
  12288. * Purpose: identifies this as an rx mlo peer map message
  12289. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12290. *
  12291. * - MLO_PEER_ID
  12292. * Bits 23:8
  12293. * Purpose: The MLO peer ID (index).
  12294. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12295. * Value: MLO peer ID
  12296. *
  12297. * - NUMLINK
  12298. * Bits: 26:24 (3Bits)
  12299. * Purpose: Indicate the max number of logical links supported per client.
  12300. * Value: number of logical links
  12301. *
  12302. * - PRC
  12303. * Bits: 29:27 (3Bits)
  12304. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12305. * if there is migration of the primary chip.
  12306. * Value: Primary REO CHIPID
  12307. *
  12308. * - MAC_ADDR_L32
  12309. * Bits 31:0
  12310. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12311. * Value: lower 4 bytes of peer node's MAC address
  12312. *
  12313. * - MAC_ADDR_U16
  12314. * Bits 15:0
  12315. * Purpose: Identifies which peer node the peer ID is for.
  12316. * Value: upper 2 bytes of peer node's MAC address
  12317. *
  12318. * - PRIMARY_TCL_AST_IDX
  12319. * Bits 15:0
  12320. * Purpose: Primary TCL AST index for this peer.
  12321. *
  12322. * - V
  12323. * 1 Bit Position 16
  12324. * Purpose: If the ast idx is valid.
  12325. *
  12326. * - CHIPID
  12327. * Bits 19:17
  12328. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12329. *
  12330. * - TIDMASK
  12331. * Bits 27:20
  12332. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12333. *
  12334. * - CACHE_SET_NUM
  12335. * Bits 31:28
  12336. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12337. * Cache set number that should be used to cache the index based
  12338. * search results, for address and flow search.
  12339. * This value should be equal to LSB four bits of the hash value
  12340. * of match data, in case of search index points to an entry which
  12341. * may be used in content based search also. The value can be
  12342. * anything when the entry pointed by search index will not be
  12343. * used for content based search.
  12344. *
  12345. * - htt_tlv_hdr_t
  12346. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12347. *
  12348. * Bits 11:0
  12349. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12350. *
  12351. * Bits 23:12
  12352. * Purpose: Length, Length of the value that follows the header
  12353. *
  12354. * Bits 31:28
  12355. * Purpose: Reserved.
  12356. *
  12357. *
  12358. * - SW_PEER_ID
  12359. * Bits 15:0
  12360. * Purpose: The peer ID (index) that WAL is allocating
  12361. * Value: (rx) peer ID
  12362. *
  12363. * - VDEV_ID
  12364. * Bits 23:16
  12365. * Purpose: Indicates which virtual device the peer is associated with.
  12366. * Value: vdev ID (used in the host to look up the vdev object)
  12367. *
  12368. * - CHIPID
  12369. * Bits 26:24
  12370. * Purpose: Indicates which Chip id the peer is associated with.
  12371. * Value: chip ID (Provided by Host as part of QMI exchange)
  12372. */
  12373. typedef enum {
  12374. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12375. } MLO_PEER_MAP_TLV_TAG_ID;
  12376. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12377. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12378. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12379. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12380. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12381. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12382. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12383. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12384. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12385. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12386. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12387. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12388. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12389. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12390. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12391. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12392. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12393. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12394. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12395. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12396. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12397. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12398. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12399. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12400. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12401. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12402. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12403. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12404. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12405. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12406. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12407. do { \
  12408. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12409. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12410. } while (0)
  12411. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12412. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12413. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12414. do { \
  12415. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12416. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12417. } while (0)
  12418. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12419. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12420. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12421. do { \
  12422. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12423. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12424. } while (0)
  12425. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12426. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12427. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12428. do { \
  12429. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12430. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12431. } while (0)
  12432. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12433. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12434. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12437. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12438. } while (0)
  12439. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12440. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12441. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12444. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12445. } while (0)
  12446. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12447. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12448. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12451. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12452. } while (0)
  12453. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12454. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12455. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12458. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12459. } while (0)
  12460. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12461. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12462. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12465. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12466. } while (0)
  12467. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12468. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12469. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12470. do { \
  12471. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12472. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12473. } while (0)
  12474. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12475. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12476. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12477. do { \
  12478. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12479. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12480. } while (0)
  12481. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12482. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12483. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12484. do { \
  12485. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12486. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12487. } while (0)
  12488. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12489. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12490. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12491. do { \
  12492. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12493. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12494. } while (0)
  12495. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12496. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12497. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12498. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12499. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12500. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12501. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12502. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12503. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12504. *
  12505. * The following diagram shows the format of the rx mlo peer unmap message sent
  12506. * from the target to the host.
  12507. *
  12508. * |31 24|23 16|15 8|7 0|
  12509. * |-----------------------------------------------------------------------|
  12510. * | RSVD_24_31 | MLO peer ID | msg type |
  12511. * |-----------------------------------------------------------------------|
  12512. */
  12513. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12514. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12515. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12516. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12517. /**
  12518. * @brief target -> host message specifying security parameters
  12519. *
  12520. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12521. *
  12522. * @details
  12523. * The following diagram shows the format of the security specification
  12524. * message sent from the target to the host.
  12525. * This security specification message tells the host whether a PN check is
  12526. * necessary on rx data frames, and if so, how large the PN counter is.
  12527. * This message also tells the host about the security processing to apply
  12528. * to defragmented rx frames - specifically, whether a Message Integrity
  12529. * Check is required, and the Michael key to use.
  12530. *
  12531. * |31 24|23 16|15|14 8|7 0|
  12532. * |-----------------------------------------------------------------------|
  12533. * | peer ID | U| security type | msg type |
  12534. * |-----------------------------------------------------------------------|
  12535. * | Michael Key K0 |
  12536. * |-----------------------------------------------------------------------|
  12537. * | Michael Key K1 |
  12538. * |-----------------------------------------------------------------------|
  12539. * | WAPI RSC Low0 |
  12540. * |-----------------------------------------------------------------------|
  12541. * | WAPI RSC Low1 |
  12542. * |-----------------------------------------------------------------------|
  12543. * | WAPI RSC Hi0 |
  12544. * |-----------------------------------------------------------------------|
  12545. * | WAPI RSC Hi1 |
  12546. * |-----------------------------------------------------------------------|
  12547. *
  12548. * The following field definitions describe the format of the security
  12549. * indication message sent from the target to the host.
  12550. * - MSG_TYPE
  12551. * Bits 7:0
  12552. * Purpose: identifies this as a security specification message
  12553. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12554. * - SEC_TYPE
  12555. * Bits 14:8
  12556. * Purpose: specifies which type of security applies to the peer
  12557. * Value: htt_sec_type enum value
  12558. * - UNICAST
  12559. * Bit 15
  12560. * Purpose: whether this security is applied to unicast or multicast data
  12561. * Value: 1 -> unicast, 0 -> multicast
  12562. * - PEER_ID
  12563. * Bits 31:16
  12564. * Purpose: The ID number for the peer the security specification is for
  12565. * Value: peer ID
  12566. * - MICHAEL_KEY_K0
  12567. * Bits 31:0
  12568. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12569. * Value: Michael Key K0 (if security type is TKIP)
  12570. * - MICHAEL_KEY_K1
  12571. * Bits 31:0
  12572. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12573. * Value: Michael Key K1 (if security type is TKIP)
  12574. * - WAPI_RSC_LOW0
  12575. * Bits 31:0
  12576. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12577. * Value: WAPI RSC Low0 (if security type is WAPI)
  12578. * - WAPI_RSC_LOW1
  12579. * Bits 31:0
  12580. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12581. * Value: WAPI RSC Low1 (if security type is WAPI)
  12582. * - WAPI_RSC_HI0
  12583. * Bits 31:0
  12584. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12585. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12586. * - WAPI_RSC_HI1
  12587. * Bits 31:0
  12588. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12589. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12590. */
  12591. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12592. #define HTT_SEC_IND_SEC_TYPE_S 8
  12593. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12594. #define HTT_SEC_IND_UNICAST_S 15
  12595. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12596. #define HTT_SEC_IND_PEER_ID_S 16
  12597. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12598. do { \
  12599. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12600. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12601. } while (0)
  12602. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12603. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12604. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12605. do { \
  12606. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12607. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12608. } while (0)
  12609. #define HTT_SEC_IND_UNICAST_GET(word) \
  12610. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12611. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12612. do { \
  12613. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12614. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12615. } while (0)
  12616. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12617. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12618. #define HTT_SEC_IND_BYTES 28
  12619. /**
  12620. * @brief target -> host rx ADDBA / DELBA message definitions
  12621. *
  12622. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12623. *
  12624. * @details
  12625. * The following diagram shows the format of the rx ADDBA message sent
  12626. * from the target to the host:
  12627. *
  12628. * |31 20|19 16|15 8|7 0|
  12629. * |---------------------------------------------------------------------|
  12630. * | peer ID | TID | window size | msg type |
  12631. * |---------------------------------------------------------------------|
  12632. *
  12633. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12634. *
  12635. * The following diagram shows the format of the rx DELBA message sent
  12636. * from the target to the host:
  12637. *
  12638. * |31 20|19 16|15 10|9 8|7 0|
  12639. * |---------------------------------------------------------------------|
  12640. * | peer ID | TID | window size | IR| msg type |
  12641. * |---------------------------------------------------------------------|
  12642. *
  12643. * The following field definitions describe the format of the rx ADDBA
  12644. * and DELBA messages sent from the target to the host.
  12645. * - MSG_TYPE
  12646. * Bits 7:0
  12647. * Purpose: identifies this as an rx ADDBA or DELBA message
  12648. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12649. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12650. * - IR (initiator / recipient)
  12651. * Bits 9:8 (DELBA only)
  12652. * Purpose: specify whether the DELBA handshake was initiated by the
  12653. * local STA/AP, or by the peer STA/AP
  12654. * Value:
  12655. * 0 - unspecified
  12656. * 1 - initiator (a.k.a. originator)
  12657. * 2 - recipient (a.k.a. responder)
  12658. * 3 - unused / reserved
  12659. * - WIN_SIZE
  12660. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12661. * Purpose: Specifies the length of the block ack window (max = 64).
  12662. * Value:
  12663. * block ack window length specified by the received ADDBA/DELBA
  12664. * management message.
  12665. * - TID
  12666. * Bits 19:16
  12667. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12668. * Value:
  12669. * TID specified by the received ADDBA or DELBA management message.
  12670. * - PEER_ID
  12671. * Bits 31:20
  12672. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12673. * Value:
  12674. * ID (hash value) used by the host for fast, direct lookup of
  12675. * host SW peer info, including rx reorder states.
  12676. */
  12677. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12678. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12679. #define HTT_RX_ADDBA_TID_M 0xf0000
  12680. #define HTT_RX_ADDBA_TID_S 16
  12681. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12682. #define HTT_RX_ADDBA_PEER_ID_S 20
  12683. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12684. do { \
  12685. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12686. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12687. } while (0)
  12688. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12689. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12690. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12693. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12694. } while (0)
  12695. #define HTT_RX_ADDBA_TID_GET(word) \
  12696. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12697. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12698. do { \
  12699. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12700. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12701. } while (0)
  12702. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12703. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12704. #define HTT_RX_ADDBA_BYTES 4
  12705. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12706. #define HTT_RX_DELBA_INITIATOR_S 8
  12707. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12708. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12709. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12710. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12711. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12712. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12713. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12714. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12715. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12716. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12717. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12718. do { \
  12719. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12720. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12721. } while (0)
  12722. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12723. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12724. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12725. do { \
  12726. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12727. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12728. } while (0)
  12729. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12730. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12731. #define HTT_RX_DELBA_BYTES 4
  12732. /**
  12733. * @brief target -> host rx ADDBA / DELBA message definitions
  12734. *
  12735. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12736. *
  12737. * @details
  12738. * The following diagram shows the format of the rx ADDBA extn message sent
  12739. * from the target to the host:
  12740. *
  12741. * |31 20|19 16|15 13|12 8|7 0|
  12742. * |---------------------------------------------------------------------|
  12743. * | peer ID | TID | reserved | msg type |
  12744. * |---------------------------------------------------------------------|
  12745. * | reserved | window size |
  12746. * |---------------------------------------------------------------------|
  12747. *
  12748. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12749. *
  12750. * The following diagram shows the format of the rx DELBA message sent
  12751. * from the target to the host:
  12752. *
  12753. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12754. * |---------------------------------------------------------------------|
  12755. * | peer ID | TID | reserved | IR| msg type |
  12756. * |---------------------------------------------------------------------|
  12757. * | reserved | window size |
  12758. * |---------------------------------------------------------------------|
  12759. *
  12760. * The following field definitions describe the format of the rx ADDBA
  12761. * and DELBA messages sent from the target to the host.
  12762. * - MSG_TYPE
  12763. * Bits 7:0
  12764. * Purpose: identifies this as an rx ADDBA or DELBA message
  12765. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12766. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12767. * - IR (initiator / recipient)
  12768. * Bits 9:8 (DELBA only)
  12769. * Purpose: specify whether the DELBA handshake was initiated by the
  12770. * local STA/AP, or by the peer STA/AP
  12771. * Value:
  12772. * 0 - unspecified
  12773. * 1 - initiator (a.k.a. originator)
  12774. * 2 - recipient (a.k.a. responder)
  12775. * 3 - unused / reserved
  12776. * Value:
  12777. * block ack window length specified by the received ADDBA/DELBA
  12778. * management message.
  12779. * - TID
  12780. * Bits 19:16
  12781. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12782. * Value:
  12783. * TID specified by the received ADDBA or DELBA management message.
  12784. * - PEER_ID
  12785. * Bits 31:20
  12786. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12787. * Value:
  12788. * ID (hash value) used by the host for fast, direct lookup of
  12789. * host SW peer info, including rx reorder states.
  12790. * == DWORD 1
  12791. * - WIN_SIZE
  12792. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12793. * Purpose: Specifies the length of the block ack window (max = 8191).
  12794. */
  12795. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12796. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12797. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12798. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12799. /*--- Dword 0 ---*/
  12800. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12801. do { \
  12802. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12803. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12804. } while (0)
  12805. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12806. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12807. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12808. do { \
  12809. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12810. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12811. } while (0)
  12812. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12813. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12814. /*--- Dword 1 ---*/
  12815. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12816. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12817. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12818. do { \
  12819. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12820. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12821. } while (0)
  12822. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12823. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12824. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12825. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12826. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12827. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12828. #define HTT_RX_DELBA_EXTN_TID_S 16
  12829. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12830. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12831. /*--- Dword 0 ---*/
  12832. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12833. do { \
  12834. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12835. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12836. } while (0)
  12837. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12838. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12839. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12840. do { \
  12841. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12842. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12843. } while (0)
  12844. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12845. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12846. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12847. do { \
  12848. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12849. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12850. } while (0)
  12851. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12852. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12853. /*--- Dword 1 ---*/
  12854. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12855. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12856. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12857. do { \
  12858. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12859. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12860. } while (0)
  12861. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12862. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12863. #define HTT_RX_DELBA_EXTN_BYTES 8
  12864. /**
  12865. * @brief tx queue group information element definition
  12866. *
  12867. * @details
  12868. * The following diagram shows the format of the tx queue group
  12869. * information element, which can be included in target --> host
  12870. * messages to specify the number of tx "credits" (tx descriptors
  12871. * for LL, or tx buffers for HL) available to a particular group
  12872. * of host-side tx queues, and which host-side tx queues belong to
  12873. * the group.
  12874. *
  12875. * |31|30 24|23 16|15|14|13 0|
  12876. * |------------------------------------------------------------------------|
  12877. * | X| reserved | tx queue grp ID | A| S| credit count |
  12878. * |------------------------------------------------------------------------|
  12879. * | vdev ID mask | AC mask |
  12880. * |------------------------------------------------------------------------|
  12881. *
  12882. * The following definitions describe the fields within the tx queue group
  12883. * information element:
  12884. * - credit_count
  12885. * Bits 13:1
  12886. * Purpose: specify how many tx credits are available to the tx queue group
  12887. * Value: An absolute or relative, positive or negative credit value
  12888. * The 'A' bit specifies whether the value is absolute or relative.
  12889. * The 'S' bit specifies whether the value is positive or negative.
  12890. * A negative value can only be relative, not absolute.
  12891. * An absolute value replaces any prior credit value the host has for
  12892. * the tx queue group in question.
  12893. * A relative value is added to the prior credit value the host has for
  12894. * the tx queue group in question.
  12895. * - sign
  12896. * Bit 14
  12897. * Purpose: specify whether the credit count is positive or negative
  12898. * Value: 0 -> positive, 1 -> negative
  12899. * - absolute
  12900. * Bit 15
  12901. * Purpose: specify whether the credit count is absolute or relative
  12902. * Value: 0 -> relative, 1 -> absolute
  12903. * - txq_group_id
  12904. * Bits 23:16
  12905. * Purpose: indicate which tx queue group's credit and/or membership are
  12906. * being specified
  12907. * Value: 0 to max_tx_queue_groups-1
  12908. * - reserved
  12909. * Bits 30:16
  12910. * Value: 0x0
  12911. * - eXtension
  12912. * Bit 31
  12913. * Purpose: specify whether another tx queue group info element follows
  12914. * Value: 0 -> no more tx queue group information elements
  12915. * 1 -> another tx queue group information element immediately follows
  12916. * - ac_mask
  12917. * Bits 15:0
  12918. * Purpose: specify which Access Categories belong to the tx queue group
  12919. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12920. * the tx queue group.
  12921. * The AC bit-mask values are obtained by left-shifting by the
  12922. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12923. * - vdev_id_mask
  12924. * Bits 31:16
  12925. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12926. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12927. * belong to the tx queue group.
  12928. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12929. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12930. */
  12931. PREPACK struct htt_txq_group {
  12932. A_UINT32
  12933. credit_count: 14,
  12934. sign: 1,
  12935. absolute: 1,
  12936. tx_queue_group_id: 8,
  12937. reserved0: 7,
  12938. extension: 1;
  12939. A_UINT32
  12940. ac_mask: 16,
  12941. vdev_id_mask: 16;
  12942. } POSTPACK;
  12943. /* first word */
  12944. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12945. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12946. #define HTT_TXQ_GROUP_SIGN_S 14
  12947. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12948. #define HTT_TXQ_GROUP_ABS_S 15
  12949. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12950. #define HTT_TXQ_GROUP_ID_S 16
  12951. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12952. #define HTT_TXQ_GROUP_EXT_S 31
  12953. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12954. /* second word */
  12955. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12956. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12957. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12958. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12959. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12960. do { \
  12961. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12962. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12963. } while (0)
  12964. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12965. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12966. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12967. do { \
  12968. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12969. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12970. } while (0)
  12971. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12972. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12973. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12974. do { \
  12975. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12976. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12977. } while (0)
  12978. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12979. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12980. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12981. do { \
  12982. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12983. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12984. } while (0)
  12985. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12986. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12987. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12988. do { \
  12989. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12990. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12991. } while (0)
  12992. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12993. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12994. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12995. do { \
  12996. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12997. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12998. } while (0)
  12999. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  13000. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  13001. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  13002. do { \
  13003. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13004. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13005. } while (0)
  13006. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13007. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13008. /**
  13009. * @brief target -> host TX completion indication message definition
  13010. *
  13011. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13012. *
  13013. * @details
  13014. * The following diagram shows the format of the TX completion indication sent
  13015. * from the target to the host
  13016. *
  13017. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13018. * |-------------------------------------------------------------------|
  13019. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13020. * |-------------------------------------------------------------------|
  13021. * payload:| MSDU1 ID | MSDU0 ID |
  13022. * |-------------------------------------------------------------------|
  13023. * : MSDU3 ID | MSDU2 ID :
  13024. * |-------------------------------------------------------------------|
  13025. * | struct htt_tx_compl_ind_append_retries |
  13026. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13027. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13028. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13029. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13030. * |-------------------------------------------------------------------|
  13031. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13032. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13033. * | MSDU0 tx_tsf64_low |
  13034. * |-------------------------------------------------------------------|
  13035. * | MSDU0 tx_tsf64_high |
  13036. * |-------------------------------------------------------------------|
  13037. * | MSDU1 tx_tsf64_low |
  13038. * |-------------------------------------------------------------------|
  13039. * | MSDU1 tx_tsf64_high |
  13040. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13041. * | phy_timestamp |
  13042. * |-------------------------------------------------------------------|
  13043. * | rate specs (see below) |
  13044. * |-------------------------------------------------------------------|
  13045. * | seqctrl | framectrl |
  13046. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13047. * Where:
  13048. * A0 = append (a.k.a. append0)
  13049. * A1 = append1
  13050. * TP = MSDU tx power presence
  13051. * A2 = append2
  13052. * A3 = append3
  13053. * A4 = append4
  13054. *
  13055. * The following field definitions describe the format of the TX completion
  13056. * indication sent from the target to the host
  13057. * Header fields:
  13058. * - msg_type
  13059. * Bits 7:0
  13060. * Purpose: identifies this as HTT TX completion indication
  13061. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13062. * - status
  13063. * Bits 10:8
  13064. * Purpose: the TX completion status of payload fragmentations descriptors
  13065. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13066. * - tid
  13067. * Bits 14:11
  13068. * Purpose: the tid associated with those fragmentation descriptors. It is
  13069. * valid or not, depending on the tid_invalid bit.
  13070. * Value: 0 to 15
  13071. * - tid_invalid
  13072. * Bits 15:15
  13073. * Purpose: this bit indicates whether the tid field is valid or not
  13074. * Value: 0 indicates valid; 1 indicates invalid
  13075. * - num
  13076. * Bits 23:16
  13077. * Purpose: the number of payload in this indication
  13078. * Value: 1 to 255
  13079. * - append (a.k.a. append0)
  13080. * Bits 24:24
  13081. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13082. * the number of tx retries for one MSDU at the end of this message
  13083. * Value: 0 indicates no appending; 1 indicates appending
  13084. * - append1
  13085. * Bits 25:25
  13086. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13087. * contains the timestamp info for each TX msdu id in payload.
  13088. * The order of the timestamps matches the order of the MSDU IDs.
  13089. * Note that a big-endian host needs to account for the reordering
  13090. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13091. * conversion) when determining which tx timestamp corresponds to
  13092. * which MSDU ID.
  13093. * Value: 0 indicates no appending; 1 indicates appending
  13094. * - msdu_tx_power_presence
  13095. * Bits 26:26
  13096. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13097. * for each MSDU referenced by the TX_COMPL_IND message.
  13098. * The tx power is reported in 0.5 dBm units.
  13099. * The order of the per-MSDU tx power reports matches the order
  13100. * of the MSDU IDs.
  13101. * Note that a big-endian host needs to account for the reordering
  13102. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13103. * conversion) when determining which Tx Power corresponds to
  13104. * which MSDU ID.
  13105. * Value: 0 indicates MSDU tx power reports are not appended,
  13106. * 1 indicates MSDU tx power reports are appended
  13107. * - append2
  13108. * Bits 27:27
  13109. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13110. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13111. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13112. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13113. * for each MSDU, for convenience.
  13114. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13115. * this append2 bit is set).
  13116. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13117. * dB above the noise floor.
  13118. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13119. * 1 indicates MSDU ACK RSSI values are appended.
  13120. * - append3
  13121. * Bits 28:28
  13122. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13123. * contains the tx tsf info based on wlan global TSF for
  13124. * each TX msdu id in payload.
  13125. * The order of the tx tsf matches the order of the MSDU IDs.
  13126. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13127. * values to indicate the the lower 32 bits and higher 32 bits of
  13128. * the tx tsf.
  13129. * The tx_tsf64 here represents the time MSDU was acked and the
  13130. * tx_tsf64 has microseconds units.
  13131. * Value: 0 indicates no appending; 1 indicates appending
  13132. * - append4
  13133. * Bits 29:29
  13134. * Purpose: Indicate whether data frame control fields and fields required
  13135. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13136. * message. The order of the this message matches the order of
  13137. * the MSDU IDs.
  13138. * Value: 0 indicates frame control fields and fields required for
  13139. * radio tap header values are not appended,
  13140. * 1 indicates frame control fields and fields required for
  13141. * radio tap header values are appended.
  13142. * Payload fields:
  13143. * - hmsdu_id
  13144. * Bits 15:0
  13145. * Purpose: this ID is used to track the Tx buffer in host
  13146. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13147. */
  13148. PREPACK struct htt_tx_data_hdr_information {
  13149. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13150. A_UINT32 /* word 1 */
  13151. /* preamble:
  13152. * 0-OFDM,
  13153. * 1-CCk,
  13154. * 2-HT,
  13155. * 3-VHT
  13156. */
  13157. preamble: 2, /* [1:0] */
  13158. /* mcs:
  13159. * In case of HT preamble interpret
  13160. * MCS along with NSS.
  13161. * Valid values for HT are 0 to 7.
  13162. * HT mcs 0 with NSS 2 is mcs 8.
  13163. * Valid values for VHT are 0 to 9.
  13164. */
  13165. mcs: 4, /* [5:2] */
  13166. /* rate:
  13167. * This is applicable only for
  13168. * CCK and OFDM preamble type
  13169. * rate 0: OFDM 48 Mbps,
  13170. * 1: OFDM 24 Mbps,
  13171. * 2: OFDM 12 Mbps
  13172. * 3: OFDM 6 Mbps
  13173. * 4: OFDM 54 Mbps
  13174. * 5: OFDM 36 Mbps
  13175. * 6: OFDM 18 Mbps
  13176. * 7: OFDM 9 Mbps
  13177. * rate 0: CCK 11 Mbps Long
  13178. * 1: CCK 5.5 Mbps Long
  13179. * 2: CCK 2 Mbps Long
  13180. * 3: CCK 1 Mbps Long
  13181. * 4: CCK 11 Mbps Short
  13182. * 5: CCK 5.5 Mbps Short
  13183. * 6: CCK 2 Mbps Short
  13184. */
  13185. rate : 3, /* [ 8: 6] */
  13186. rssi : 8, /* [16: 9] units=dBm */
  13187. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13188. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13189. stbc : 1, /* [22] */
  13190. sgi : 1, /* [23] */
  13191. ldpc : 1, /* [24] */
  13192. beamformed: 1, /* [25] */
  13193. /* tx_retry_cnt:
  13194. * Indicates retry count of data tx frames provided by the host.
  13195. */
  13196. tx_retry_cnt: 6; /* [31:26] */
  13197. A_UINT32 /* word 2 */
  13198. framectrl:16, /* [15: 0] */
  13199. seqno:16; /* [31:16] */
  13200. } POSTPACK;
  13201. #define HTT_TX_COMPL_IND_STATUS_S 8
  13202. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13203. #define HTT_TX_COMPL_IND_TID_S 11
  13204. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13205. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13206. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13207. #define HTT_TX_COMPL_IND_NUM_S 16
  13208. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13209. #define HTT_TX_COMPL_IND_APPEND_S 24
  13210. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13211. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13212. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13213. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13214. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13215. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13216. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13217. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13218. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13219. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13220. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13221. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13222. do { \
  13223. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13224. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13225. } while (0)
  13226. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13227. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13228. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13229. do { \
  13230. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13231. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13232. } while (0)
  13233. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13234. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13235. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13236. do { \
  13237. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13238. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13239. } while (0)
  13240. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13241. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13242. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13243. do { \
  13244. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13245. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13246. } while (0)
  13247. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13248. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13249. HTT_TX_COMPL_IND_TID_INV_S)
  13250. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13251. do { \
  13252. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13253. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13254. } while (0)
  13255. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13256. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13257. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13260. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13261. } while (0)
  13262. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13263. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13264. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13267. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13268. } while (0)
  13269. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13270. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13271. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13272. do { \
  13273. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13274. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13275. } while (0)
  13276. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13277. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13278. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13279. do { \
  13280. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13281. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13282. } while (0)
  13283. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13284. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13285. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13286. do { \
  13287. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13288. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13289. } while (0)
  13290. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13291. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13292. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13293. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13294. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13295. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13296. #define HTT_TX_COMPL_IND_STAT_OK 0
  13297. /* DISCARD:
  13298. * current meaning:
  13299. * MSDUs were queued for transmission but filtered by HW or SW
  13300. * without any over the air attempts
  13301. * legacy meaning (HL Rome):
  13302. * MSDUs were discarded by the target FW without any over the air
  13303. * attempts due to lack of space
  13304. */
  13305. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13306. /* NO_ACK:
  13307. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13308. */
  13309. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13310. /* POSTPONE:
  13311. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13312. * be downloaded again later (in the appropriate order), when they are
  13313. * deliverable.
  13314. */
  13315. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13316. /*
  13317. * The PEER_DEL tx completion status is used for HL cases
  13318. * where the peer the frame is for has been deleted.
  13319. * The host has already discarded its copy of the frame, but
  13320. * it still needs the tx completion to restore its credit.
  13321. */
  13322. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13323. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13324. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13325. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13326. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13327. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13328. PREPACK struct htt_tx_compl_ind_base {
  13329. A_UINT32 hdr;
  13330. A_UINT16 payload[1/*or more*/];
  13331. } POSTPACK;
  13332. PREPACK struct htt_tx_compl_ind_append_retries {
  13333. A_UINT16 msdu_id;
  13334. A_UINT8 tx_retries;
  13335. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13336. 0: this is the last append_retries struct */
  13337. } POSTPACK;
  13338. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13339. A_UINT32 timestamp[1/*or more*/];
  13340. } POSTPACK;
  13341. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13342. A_UINT32 tx_tsf64_low;
  13343. A_UINT32 tx_tsf64_high;
  13344. } POSTPACK;
  13345. /* htt_tx_data_hdr_information payload extension fields: */
  13346. /* DWORD zero */
  13347. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13348. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13349. /* DWORD one */
  13350. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13351. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13352. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13353. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13354. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13355. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13356. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13357. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13358. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13359. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13360. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13361. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13362. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13363. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13364. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13365. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13366. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13367. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13368. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13369. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13370. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13371. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13372. /* DWORD two */
  13373. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13374. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13375. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13376. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13377. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13378. do { \
  13379. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13380. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13381. } while (0)
  13382. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13383. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13384. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13385. do { \
  13386. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13387. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13388. } while (0)
  13389. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13390. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13391. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13392. do { \
  13393. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13394. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13395. } while (0)
  13396. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13397. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13398. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13399. do { \
  13400. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13401. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13402. } while (0)
  13403. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13404. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13405. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13406. do { \
  13407. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13408. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13409. } while (0)
  13410. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13411. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13412. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13413. do { \
  13414. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13415. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13416. } while (0)
  13417. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13418. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13419. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13420. do { \
  13421. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13422. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13423. } while (0)
  13424. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13425. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13426. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13427. do { \
  13428. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13429. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13430. } while (0)
  13431. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13432. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13433. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13434. do { \
  13435. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13436. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13437. } while (0)
  13438. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13439. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13440. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13441. do { \
  13442. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13443. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13444. } while (0)
  13445. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13446. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13447. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13448. do { \
  13449. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13450. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13451. } while (0)
  13452. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13453. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13454. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13455. do { \
  13456. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13457. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13458. } while (0)
  13459. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13460. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13461. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13462. do { \
  13463. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13464. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13465. } while (0)
  13466. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13467. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13468. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13469. do { \
  13470. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13471. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13472. } while (0)
  13473. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13474. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13475. /**
  13476. * @brief target -> host software UMAC TX completion indication message
  13477. *
  13478. * MSG_TYPE => HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND
  13479. *
  13480. * @details
  13481. * The following diagram shows the format of the soft UMAC TX completion
  13482. * indication sent from the target to the host
  13483. *
  13484. * |31 30|29|28|27|26 20|19 17|16|15 12|11|10| 9|8|7 4|3 1|0|
  13485. * |-------------------------------------+----------------+------------|
  13486. * hdr: | rsvd | msdu_cnt | msg_type |
  13487. * pyld: |===================================================================|
  13488. * MSDU 0| buf addr low (bits 31:0) |
  13489. * |-----------------------------------------------+------+------------|
  13490. * | SW buffer cookie | RS | buf addr hi|
  13491. * |--------+--+--+-------------+--------+---------+------+------------|
  13492. * | rsvd0 | M| V| tx count | TID | SW peer ID |
  13493. * |--------+--+--+-------------+--------+----------------------+------|
  13494. * | frametype | TQM status number | RELR |
  13495. * |-----+-----+-----------------------------------+--+-+-+-----+------|
  13496. * |rsvd1| buffer timestamp | A|L|F| ACK RSSI |
  13497. * |-----+--+-------------------------+--+------+-----+--+-+-----+---+-|
  13498. * | rsvd2 | tones in RU |OF|tx MCS|txSGI|LC|S|PKTYP|BW |I|
  13499. * |--------+-------------------------+--+------+-----+--+-+-----+---+-|
  13500. * | PPDU transmission TSF |
  13501. * |-------------------------------------------------------------------|
  13502. * | rsvd3 |
  13503. * |===================================================================|
  13504. * MSDU 1| buf addr low (bits 31:0) |
  13505. * : ... :
  13506. * | rsvd3 |
  13507. * |===================================================================|
  13508. * etc.
  13509. *
  13510. * Where:
  13511. * RS = release source
  13512. * V = valid
  13513. * M = multicast
  13514. * RELR = release reason
  13515. * F = first MSDU
  13516. * L = last MSDU
  13517. * A = MSDU is part of A-MSDU
  13518. * I = rate info valid
  13519. * PKTYP = packet type
  13520. * S = STBC
  13521. * LC = LDPC
  13522. * OF = OFDMA transmission
  13523. */
  13524. typedef enum {
  13525. /* 0 (REASON_FRAME_ACKED):
  13526. * Corresponds to tqm_release_reason = <enum 0 tqm_rr_frame_acked>;
  13527. * frame is removed because an ACK of BA for it was received.
  13528. */
  13529. HTT_TX_MSDU_RELEASE_REASON_FRAME_ACKED,
  13530. /* 1 (REASON_REMOVE_CMD_FW):
  13531. * Corresponds to tqm_release_reason = <enum 1 tqm_rr_rem_cmd_rem>;
  13532. * frame is removed because a remove command of type "Remove_mpdus"
  13533. * initiated by SW.
  13534. */
  13535. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_FW,
  13536. /* 2 (REASON_REMOVE_CMD_TX):
  13537. * Corresponds to tqm_release_reason = <enum 2 tqm_rr_rem_cmd_tx>;
  13538. * frame is removed because a remove command of type
  13539. * "Remove_transmitted_mpdus" initiated by SW.
  13540. */
  13541. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_TX,
  13542. /* 3 (REASON_REMOVE_CMD_NOTX):
  13543. * Corresponds to tqm_release_reason = <enum 3 tqm_rr_rem_cmd_notx>;
  13544. * frame is removed because a remove command of type
  13545. * "Remove_untransmitted_mpdus" initiated by SW.
  13546. */
  13547. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_NOTX,
  13548. /* 4 (REASON_REMOVE_CMD_AGED):
  13549. * Corresponds to tqm_release_reason = <enum 4 tqm_rr_rem_cmd_aged>;
  13550. * frame is removed because a remove command of type "Remove_aged_mpdus"
  13551. * or "Remove_aged_msdus" initiated by SW.
  13552. */
  13553. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_AGED,
  13554. /* 5 (RELEASE_FW_REASON1):
  13555. * Corresponds to tqm_release_reason = <enum 5 tqm_fw_reason1>;
  13556. * frame is removed because a remove command where fw indicated that
  13557. * remove reason is fw_reason1.
  13558. */
  13559. HTT_TX_MSDU_RELEASE_FW_REASON1,
  13560. /* 6 (RELEASE_FW_REASON2):
  13561. * Corresponds to tqm_release_reason = <enum 6 tqm_fw_reason2>;
  13562. * frame is removed because a remove command where fw indicated that
  13563. * remove reason is fw_reason1.
  13564. */
  13565. HTT_TX_MSDU_RELEASE_FW_REASON2,
  13566. /* 7 (RELEASE_FW_REASON3):
  13567. * Corresponds to tqm_release_reason = <enum 7 tqm_fw_reason3>;
  13568. * frame is removed because a remove command where fw indicated that
  13569. * remove reason is fw_reason1.
  13570. */
  13571. HTT_TX_MSDU_RELEASE_FW_REASON3,
  13572. /* 8 (REASON_REMOVE_CMD_DISABLEQ):
  13573. * Corresponds to tqm_release_reason = <enum 8 tqm_rr_rem_cmd_disable_queue>
  13574. * frame is removed because a remove command of type
  13575. * "remove_mpdus_and_disable_queue" or "remove_msdus_and_disable_flow"
  13576. * initiated by SW.
  13577. */
  13578. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_DISABLEQ,
  13579. /* 9 (REASON_DROP_MISC):
  13580. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13581. * any discard reason that is not categorized as MSDU TTL expired.
  13582. * Examples: TXDE ENQ layer dropped the packet due to peer delete,
  13583. * tid delete, no resource credit available.
  13584. */
  13585. HTT_TX_MSDU_RELEASE_REASON_DROP_MISC,
  13586. /* 10 (REASON_DROP_TTL):
  13587. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13588. * discard reason that frame is not transmitted due to MSDU TTL expired.
  13589. */
  13590. HTT_TX_MSDU_RELEASE_REASON_DROP_TTL,
  13591. /* 11 - available for use */
  13592. /* 12 - available for use */
  13593. /* 13 - available for use */
  13594. /* 14 - available for use */
  13595. /* 15 - available for use */
  13596. HTT_TX_MSDU_RELEASE_REASON_MAX = 16
  13597. } htt_t2h_tx_msdu_release_reason_e;
  13598. typedef enum {
  13599. /* 0 (RELEASE_SOURCE_FW):
  13600. * MSDU released by FW even before the frame was queued to TQM-L HW.
  13601. */
  13602. HTT_TX_MSDU_RELEASE_SOURCE_FW,
  13603. /* 1 (RELEASE_SOURCE_TQM_LITE):
  13604. * MSDU released by TQM-L HW.
  13605. */
  13606. HTT_TX_MSDU_RELEASE_SOURCE_TQM_LITE,
  13607. HTT_TX_MSDU_RELEASE_SOURCE_MAX = 8
  13608. } htt_t2h_tx_msdu_release_source_e;
  13609. struct htt_t2h_tx_buffer_addr_info { /* 2 words */
  13610. A_UINT32 buffer_addr_31_0 : 32; /* [31:0] */
  13611. A_UINT32 buffer_addr_39_32 : 8, /* [7:0] */
  13612. /* release_source:
  13613. * holds a htt_t2h_tx_msdu_release_source_e enum value
  13614. */
  13615. release_source : 3, /* [10:8] */
  13616. sw_buffer_cookie : 21; /* [31:11] */
  13617. /* NOTE:
  13618. * To preserve backwards compatibility,
  13619. * no new fields can be added in this struct.
  13620. */
  13621. };
  13622. /* member definitions of htt_t2h_tx_buffer_addr_info */
  13623. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M 0xFFFFFFFF
  13624. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S 0
  13625. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_SET(word, value) \
  13626. do { \
  13627. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0, value); \
  13628. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S; \
  13629. } while (0)
  13630. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_GET(word) \
  13631. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S)
  13632. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M 0x000000FF
  13633. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S 0
  13634. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_SET(word, value) \
  13635. do { \
  13636. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32, value); \
  13637. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S; \
  13638. } while (0)
  13639. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_GET(word) \
  13640. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S)
  13641. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M 0x00000700
  13642. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S 8
  13643. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_SET(word, value) \
  13644. do { \
  13645. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE, value); \
  13646. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S; \
  13647. } while (0)
  13648. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_GET(word) \
  13649. (((word) & HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M) >> HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S)
  13650. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M 0xFFFFF800
  13651. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S 11
  13652. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  13653. do { \
  13654. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE, value); \
  13655. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S; \
  13656. } while (0)
  13657. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_GET(word) \
  13658. (((word) & HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M) >> HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S)
  13659. struct htt_t2h_tx_rate_stats_info { /* 2 words */
  13660. /* word 0 */
  13661. A_UINT32
  13662. /* tx_rate_stats_info_valid:
  13663. * Indicates if the tx rate stats below are valid.
  13664. */
  13665. tx_rate_stats_info_valid : 1, /* [0] */
  13666. /* transmit_bw:
  13667. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13668. * Indicates the BW of the upcoming transmission that shall likely
  13669. * start in about 3 -4 us on the medium:
  13670. * <enum 0 transmit_bw_20_MHz>
  13671. * <enum 1 transmit_bw_40_MHz>
  13672. * <enum 2 transmit_bw_80_MHz>
  13673. * <enum 3 transmit_bw_160_MHz>
  13674. * <enum 4 transmit_bw_320_MHz>
  13675. */
  13676. transmit_bw : 3, /* [3:1] */
  13677. /* transmit_pkt_type:
  13678. * same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13679. * Field filled in by PDG.
  13680. * Not valid when in SW transmit mode
  13681. * The packet type
  13682. * <enum_type PKT_TYPE_ENUM>
  13683. * Type: enum Definition Name: PKT_TYPE_ENUM
  13684. * enum number enum name Description
  13685. * ------------------------------------
  13686. * 0 dot11a 802.11a PPDU type
  13687. * 1 dot11b 802.11b PPDU type
  13688. * 2 dot11n_mm 802.11n Mixed Mode PPDU type
  13689. * 3 dot11ac 802.11ac PPDU type
  13690. * 4 dot11ax 802.11ax PPDU type
  13691. * 5 dot11ba 802.11ba (WUR) PPDU type
  13692. * 6 dot11be 802.11be PPDU type
  13693. * 7 dot11az 802.11az (ranging) PPDU type
  13694. */
  13695. transmit_pkt_type : 4, /* [7:4] */
  13696. /* transmit_stbc:
  13697. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13698. * Field filled in by PDG.
  13699. * Not valid when in SW transmit mode
  13700. * When set, STBC transmission rate was used.
  13701. */
  13702. transmit_stbc : 1, /* [8] */
  13703. /* transmit_ldpc:
  13704. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13705. * Field filled in by PDG.
  13706. * Not valid when in SW transmit mode
  13707. * When set, use LDPC transmission rates
  13708. */
  13709. transmit_ldpc : 1, /* [9] */
  13710. /* transmit_sgi:
  13711. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13712. * Field filled in by PDG.
  13713. * Not valid when in SW transmit mode
  13714. * <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used for HE
  13715. * <enum 1 0_4_us_sgi > Legacy short GI. Can also be used for HE
  13716. * <enum 2 1_6_us_sgi > HE related GI
  13717. * <enum 3 3_2_us_sgi > HE related GI
  13718. * <legal 0 - 3>
  13719. */
  13720. transmit_sgi : 2, /* [11:10] */
  13721. /* transmit_mcs:
  13722. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13723. * Field filled in by PDG.
  13724. * Not valid when in SW transmit mode
  13725. *
  13726. * For details, refer to MCS_TYPE description
  13727. * <legal all>
  13728. * Pkt_type Related definition of MCS_TYPE
  13729. * dot11b This field is the rate:
  13730. * 0: CCK 11 Mbps Long
  13731. * 1: CCK 5.5 Mbps Long
  13732. * 2: CCK 2 Mbps Long
  13733. * 3: CCK 1 Mbps Long
  13734. * 4: CCK 11 Mbps Short
  13735. * 5: CCK 5.5 Mbps Short
  13736. * 6: CCK 2 Mbps Short
  13737. * NOTE: The numbering here is NOT the same as the as MAC gives
  13738. * in the "rate" field in the SIG given to the PHY.
  13739. * The MAC will do an internal translation.
  13740. *
  13741. * Dot11a This field is the rate:
  13742. * 0: OFDM 48 Mbps
  13743. * 1: OFDM 24 Mbps
  13744. * 2: OFDM 12 Mbps
  13745. * 3: OFDM 6 Mbps
  13746. * 4: OFDM 54 Mbps
  13747. * 5: OFDM 36 Mbps
  13748. * 6: OFDM 18 Mbps
  13749. * 7: OFDM 9 Mbps
  13750. * NOTE: The numbering here is NOT the same as the as MAC gives
  13751. * in the "rate" field in the SIG given to the PHY.
  13752. * The MAC will do an internal translation.
  13753. *
  13754. * Dot11n_mm (mixed mode) This field represends the MCS.
  13755. * 0: HT MCS 0 (BPSK 1/2)
  13756. * 1: HT MCS 1 (QPSK 1/2)
  13757. * 2: HT MCS 2 (QPSK 3/4)
  13758. * 3: HT MCS 3 (16-QAM 1/2)
  13759. * 4: HT MCS 4 (16-QAM 3/4)
  13760. * 5: HT MCS 5 (64-QAM 2/3)
  13761. * 6: HT MCS 6 (64-QAM 3/4)
  13762. * 7: HT MCS 7 (64-QAM 5/6)
  13763. * NOTE: To get higher MCS's use the nss field to indicate the
  13764. * number of spatial streams.
  13765. *
  13766. * Dot11ac This field represends the MCS.
  13767. * 0: VHT MCS 0 (BPSK 1/2)
  13768. * 1: VHT MCS 1 (QPSK 1/2)
  13769. * 2: VHT MCS 2 (QPSK 3/4)
  13770. * 3: VHT MCS 3 (16-QAM 1/2)
  13771. * 4: VHT MCS 4 (16-QAM 3/4)
  13772. * 5: VHT MCS 5 (64-QAM 2/3)
  13773. * 6: VHT MCS 6 (64-QAM 3/4)
  13774. * 7: VHT MCS 7 (64-QAM 5/6)
  13775. * 8: VHT MCS 8 (256-QAM 3/4)
  13776. * 9: VHT MCS 9 (256-QAM 5/6)
  13777. * 10: VHT MCS 10 (1024-QAM 3/4)
  13778. * 11: VHT MCS 11 (1024-QAM 5/6)
  13779. * NOTE: There are several illegal VHT rates due to fractional
  13780. * number of bits per symbol.
  13781. * Below are the illegal rates for 4 streams and lower:
  13782. * 20 MHz, 1 stream, MCS 9
  13783. * 20 MHz, 2 stream, MCS 9
  13784. * 20 MHz, 4 stream, MCS 9
  13785. * 80 MHz, 3 stream, MCS 6
  13786. * 160 MHz, 3 stream, MCS 9 (Unsupported)
  13787. * 160 MHz, 4 stream, MCS 7 (Unsupported)
  13788. *
  13789. * dot11ax This field represends the MCS.
  13790. * 0: HE MCS 0 (BPSK 1/2)
  13791. * 1: HE MCS 1 (QPSK 1/2)
  13792. * 2: HE MCS 2 (QPSK 3/4)
  13793. * 3: HE MCS 3 (16-QAM 1/2)
  13794. * 4: HE MCS 4 (16-QAM 3/4)
  13795. * 5: HE MCS 5 (64-QAM 2/3)
  13796. * 6: HE MCS 6 (64-QAM 3/4)
  13797. * 7: HE MCS 7 (64-QAM 5/6)
  13798. * 8: HE MCS 8 (256-QAM 3/4)
  13799. * 9: HE MCS 9 (256-QAM 5/6)
  13800. * 10: HE MCS 10 (1024-QAM 3/4)
  13801. * 11: HE MCS 11 (1024-QAM 5/6)
  13802. * 12: HE MCS 12 (4096-QAM 3/4)
  13803. * 13: HE MCS 13 (4096-QAM 5/6)
  13804. *
  13805. * dot11ba This field is the rate:
  13806. * 0: LDR
  13807. * 1: HDR
  13808. * 2: Q2Q proprietary rate
  13809. */
  13810. transmit_mcs : 4, /* [15:12] */
  13811. /* ofdma_transmission:
  13812. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13813. * Field filled in by PDG.
  13814. * Set when the transmission was an OFDMA transmission (DL or UL).
  13815. * <legal all>
  13816. */
  13817. ofdma_transmission : 1, /* [16] */
  13818. /* tones_in_ru:
  13819. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13820. * Field filled in by PDG.
  13821. * Not valid when in SW transmit mode
  13822. * The number of tones in the RU used.
  13823. * <legal all>
  13824. */
  13825. tones_in_ru : 12, /* [28:17] */
  13826. rsvd2 : 3; /* [31:29] */
  13827. /* word 1 */
  13828. /* ppdu_transmission_tsf:
  13829. * Based on a HWSCH configuration register setting,
  13830. * this field either contains:
  13831. * Lower 32 bits of the TSF, snapshot of this value when transmission
  13832. * of the PPDU containing the frame finished.
  13833. * OR
  13834. * Lower 32 bits of the TSF, snapshot of this value when transmission
  13835. * of the PPDU containing the frame started.
  13836. * <legal all>
  13837. */
  13838. A_UINT32 ppdu_transmission_tsf;
  13839. /* NOTE:
  13840. * To preserve backwards compatibility,
  13841. * no new fields can be added in this struct.
  13842. */
  13843. };
  13844. /* member definitions of htt_t2h_tx_rate_stats_info */
  13845. #define HTT_TX_RATE_STATS_INFO_VALID_M 0x00000001
  13846. #define HTT_TX_RATE_STATS_INFO_VALID_S 0
  13847. #define HTT_TX_RATE_STATS_INFO_VALID_SET(word, value) \
  13848. do { \
  13849. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_VALID, value); \
  13850. (word) |= (value) << HTT_TX_RATE_STATS_INFO_VALID_S; \
  13851. } while (0)
  13852. #define HTT_TX_RATE_STATS_INFO_VALID_GET(word) \
  13853. (((word) & HTT_TX_RATE_STATS_INFO_VALID_M) >> HTT_TX_RATE_STATS_INFO_VALID_S)
  13854. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M 0x0000000E
  13855. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S 1
  13856. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_SET(word, value) \
  13857. do { \
  13858. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_BW, value); \
  13859. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S; \
  13860. } while (0)
  13861. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_GET(word) \
  13862. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S)
  13863. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M 0x000000F0
  13864. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S 4
  13865. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_SET(word, value) \
  13866. do { \
  13867. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE, value); \
  13868. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S; \
  13869. } while (0)
  13870. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_GET(word) \
  13871. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S)
  13872. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M 0x00000100
  13873. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S 8
  13874. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_SET(word, value) \
  13875. do { \
  13876. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC, value); \
  13877. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S; \
  13878. } while (0)
  13879. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_GET(word) \
  13880. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S)
  13881. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M 0x00000200
  13882. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S 9
  13883. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_SET(word, value) \
  13884. do { \
  13885. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC, value); \
  13886. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S; \
  13887. } while (0)
  13888. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_GET(word) \
  13889. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S)
  13890. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M 0x00000C00
  13891. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S 10
  13892. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_SET(word, value) \
  13893. do { \
  13894. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI, value); \
  13895. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S; \
  13896. } while (0)
  13897. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_GET(word) \
  13898. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S)
  13899. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M 0x0000F000
  13900. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S 12
  13901. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_SET(word, value) \
  13902. do { \
  13903. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS, value); \
  13904. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S; \
  13905. } while (0)
  13906. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_GET(word) \
  13907. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S)
  13908. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M 0x00010000
  13909. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S 16
  13910. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_SET(word, value) \
  13911. do { \
  13912. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION, value); \
  13913. (word) |= (value) << HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S; \
  13914. } while (0)
  13915. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_GET(word) \
  13916. (((word) & HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M) >> HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S)
  13917. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M 0x1FFE0000
  13918. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S 17
  13919. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_SET(word, value) \
  13920. do { \
  13921. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TONES_IN_RU, value); \
  13922. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S; \
  13923. } while (0)
  13924. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_GET(word) \
  13925. (((word) & HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M) >> HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S)
  13926. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M 0xFFFFFFFF
  13927. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S 0
  13928. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_SET(word, value) \
  13929. do { \
  13930. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF, value); \
  13931. (word) |= (value) << HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S; \
  13932. } while (0)
  13933. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_GET(word) \
  13934. (((word) & HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M) >> HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S)
  13935. struct htt_t2h_tx_msdu_info { /* 8 words */
  13936. /* words 0 + 1 */
  13937. struct htt_t2h_tx_buffer_addr_info addr_info;
  13938. /* word 2 */
  13939. A_UINT32
  13940. sw_peer_id : 16,
  13941. tid : 4,
  13942. transmit_cnt : 7,
  13943. valid : 1,
  13944. mcast : 1,
  13945. rsvd0 : 3;
  13946. /* word 3 */
  13947. A_UINT32
  13948. release_reason : 4, /* Refer to htt_t2h_tx_msdu_release_reason_e */
  13949. tqm_status_number : 24,
  13950. frame_type : 4; /* holds htt_tx_wbm_status_frame_type value */
  13951. /* word 4 */
  13952. A_UINT32
  13953. /* ack_frame_rssi:
  13954. * If this frame is removed as the result of the
  13955. * reception of an ACK or BA, this field indicates
  13956. * the RSSI of the received ACK or BA frame.
  13957. * When the frame is removed as result of a direct
  13958. * remove command from the SW, this field is set
  13959. * to 0x0 (which is never a valid value when real
  13960. * RSSI is available).
  13961. * Units: dB w.r.t noise floor
  13962. */
  13963. ack_frame_rssi : 8,
  13964. first_msdu : 1,
  13965. last_msdu : 1,
  13966. msdu_part_of_amsdu : 1,
  13967. buffer_timestamp : 19, /* units = TU = 1024 microseconds */
  13968. rsvd1 : 2;
  13969. /* words 5 + 6 */
  13970. struct htt_t2h_tx_rate_stats_info tx_rate_stats;
  13971. /* word 7 */
  13972. /* rsvd3:
  13973. * backup reserved field to add new parameters if [rsvd0, rsvd1, rsvd2]
  13974. * is not sufficient
  13975. */
  13976. A_UINT32 rsvd3;
  13977. /* NOTE:
  13978. * To preserve backwards compatibility,
  13979. * no new fields can be added in this struct.
  13980. */
  13981. };
  13982. /* member definitions of htt_t2h_tx_msdu_info */
  13983. #define HTT_TX_MSDU_INFO_SW_PEER_ID_M 0x0000FFFF
  13984. #define HTT_TX_MSDU_INFO_SW_PEER_ID_S 0
  13985. #define HTT_TX_MSDU_INFO_SW_PEER_ID_SET(word, value) \
  13986. do { \
  13987. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_SW_PEER_ID, value); \
  13988. (word) |= (value) << HTT_TX_MSDU_INFO_SW_PEER_ID_S; \
  13989. } while (0)
  13990. #define HTT_TX_MSDU_INFO_SW_PEER_ID_GET(word) \
  13991. (((word) & HTT_TX_MSDU_INFO_SW_PEER_ID_M) >> HTT_TX_MSDU_INFO_SW_PEER_ID_S)
  13992. #define HTT_TX_MSDU_INFO_TID_M 0x000F0000
  13993. #define HTT_TX_MSDU_INFO_TID_S 16
  13994. #define HTT_TX_MSDU_INFO_TID_SET(word, value) \
  13995. do { \
  13996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TID, value); \
  13997. (word) |= (value) << HTT_TX_MSDU_INFO_TID_S; \
  13998. } while (0)
  13999. #define HTT_TX_MSDU_INFO_TID_GET(word) \
  14000. (((word) & HTT_TX_MSDU_INFO_TID_M) >> HTT_TX_MSDU_INFO_TID_S)
  14001. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_M 0x07F00000
  14002. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_S 20
  14003. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_SET(word, value) \
  14004. do { \
  14005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TRANSMIT_CNT, value); \
  14006. (word) |= (value) << HTT_TX_MSDU_INFO_TRANSMIT_CNT_S; \
  14007. } while (0)
  14008. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_GET(word) \
  14009. (((word) & HTT_TX_MSDU_INFO_TRANSMIT_CNT_M) >> HTT_TX_MSDU_INFO_TRANSMIT_CNT_S)
  14010. #define HTT_TX_MSDU_INFO_VALID_M 0x08000000
  14011. #define HTT_TX_MSDU_INFO_VALID_S 27
  14012. #define HTT_TX_MSDU_INFO_VALID_SET(word, value) \
  14013. do { \
  14014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_VALID, value); \
  14015. (word) |= (value) << HTT_TX_MSDU_INFO_VALID_S; \
  14016. } while (0)
  14017. #define HTT_TX_MSDU_INFO_VALID_GET(word) \
  14018. (((word) & HTT_TX_MSDU_INFO_VALID_M) >> HTT_TX_MSDU_INFO_VALID_S)
  14019. #define HTT_TX_MSDU_INFO_MCAST_M 0x10000000
  14020. #define HTT_TX_MSDU_INFO_MCAST_S 28
  14021. #define HTT_TX_MSDU_INFO_MCAST_SET(word, value) \
  14022. do { \
  14023. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MCAST, value); \
  14024. (word) |= (value) << HTT_TX_MSDU_INFO_MCAST_S; \
  14025. } while (0)
  14026. #define HTT_TX_MSDU_INFO_MCAST_GET(word) \
  14027. (((word) & HTT_TX_MSDU_INFO_MCAST_M) >> HTT_TX_MSDU_INFO_MCAST_S)
  14028. #define HTT_TX_MSDU_INFO_RELEASE_REASON_M 0x0000000F
  14029. #define HTT_TX_MSDU_INFO_RELEASE_REASON_S 0
  14030. #define HTT_TX_MSDU_INFO_RELEASE_REASON_SET(word, value) \
  14031. do { \
  14032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_RELEASE_REASON, value); \
  14033. (word) |= (value) << HTT_TX_MSDU_INFO_RELEASE_REASON_S; \
  14034. } while (0)
  14035. #define HTT_TX_MSDU_INFO_RELEASE_REASON_GET(word) \
  14036. (((word) & HTT_TX_MSDU_INFO_RELEASE_REASON_M) >> HTT_TX_MSDU_INFO_RELEASE_REASON_S)
  14037. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M 0x0FFFFFF0
  14038. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S 4
  14039. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_SET(word, value) \
  14040. do { \
  14041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER, value); \
  14042. (word) |= (value) << HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S; \
  14043. } while (0)
  14044. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_GET(word) \
  14045. (((word) & HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M) >> HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S)
  14046. #define HTT_TX_MSDU_INFO_FRAME_TYPE_M 0xF0000000
  14047. #define HTT_TX_MSDU_INFO_FRAME_TYPE_S 28
  14048. #define HTT_TX_MSDU_INFO_FRAME_TYPE_SET(word, value) \
  14049. do { \
  14050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FRAME_TYPE, value); \
  14051. (word) |= (value) << HTT_TX_MSDU_INFO_FRAME_TYPE_S; \
  14052. } while (0)
  14053. #define HTT_TX_MSDU_INFO_FRAME_TYPE_GET(word) \
  14054. (((word) & HTT_TX_MSDU_INFO_FRAME_TYPE_M) >> HTT_TX_MSDU_INFO_FRAME_TYPE_S)
  14055. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M 0x000000FF
  14056. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S 0
  14057. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_SET(word, value) \
  14058. do { \
  14059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_ACK_FRAME_RSSI, value); \
  14060. (word) |= (value) << HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S; \
  14061. } while (0)
  14062. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_GET(word) \
  14063. (((word) & HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M) >> HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S)
  14064. #define HTT_TX_MSDU_INFO_FIRST_MSDU_M 0x00000100
  14065. #define HTT_TX_MSDU_INFO_FIRST_MSDU_S 8
  14066. #define HTT_TX_MSDU_INFO_FIRST_MSDU_SET(word, value) \
  14067. do { \
  14068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FIRST_MSDU, value); \
  14069. (word) |= (value) << HTT_TX_MSDU_INFO_FIRST_MSDU_S; \
  14070. } while (0)
  14071. #define HTT_TX_MSDU_INFO_FIRST_MSDU_GET(word) \
  14072. (((word) & HTT_TX_MSDU_INFO_FIRST_MSDU_M) >> HTT_TX_MSDU_INFO_FIRST_MSDU_S)
  14073. #define HTT_TX_MSDU_INFO_LAST_MSDU_M 0x00000200
  14074. #define HTT_TX_MSDU_INFO_LAST_MSDU_S 9
  14075. #define HTT_TX_MSDU_INFO_LAST_MSDU_SET(word, value) \
  14076. do { \
  14077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_LAST_MSDU, value); \
  14078. (word) |= (value) << HTT_TX_MSDU_INFO_LAST_MSDU_S; \
  14079. } while (0)
  14080. #define HTT_TX_MSDU_INFO_LAST_MSDU_GET(word) \
  14081. (((word) & HTT_TX_MSDU_INFO_LAST_MSDU_M) >> HTT_TX_MSDU_INFO_LAST_MSDU_S)
  14082. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M 0x00000400
  14083. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S 10
  14084. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_SET(word, value) \
  14085. do { \
  14086. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU, value); \
  14087. (word) |= (value) << HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S; \
  14088. } while (0)
  14089. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_GET(word) \
  14090. (((word) & HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M) >> HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S)
  14091. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M 0x3FFFF800
  14092. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S 11
  14093. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_SET(word, value) \
  14094. do { \
  14095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP, value); \
  14096. (word) |= (value) << HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S; \
  14097. } while (0)
  14098. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_GET(word) \
  14099. (((word) & HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M) >> HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S)
  14100. struct htt_t2h_soft_umac_tx_compl_ind {
  14101. A_UINT32 msg_type : 8, /* HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND */
  14102. msdu_cnt : 8, /* min: 0, max: 255 */
  14103. rsvd0 : 16;
  14104. /* NOTE:
  14105. * To preserve backwards compatibility,
  14106. * no new fields can be added in this struct.
  14107. */
  14108. /*
  14109. * append here:
  14110. * struct htt_t2h_tx_msdu_info payload[1(or more)]
  14111. * for all the msdu's that are part of this completion.
  14112. */
  14113. };
  14114. /* member definitions of htt_t2h_soft_umac_tx_compl_ind */
  14115. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M 0x0000FF00
  14116. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S 8
  14117. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_SET(word, value) \
  14118. do { \
  14119. HTT_CHECK_SET_VAL(HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT, value); \
  14120. (word) |= (value) << HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S; \
  14121. } while (0)
  14122. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_GET(word) \
  14123. (((word) & HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M) >> HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S)
  14124. /**
  14125. * @brief target -> host rate-control update indication message
  14126. *
  14127. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  14128. *
  14129. * @details
  14130. * The following diagram shows the format of the RC Update message
  14131. * sent from the target to the host, while processing the tx-completion
  14132. * of a transmitted PPDU.
  14133. *
  14134. * |31 24|23 16|15 8|7 0|
  14135. * |-------------------------------------------------------------|
  14136. * | peer ID | vdev ID | msg_type |
  14137. * |-------------------------------------------------------------|
  14138. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  14139. * |-------------------------------------------------------------|
  14140. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  14141. * |-------------------------------------------------------------|
  14142. * | : |
  14143. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14144. * | : |
  14145. * |-------------------------------------------------------------|
  14146. * | : |
  14147. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14148. * | : |
  14149. * |-------------------------------------------------------------|
  14150. * : :
  14151. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14152. *
  14153. */
  14154. typedef struct {
  14155. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  14156. A_UINT32 rate_code_flags;
  14157. A_UINT32 flags; /* Encodes information such as excessive
  14158. retransmission, aggregate, some info
  14159. from .11 frame control,
  14160. STBC, LDPC, (SGI and Tx Chain Mask
  14161. are encoded in ptx_rc->flags field),
  14162. AMPDU truncation (BT/time based etc.),
  14163. RTS/CTS attempt */
  14164. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  14165. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  14166. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  14167. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  14168. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  14169. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  14170. } HTT_RC_TX_DONE_PARAMS;
  14171. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  14172. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  14173. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  14174. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  14175. #define HTT_RC_UPDATE_VDEVID_S 8
  14176. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  14177. #define HTT_RC_UPDATE_PEERID_S 16
  14178. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  14179. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  14180. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  14181. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  14182. do { \
  14183. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  14184. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  14185. } while (0)
  14186. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  14187. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  14188. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  14189. do { \
  14190. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  14191. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  14192. } while (0)
  14193. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  14194. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  14195. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  14196. do { \
  14197. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  14198. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  14199. } while (0)
  14200. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  14201. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  14202. /**
  14203. * @brief target -> host rx fragment indication message definition
  14204. *
  14205. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  14206. *
  14207. * @details
  14208. * The following field definitions describe the format of the rx fragment
  14209. * indication message sent from the target to the host.
  14210. * The rx fragment indication message shares the format of the
  14211. * rx indication message, but not all fields from the rx indication message
  14212. * are relevant to the rx fragment indication message.
  14213. *
  14214. *
  14215. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  14216. * |-----------+-------------------+---------------------+-------------|
  14217. * | peer ID | |FV| ext TID | msg type |
  14218. * |-------------------------------------------------------------------|
  14219. * | | flush | flush |
  14220. * | | end | start |
  14221. * | | seq num | seq num |
  14222. * |-------------------------------------------------------------------|
  14223. * | reserved | FW rx desc bytes |
  14224. * |-------------------------------------------------------------------|
  14225. * | | FW MSDU Rx |
  14226. * | | desc B0 |
  14227. * |-------------------------------------------------------------------|
  14228. * Header fields:
  14229. * - MSG_TYPE
  14230. * Bits 7:0
  14231. * Purpose: identifies this as an rx fragment indication message
  14232. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  14233. * - EXT_TID
  14234. * Bits 12:8
  14235. * Purpose: identify the traffic ID of the rx data, including
  14236. * special "extended" TID values for multicast, broadcast, and
  14237. * non-QoS data frames
  14238. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  14239. * - FLUSH_VALID (FV)
  14240. * Bit 13
  14241. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  14242. * is valid
  14243. * Value:
  14244. * 1 -> flush IE is valid and needs to be processed
  14245. * 0 -> flush IE is not valid and should be ignored
  14246. * - PEER_ID
  14247. * Bits 31:16
  14248. * Purpose: Identify, by ID, which peer sent the rx data
  14249. * Value: ID of the peer who sent the rx data
  14250. * - FLUSH_SEQ_NUM_START
  14251. * Bits 5:0
  14252. * Purpose: Indicate the start of a series of MPDUs to flush
  14253. * Not all MPDUs within this series are necessarily valid - the host
  14254. * must check each sequence number within this range to see if the
  14255. * corresponding MPDU is actually present.
  14256. * This field is only valid if the FV bit is set.
  14257. * Value:
  14258. * The sequence number for the first MPDUs to check to flush.
  14259. * The sequence number is masked by 0x3f.
  14260. * - FLUSH_SEQ_NUM_END
  14261. * Bits 11:6
  14262. * Purpose: Indicate the end of a series of MPDUs to flush
  14263. * Value:
  14264. * The sequence number one larger than the sequence number of the
  14265. * last MPDU to check to flush.
  14266. * The sequence number is masked by 0x3f.
  14267. * Not all MPDUs within this series are necessarily valid - the host
  14268. * must check each sequence number within this range to see if the
  14269. * corresponding MPDU is actually present.
  14270. * This field is only valid if the FV bit is set.
  14271. * Rx descriptor fields:
  14272. * - FW_RX_DESC_BYTES
  14273. * Bits 15:0
  14274. * Purpose: Indicate how many bytes in the Rx indication are used for
  14275. * FW Rx descriptors
  14276. * Value: 1
  14277. */
  14278. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  14279. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  14280. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  14281. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  14282. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  14283. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  14284. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  14285. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  14286. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  14287. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  14288. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  14289. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  14290. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  14291. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  14292. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  14293. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  14294. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  14295. #define HTT_RX_FRAG_IND_BYTES \
  14296. (4 /* msg hdr */ + \
  14297. 4 /* flush spec */ + \
  14298. 4 /* (unused) FW rx desc bytes spec */ + \
  14299. 4 /* FW rx desc */)
  14300. /**
  14301. * @brief target -> host test message definition
  14302. *
  14303. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  14304. *
  14305. * @details
  14306. * The following field definitions describe the format of the test
  14307. * message sent from the target to the host.
  14308. * The message consists of a 4-octet header, followed by a variable
  14309. * number of 32-bit integer values, followed by a variable number
  14310. * of 8-bit character values.
  14311. *
  14312. * |31 16|15 8|7 0|
  14313. * |-----------------------------------------------------------|
  14314. * | num chars | num ints | msg type |
  14315. * |-----------------------------------------------------------|
  14316. * | int 0 |
  14317. * |-----------------------------------------------------------|
  14318. * | int 1 |
  14319. * |-----------------------------------------------------------|
  14320. * | ... |
  14321. * |-----------------------------------------------------------|
  14322. * | char 3 | char 2 | char 1 | char 0 |
  14323. * |-----------------------------------------------------------|
  14324. * | | | ... | char 4 |
  14325. * |-----------------------------------------------------------|
  14326. * - MSG_TYPE
  14327. * Bits 7:0
  14328. * Purpose: identifies this as a test message
  14329. * Value: HTT_MSG_TYPE_TEST
  14330. * - NUM_INTS
  14331. * Bits 15:8
  14332. * Purpose: indicate how many 32-bit integers follow the message header
  14333. * - NUM_CHARS
  14334. * Bits 31:16
  14335. * Purpose: indicate how many 8-bit characters follow the series of integers
  14336. */
  14337. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  14338. #define HTT_RX_TEST_NUM_INTS_S 8
  14339. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  14340. #define HTT_RX_TEST_NUM_CHARS_S 16
  14341. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  14342. do { \
  14343. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  14344. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  14345. } while (0)
  14346. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  14347. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  14348. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  14349. do { \
  14350. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  14351. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  14352. } while (0)
  14353. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  14354. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  14355. /**
  14356. * @brief target -> host packet log message
  14357. *
  14358. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  14359. *
  14360. * @details
  14361. * The following field definitions describe the format of the packet log
  14362. * message sent from the target to the host.
  14363. * The message consists of a 4-octet header,followed by a variable number
  14364. * of 32-bit character values.
  14365. *
  14366. * |31 16|15 12|11 10|9 8|7 0|
  14367. * |------------------------------------------------------------------|
  14368. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  14369. * |------------------------------------------------------------------|
  14370. * | payload |
  14371. * |------------------------------------------------------------------|
  14372. * - MSG_TYPE
  14373. * Bits 7:0
  14374. * Purpose: identifies this as a pktlog message
  14375. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  14376. * - mac_id
  14377. * Bits 9:8
  14378. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  14379. * Value: 0-3
  14380. * - pdev_id
  14381. * Bits 11:10
  14382. * Purpose: pdev_id
  14383. * Value: 0-3
  14384. * 0 (for rings at SOC level),
  14385. * 1/2/3 PDEV -> 0/1/2
  14386. * - payload_size
  14387. * Bits 31:16
  14388. * Purpose: explicitly specify the payload size
  14389. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  14390. */
  14391. PREPACK struct htt_pktlog_msg {
  14392. A_UINT32 header;
  14393. A_UINT32 payload[1/* or more */];
  14394. } POSTPACK;
  14395. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  14396. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  14397. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  14398. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  14399. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  14400. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  14401. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  14402. do { \
  14403. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  14404. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  14405. } while (0)
  14406. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  14407. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  14408. HTT_T2H_PKTLOG_MAC_ID_S)
  14409. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  14410. do { \
  14411. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  14412. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  14413. } while (0)
  14414. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  14415. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  14416. HTT_T2H_PKTLOG_PDEV_ID_S)
  14417. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  14418. do { \
  14419. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  14420. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  14421. } while (0)
  14422. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  14423. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  14424. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  14425. /*
  14426. * Rx reorder statistics
  14427. * NB: all the fields must be defined in 4 octets size.
  14428. */
  14429. struct rx_reorder_stats {
  14430. /* Non QoS MPDUs received */
  14431. A_UINT32 deliver_non_qos;
  14432. /* MPDUs received in-order */
  14433. A_UINT32 deliver_in_order;
  14434. /* Flush due to reorder timer expired */
  14435. A_UINT32 deliver_flush_timeout;
  14436. /* Flush due to move out of window */
  14437. A_UINT32 deliver_flush_oow;
  14438. /* Flush due to DELBA */
  14439. A_UINT32 deliver_flush_delba;
  14440. /* MPDUs dropped due to FCS error */
  14441. A_UINT32 fcs_error;
  14442. /* MPDUs dropped due to monitor mode non-data packet */
  14443. A_UINT32 mgmt_ctrl;
  14444. /* Unicast-data MPDUs dropped due to invalid peer */
  14445. A_UINT32 invalid_peer;
  14446. /* MPDUs dropped due to duplication (non aggregation) */
  14447. A_UINT32 dup_non_aggr;
  14448. /* MPDUs dropped due to processed before */
  14449. A_UINT32 dup_past;
  14450. /* MPDUs dropped due to duplicate in reorder queue */
  14451. A_UINT32 dup_in_reorder;
  14452. /* Reorder timeout happened */
  14453. A_UINT32 reorder_timeout;
  14454. /* invalid bar ssn */
  14455. A_UINT32 invalid_bar_ssn;
  14456. /* reorder reset due to bar ssn */
  14457. A_UINT32 ssn_reset;
  14458. /* Flush due to delete peer */
  14459. A_UINT32 deliver_flush_delpeer;
  14460. /* Flush due to offload*/
  14461. A_UINT32 deliver_flush_offload;
  14462. /* Flush due to out of buffer*/
  14463. A_UINT32 deliver_flush_oob;
  14464. /* MPDUs dropped due to PN check fail */
  14465. A_UINT32 pn_fail;
  14466. /* MPDUs dropped due to unable to allocate memory */
  14467. A_UINT32 store_fail;
  14468. /* Number of times the tid pool alloc succeeded */
  14469. A_UINT32 tid_pool_alloc_succ;
  14470. /* Number of times the MPDU pool alloc succeeded */
  14471. A_UINT32 mpdu_pool_alloc_succ;
  14472. /* Number of times the MSDU pool alloc succeeded */
  14473. A_UINT32 msdu_pool_alloc_succ;
  14474. /* Number of times the tid pool alloc failed */
  14475. A_UINT32 tid_pool_alloc_fail;
  14476. /* Number of times the MPDU pool alloc failed */
  14477. A_UINT32 mpdu_pool_alloc_fail;
  14478. /* Number of times the MSDU pool alloc failed */
  14479. A_UINT32 msdu_pool_alloc_fail;
  14480. /* Number of times the tid pool freed */
  14481. A_UINT32 tid_pool_free;
  14482. /* Number of times the MPDU pool freed */
  14483. A_UINT32 mpdu_pool_free;
  14484. /* Number of times the MSDU pool freed */
  14485. A_UINT32 msdu_pool_free;
  14486. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  14487. A_UINT32 msdu_queued;
  14488. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  14489. A_UINT32 msdu_recycled;
  14490. /* Number of MPDUs with invalid peer but A2 found in AST */
  14491. A_UINT32 invalid_peer_a2_in_ast;
  14492. /* Number of MPDUs with invalid peer but A3 found in AST */
  14493. A_UINT32 invalid_peer_a3_in_ast;
  14494. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  14495. A_UINT32 invalid_peer_bmc_mpdus;
  14496. /* Number of MSDUs with err attention word */
  14497. A_UINT32 rxdesc_err_att;
  14498. /* Number of MSDUs with flag of peer_idx_invalid */
  14499. A_UINT32 rxdesc_err_peer_idx_inv;
  14500. /* Number of MSDUs with flag of peer_idx_timeout */
  14501. A_UINT32 rxdesc_err_peer_idx_to;
  14502. /* Number of MSDUs with flag of overflow */
  14503. A_UINT32 rxdesc_err_ov;
  14504. /* Number of MSDUs with flag of msdu_length_err */
  14505. A_UINT32 rxdesc_err_msdu_len;
  14506. /* Number of MSDUs with flag of mpdu_length_err */
  14507. A_UINT32 rxdesc_err_mpdu_len;
  14508. /* Number of MSDUs with flag of tkip_mic_err */
  14509. A_UINT32 rxdesc_err_tkip_mic;
  14510. /* Number of MSDUs with flag of decrypt_err */
  14511. A_UINT32 rxdesc_err_decrypt;
  14512. /* Number of MSDUs with flag of fcs_err */
  14513. A_UINT32 rxdesc_err_fcs;
  14514. /* Number of Unicast (bc_mc bit is not set in attention word)
  14515. * frames with invalid peer handler
  14516. */
  14517. A_UINT32 rxdesc_uc_msdus_inv_peer;
  14518. /* Number of unicast frame directly (direct bit is set in attention word)
  14519. * to DUT with invalid peer handler
  14520. */
  14521. A_UINT32 rxdesc_direct_msdus_inv_peer;
  14522. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  14523. * frames with invalid peer handler
  14524. */
  14525. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  14526. /* Number of MSDUs dropped due to no first MSDU flag */
  14527. A_UINT32 rxdesc_no_1st_msdu;
  14528. /* Number of MSDUs dropped due to ring overflow */
  14529. A_UINT32 msdu_drop_ring_ov;
  14530. /* Number of MSDUs dropped due to FC mismatch */
  14531. A_UINT32 msdu_drop_fc_mismatch;
  14532. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  14533. A_UINT32 msdu_drop_mgmt_remote_ring;
  14534. /* Number of MSDUs dropped due to errors not reported in attention word */
  14535. A_UINT32 msdu_drop_misc;
  14536. /* Number of MSDUs go to offload before reorder */
  14537. A_UINT32 offload_msdu_wal;
  14538. /* Number of data frame dropped by offload after reorder */
  14539. A_UINT32 offload_msdu_reorder;
  14540. /* Number of MPDUs with sequence number in the past and within the BA window */
  14541. A_UINT32 dup_past_within_window;
  14542. /* Number of MPDUs with sequence number in the past and outside the BA window */
  14543. A_UINT32 dup_past_outside_window;
  14544. /* Number of MSDUs with decrypt/MIC error */
  14545. A_UINT32 rxdesc_err_decrypt_mic;
  14546. /* Number of data MSDUs received on both local and remote rings */
  14547. A_UINT32 data_msdus_on_both_rings;
  14548. /* MPDUs never filled */
  14549. A_UINT32 holes_not_filled;
  14550. };
  14551. /*
  14552. * Rx Remote buffer statistics
  14553. * NB: all the fields must be defined in 4 octets size.
  14554. */
  14555. struct rx_remote_buffer_mgmt_stats {
  14556. /* Total number of MSDUs reaped for Rx processing */
  14557. A_UINT32 remote_reaped;
  14558. /* MSDUs recycled within firmware */
  14559. A_UINT32 remote_recycled;
  14560. /* MSDUs stored by Data Rx */
  14561. A_UINT32 data_rx_msdus_stored;
  14562. /* Number of HTT indications from WAL Rx MSDU */
  14563. A_UINT32 wal_rx_ind;
  14564. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  14565. A_UINT32 wal_rx_ind_unconsumed;
  14566. /* Number of HTT indications from Data Rx MSDU */
  14567. A_UINT32 data_rx_ind;
  14568. /* Number of unconsumed HTT indications from Data Rx MSDU */
  14569. A_UINT32 data_rx_ind_unconsumed;
  14570. /* Number of HTT indications from ATHBUF */
  14571. A_UINT32 athbuf_rx_ind;
  14572. /* Number of remote buffers requested for refill */
  14573. A_UINT32 refill_buf_req;
  14574. /* Number of remote buffers filled by the host */
  14575. A_UINT32 refill_buf_rsp;
  14576. /* Number of times MAC hw_index = f/w write_index */
  14577. A_INT32 mac_no_bufs;
  14578. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  14579. A_INT32 fw_indices_equal;
  14580. /* Number of times f/w finds no buffers to post */
  14581. A_INT32 host_no_bufs;
  14582. };
  14583. /*
  14584. * TXBF MU/SU packets and NDPA statistics
  14585. * NB: all the fields must be defined in 4 octets size.
  14586. */
  14587. struct rx_txbf_musu_ndpa_pkts_stats {
  14588. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  14589. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  14590. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  14591. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  14592. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  14593. A_UINT32 reserved[3]; /* must be set to 0x0 */
  14594. };
  14595. /*
  14596. * htt_dbg_stats_status -
  14597. * present - The requested stats have been delivered in full.
  14598. * This indicates that either the stats information was contained
  14599. * in its entirety within this message, or else this message
  14600. * completes the delivery of the requested stats info that was
  14601. * partially delivered through earlier STATS_CONF messages.
  14602. * partial - The requested stats have been delivered in part.
  14603. * One or more subsequent STATS_CONF messages with the same
  14604. * cookie value will be sent to deliver the remainder of the
  14605. * information.
  14606. * error - The requested stats could not be delivered, for example due
  14607. * to a shortage of memory to construct a message holding the
  14608. * requested stats.
  14609. * invalid - The requested stat type is either not recognized, or the
  14610. * target is configured to not gather the stats type in question.
  14611. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14612. * series_done - This special value indicates that no further stats info
  14613. * elements are present within a series of stats info elems
  14614. * (within a stats upload confirmation message).
  14615. */
  14616. enum htt_dbg_stats_status {
  14617. HTT_DBG_STATS_STATUS_PRESENT = 0,
  14618. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  14619. HTT_DBG_STATS_STATUS_ERROR = 2,
  14620. HTT_DBG_STATS_STATUS_INVALID = 3,
  14621. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  14622. };
  14623. /**
  14624. * @brief target -> host statistics upload
  14625. *
  14626. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  14627. *
  14628. * @details
  14629. * The following field definitions describe the format of the HTT target
  14630. * to host stats upload confirmation message.
  14631. * The message contains a cookie echoed from the HTT host->target stats
  14632. * upload request, which identifies which request the confirmation is
  14633. * for, and a series of tag-length-value stats information elements.
  14634. * The tag-length header for each stats info element also includes a
  14635. * status field, to indicate whether the request for the stat type in
  14636. * question was fully met, partially met, unable to be met, or invalid
  14637. * (if the stat type in question is disabled in the target).
  14638. * A special value of all 1's in this status field is used to indicate
  14639. * the end of the series of stats info elements.
  14640. *
  14641. *
  14642. * |31 16|15 8|7 5|4 0|
  14643. * |------------------------------------------------------------|
  14644. * | reserved | msg type |
  14645. * |------------------------------------------------------------|
  14646. * | cookie LSBs |
  14647. * |------------------------------------------------------------|
  14648. * | cookie MSBs |
  14649. * |------------------------------------------------------------|
  14650. * | stats entry length | reserved | S |stat type|
  14651. * |------------------------------------------------------------|
  14652. * | |
  14653. * | type-specific stats info |
  14654. * | |
  14655. * |------------------------------------------------------------|
  14656. * | stats entry length | reserved | S |stat type|
  14657. * |------------------------------------------------------------|
  14658. * | |
  14659. * | type-specific stats info |
  14660. * | |
  14661. * |------------------------------------------------------------|
  14662. * | n/a | reserved | 111 | n/a |
  14663. * |------------------------------------------------------------|
  14664. * Header fields:
  14665. * - MSG_TYPE
  14666. * Bits 7:0
  14667. * Purpose: identifies this is a statistics upload confirmation message
  14668. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14669. * - COOKIE_LSBS
  14670. * Bits 31:0
  14671. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14672. * message with its preceding host->target stats request message.
  14673. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14674. * - COOKIE_MSBS
  14675. * Bits 31:0
  14676. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14677. * message with its preceding host->target stats request message.
  14678. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14679. *
  14680. * Stats Information Element tag-length header fields:
  14681. * - STAT_TYPE
  14682. * Bits 4:0
  14683. * Purpose: identifies the type of statistics info held in the
  14684. * following information element
  14685. * Value: htt_dbg_stats_type
  14686. * - STATUS
  14687. * Bits 7:5
  14688. * Purpose: indicate whether the requested stats are present
  14689. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14690. * the completion of the stats entry series
  14691. * - LENGTH
  14692. * Bits 31:16
  14693. * Purpose: indicate the stats information size
  14694. * Value: This field specifies the number of bytes of stats information
  14695. * that follows the element tag-length header.
  14696. * It is expected but not required that this length is a multiple of
  14697. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14698. * subsequent stats entry header will begin on a 4-byte aligned
  14699. * boundary.
  14700. */
  14701. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14702. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14703. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14704. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14705. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14706. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14707. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14708. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14709. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14710. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14711. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14712. do { \
  14713. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14714. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14715. } while (0)
  14716. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14717. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14718. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14719. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14720. do { \
  14721. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14722. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14723. } while (0)
  14724. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14725. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14726. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14727. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14728. do { \
  14729. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14730. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14731. } while (0)
  14732. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14733. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14734. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14735. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14736. #define HTT_MAX_AGGR 64
  14737. #define HTT_HL_MAX_AGGR 18
  14738. /**
  14739. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14740. *
  14741. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14742. *
  14743. * @details
  14744. * The following field definitions describe the format of the HTT host
  14745. * to target frag_desc/msdu_ext bank configuration message.
  14746. * The message contains the based address and the min and max id of the
  14747. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14748. * MSDU_EXT/FRAG_DESC.
  14749. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14750. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14751. * the hardware does the mapping/translation.
  14752. *
  14753. * Total banks that can be configured is configured to 16.
  14754. *
  14755. * This should be called before any TX has be initiated by the HTT
  14756. *
  14757. * |31 16|15 8|7 5|4 0|
  14758. * |------------------------------------------------------------|
  14759. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14760. * |------------------------------------------------------------|
  14761. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14762. #if HTT_PADDR64
  14763. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14764. #endif
  14765. * |------------------------------------------------------------|
  14766. * | ... |
  14767. * |------------------------------------------------------------|
  14768. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14769. #if HTT_PADDR64
  14770. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14771. #endif
  14772. * |------------------------------------------------------------|
  14773. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14774. * |------------------------------------------------------------|
  14775. * | ... |
  14776. * |------------------------------------------------------------|
  14777. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14778. * |------------------------------------------------------------|
  14779. * Header fields:
  14780. * - MSG_TYPE
  14781. * Bits 7:0
  14782. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14783. * for systems with 64-bit format for bus addresses:
  14784. * - BANKx_BASE_ADDRESS_LO
  14785. * Bits 31:0
  14786. * Purpose: Provide a mechanism to specify the base address of the
  14787. * MSDU_EXT bank physical/bus address.
  14788. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14789. * - BANKx_BASE_ADDRESS_HI
  14790. * Bits 31:0
  14791. * Purpose: Provide a mechanism to specify the base address of the
  14792. * MSDU_EXT bank physical/bus address.
  14793. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14794. * for systems with 32-bit format for bus addresses:
  14795. * - BANKx_BASE_ADDRESS
  14796. * Bits 31:0
  14797. * Purpose: Provide a mechanism to specify the base address of the
  14798. * MSDU_EXT bank physical/bus address.
  14799. * Value: MSDU_EXT bank physical / bus address
  14800. * - BANKx_MIN_ID
  14801. * Bits 15:0
  14802. * Purpose: Provide a mechanism to specify the min index that needs to
  14803. * mapped.
  14804. * - BANKx_MAX_ID
  14805. * Bits 31:16
  14806. * Purpose: Provide a mechanism to specify the max index that needs to
  14807. * mapped.
  14808. *
  14809. */
  14810. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14811. * safe value.
  14812. * @note MAX supported banks is 16.
  14813. */
  14814. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14815. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14816. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14817. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14818. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14819. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14820. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14821. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14822. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14823. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14824. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14825. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14826. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14827. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14828. do { \
  14829. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14830. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14831. } while (0)
  14832. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14833. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14834. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14835. do { \
  14836. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14837. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14838. } while (0)
  14839. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14840. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14841. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14842. do { \
  14843. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14844. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14845. } while (0)
  14846. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14847. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14848. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14849. do { \
  14850. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14851. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14852. } while (0)
  14853. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14854. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14855. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14856. do { \
  14857. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14858. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14859. } while (0)
  14860. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14861. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14862. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14863. do { \
  14864. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14865. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14866. } while (0)
  14867. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14868. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14869. /*
  14870. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14871. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14872. * addresses are stored in a XXX-bit field.
  14873. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14874. * htt_tx_frag_desc64_bank_cfg_t structs.
  14875. */
  14876. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14877. _paddr_bits_, \
  14878. _paddr__bank_base_address_) \
  14879. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14880. /** word 0 \
  14881. * msg_type: 8, \
  14882. * pdev_id: 2, \
  14883. * swap: 1, \
  14884. * reserved0: 5, \
  14885. * num_banks: 8, \
  14886. * desc_size: 8; \
  14887. */ \
  14888. A_UINT32 word0; \
  14889. /* \
  14890. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14891. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14892. * the second A_UINT32). \
  14893. */ \
  14894. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14895. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14896. } POSTPACK
  14897. /* define htt_tx_frag_desc32_bank_cfg_t */
  14898. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14899. /* define htt_tx_frag_desc64_bank_cfg_t */
  14900. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14901. /*
  14902. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14903. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14904. */
  14905. #if HTT_PADDR64
  14906. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14907. #else
  14908. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14909. #endif
  14910. /**
  14911. * @brief target -> host HTT TX Credit total count update message definition
  14912. *
  14913. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14914. *
  14915. *|31 16|15|14 9| 8 |7 0 |
  14916. *|---------------------+--+----------+-------+----------|
  14917. *|cur htt credit delta | Q| reserved | sign | msg type |
  14918. *|------------------------------------------------------|
  14919. *
  14920. * Header fields:
  14921. * - MSG_TYPE
  14922. * Bits 7:0
  14923. * Purpose: identifies this as a htt tx credit delta update message
  14924. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14925. * - SIGN
  14926. * Bits 8
  14927. * identifies whether credit delta is positive or negative
  14928. * Value:
  14929. * - 0x0: credit delta is positive, rebalance in some buffers
  14930. * - 0x1: credit delta is negative, rebalance out some buffers
  14931. * - reserved
  14932. * Bits 14:9
  14933. * Value: 0x0
  14934. * - TXQ_GRP
  14935. * Bit 15
  14936. * Purpose: indicates whether any tx queue group information elements
  14937. * are appended to the tx credit update message
  14938. * Value: 0 -> no tx queue group information element is present
  14939. * 1 -> a tx queue group information element immediately follows
  14940. * - DELTA_COUNT
  14941. * Bits 31:16
  14942. * Purpose: Specify current htt credit delta absolute count
  14943. */
  14944. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14945. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14946. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14947. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14948. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14949. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14950. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14951. do { \
  14952. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14953. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14954. } while (0)
  14955. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14956. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14957. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14958. do { \
  14959. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14960. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14961. } while (0)
  14962. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14963. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14964. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14965. do { \
  14966. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14967. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14968. } while (0)
  14969. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14970. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14971. #define HTT_TX_CREDIT_MSG_BYTES 4
  14972. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14973. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14974. /**
  14975. * @brief HTT WDI_IPA Operation Response Message
  14976. *
  14977. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14978. *
  14979. * @details
  14980. * HTT WDI_IPA Operation Response message is sent by target
  14981. * to host confirming suspend or resume operation.
  14982. * |31 24|23 16|15 8|7 0|
  14983. * |----------------+----------------+----------------+----------------|
  14984. * | op_code | Rsvd | msg_type |
  14985. * |-------------------------------------------------------------------|
  14986. * | Rsvd | Response len |
  14987. * |-------------------------------------------------------------------|
  14988. * | |
  14989. * | Response-type specific info |
  14990. * | |
  14991. * | |
  14992. * |-------------------------------------------------------------------|
  14993. * Header fields:
  14994. * - MSG_TYPE
  14995. * Bits 7:0
  14996. * Purpose: Identifies this as WDI_IPA Operation Response message
  14997. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14998. * - OP_CODE
  14999. * Bits 31:16
  15000. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  15001. * value: = enum htt_wdi_ipa_op_code
  15002. * - RSP_LEN
  15003. * Bits 16:0
  15004. * Purpose: length for the response-type specific info
  15005. * value: = length in bytes for response-type specific info
  15006. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  15007. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  15008. */
  15009. PREPACK struct htt_wdi_ipa_op_response_t
  15010. {
  15011. /* DWORD 0: flags and meta-data */
  15012. A_UINT32
  15013. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15014. reserved1: 8,
  15015. op_code: 16;
  15016. A_UINT32
  15017. rsp_len: 16,
  15018. reserved2: 16;
  15019. } POSTPACK;
  15020. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  15021. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  15022. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  15023. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  15024. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  15025. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  15026. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  15027. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  15028. do { \
  15029. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  15030. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  15031. } while (0)
  15032. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  15033. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  15034. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  15035. do { \
  15036. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  15037. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  15038. } while (0)
  15039. enum htt_phy_mode {
  15040. htt_phy_mode_11a = 0,
  15041. htt_phy_mode_11g = 1,
  15042. htt_phy_mode_11b = 2,
  15043. htt_phy_mode_11g_only = 3,
  15044. htt_phy_mode_11na_ht20 = 4,
  15045. htt_phy_mode_11ng_ht20 = 5,
  15046. htt_phy_mode_11na_ht40 = 6,
  15047. htt_phy_mode_11ng_ht40 = 7,
  15048. htt_phy_mode_11ac_vht20 = 8,
  15049. htt_phy_mode_11ac_vht40 = 9,
  15050. htt_phy_mode_11ac_vht80 = 10,
  15051. htt_phy_mode_11ac_vht20_2g = 11,
  15052. htt_phy_mode_11ac_vht40_2g = 12,
  15053. htt_phy_mode_11ac_vht80_2g = 13,
  15054. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  15055. htt_phy_mode_11ac_vht160 = 15,
  15056. htt_phy_mode_max,
  15057. };
  15058. /**
  15059. * @brief target -> host HTT channel change indication
  15060. *
  15061. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  15062. *
  15063. * @details
  15064. * Specify when a channel change occurs.
  15065. * This allows the host to precisely determine which rx frames arrived
  15066. * on the old channel and which rx frames arrived on the new channel.
  15067. *
  15068. *|31 |7 0 |
  15069. *|-------------------------------------------+----------|
  15070. *| reserved | msg type |
  15071. *|------------------------------------------------------|
  15072. *| primary_chan_center_freq_mhz |
  15073. *|------------------------------------------------------|
  15074. *| contiguous_chan1_center_freq_mhz |
  15075. *|------------------------------------------------------|
  15076. *| contiguous_chan2_center_freq_mhz |
  15077. *|------------------------------------------------------|
  15078. *| phy_mode |
  15079. *|------------------------------------------------------|
  15080. *
  15081. * Header fields:
  15082. * - MSG_TYPE
  15083. * Bits 7:0
  15084. * Purpose: identifies this as a htt channel change indication message
  15085. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  15086. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  15087. * Bits 31:0
  15088. * Purpose: identify the (center of the) new 20 MHz primary channel
  15089. * Value: center frequency of the 20 MHz primary channel, in MHz units
  15090. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  15091. * Bits 31:0
  15092. * Purpose: identify the (center of the) contiguous frequency range
  15093. * comprising the new channel.
  15094. * For example, if the new channel is a 80 MHz channel extending
  15095. * 60 MHz beyond the primary channel, this field would be 30 larger
  15096. * than the primary channel center frequency field.
  15097. * Value: center frequency of the contiguous frequency range comprising
  15098. * the full channel in MHz units
  15099. * (80+80 channels also use the CONTIG_CHAN2 field)
  15100. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  15101. * Bits 31:0
  15102. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  15103. * within a VHT 80+80 channel.
  15104. * This field is only relevant for VHT 80+80 channels.
  15105. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  15106. * channel (arbitrary value for cases besides VHT 80+80)
  15107. * - PHY_MODE
  15108. * Bits 31:0
  15109. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  15110. * and band
  15111. * Value: htt_phy_mode enum value
  15112. */
  15113. PREPACK struct htt_chan_change_t
  15114. {
  15115. /* DWORD 0: flags and meta-data */
  15116. A_UINT32
  15117. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15118. reserved1: 24;
  15119. A_UINT32 primary_chan_center_freq_mhz;
  15120. A_UINT32 contig_chan1_center_freq_mhz;
  15121. A_UINT32 contig_chan2_center_freq_mhz;
  15122. A_UINT32 phy_mode;
  15123. } POSTPACK;
  15124. /*
  15125. * Due to historical / backwards-compatibility reasons, maintain the
  15126. * below htt_chan_change_msg struct definition, which needs to be
  15127. * consistent with the above htt_chan_change_t struct definition
  15128. * (aside from the htt_chan_change_t definition including the msg_type
  15129. * dword within the message, and the htt_chan_change_msg only containing
  15130. * the payload of the message that follows the msg_type dword).
  15131. */
  15132. PREPACK struct htt_chan_change_msg {
  15133. A_UINT32 chan_mhz; /* frequency in mhz */
  15134. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  15135. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  15136. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  15137. } POSTPACK;
  15138. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  15139. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  15140. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  15141. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  15142. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  15143. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  15144. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  15145. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  15146. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  15147. do { \
  15148. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  15149. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  15150. } while (0)
  15151. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  15152. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  15153. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  15154. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  15155. do { \
  15156. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  15157. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  15158. } while (0)
  15159. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  15160. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  15161. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  15162. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  15163. do { \
  15164. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  15165. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  15166. } while (0)
  15167. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  15168. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  15169. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  15170. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  15171. do { \
  15172. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  15173. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  15174. } while (0)
  15175. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  15176. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  15177. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  15178. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  15179. /**
  15180. * @brief rx offload packet error message
  15181. *
  15182. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  15183. *
  15184. * @details
  15185. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  15186. * of target payload like mic err.
  15187. *
  15188. * |31 24|23 16|15 8|7 0|
  15189. * |----------------+----------------+----------------+----------------|
  15190. * | tid | vdev_id | msg_sub_type | msg_type |
  15191. * |-------------------------------------------------------------------|
  15192. * : (sub-type dependent content) :
  15193. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15194. * Header fields:
  15195. * - msg_type
  15196. * Bits 7:0
  15197. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  15198. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  15199. * - msg_sub_type
  15200. * Bits 15:8
  15201. * Purpose: Identifies which type of rx error is reported by this message
  15202. * value: htt_rx_ofld_pkt_err_type
  15203. * - vdev_id
  15204. * Bits 23:16
  15205. * Purpose: Identifies which vdev received the erroneous rx frame
  15206. * value:
  15207. * - tid
  15208. * Bits 31:24
  15209. * Purpose: Identifies the traffic type of the rx frame
  15210. * value:
  15211. *
  15212. * - The payload fields used if the sub-type == MIC error are shown below.
  15213. * Note - MIC err is per MSDU, while PN is per MPDU.
  15214. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  15215. * with MIC err in A-MSDU case, so FW will send only one HTT message
  15216. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  15217. * instead of sending separate HTT messages for each wrong MSDU within
  15218. * the MPDU.
  15219. *
  15220. * |31 24|23 16|15 8|7 0|
  15221. * |----------------+----------------+----------------+----------------|
  15222. * | Rsvd | key_id | peer_id |
  15223. * |-------------------------------------------------------------------|
  15224. * | receiver MAC addr 31:0 |
  15225. * |-------------------------------------------------------------------|
  15226. * | Rsvd | receiver MAC addr 47:32 |
  15227. * |-------------------------------------------------------------------|
  15228. * | transmitter MAC addr 31:0 |
  15229. * |-------------------------------------------------------------------|
  15230. * | Rsvd | transmitter MAC addr 47:32 |
  15231. * |-------------------------------------------------------------------|
  15232. * | PN 31:0 |
  15233. * |-------------------------------------------------------------------|
  15234. * | Rsvd | PN 47:32 |
  15235. * |-------------------------------------------------------------------|
  15236. * - peer_id
  15237. * Bits 15:0
  15238. * Purpose: identifies which peer is frame is from
  15239. * value:
  15240. * - key_id
  15241. * Bits 23:16
  15242. * Purpose: identifies key_id of rx frame
  15243. * value:
  15244. * - RA_31_0 (receiver MAC addr 31:0)
  15245. * Bits 31:0
  15246. * Purpose: identifies by MAC address which vdev received the frame
  15247. * value: MAC address lower 4 bytes
  15248. * - RA_47_32 (receiver MAC addr 47:32)
  15249. * Bits 15:0
  15250. * Purpose: identifies by MAC address which vdev received the frame
  15251. * value: MAC address upper 2 bytes
  15252. * - TA_31_0 (transmitter MAC addr 31:0)
  15253. * Bits 31:0
  15254. * Purpose: identifies by MAC address which peer transmitted the frame
  15255. * value: MAC address lower 4 bytes
  15256. * - TA_47_32 (transmitter MAC addr 47:32)
  15257. * Bits 15:0
  15258. * Purpose: identifies by MAC address which peer transmitted the frame
  15259. * value: MAC address upper 2 bytes
  15260. * - PN_31_0
  15261. * Bits 31:0
  15262. * Purpose: Identifies pn of rx frame
  15263. * value: PN lower 4 bytes
  15264. * - PN_47_32
  15265. * Bits 15:0
  15266. * Purpose: Identifies pn of rx frame
  15267. * value:
  15268. * TKIP or CCMP: PN upper 2 bytes
  15269. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  15270. */
  15271. enum htt_rx_ofld_pkt_err_type {
  15272. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  15273. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  15274. };
  15275. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  15276. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  15277. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  15278. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  15279. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  15280. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  15281. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  15282. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  15283. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  15284. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  15285. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  15286. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  15287. do { \
  15288. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  15289. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  15290. } while (0)
  15291. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  15292. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  15293. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  15294. do { \
  15295. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  15296. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  15297. } while (0)
  15298. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  15299. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  15300. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  15301. do { \
  15302. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  15303. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  15304. } while (0)
  15305. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  15306. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  15307. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  15308. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  15309. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  15310. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  15311. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  15312. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  15313. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  15314. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  15315. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  15316. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  15317. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  15318. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  15319. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  15320. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  15321. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  15322. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  15323. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  15324. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  15325. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  15326. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  15327. do { \
  15328. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  15329. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  15330. } while (0)
  15331. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  15332. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  15333. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  15334. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  15335. do { \
  15336. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  15337. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  15338. } while (0)
  15339. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  15340. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  15341. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  15342. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  15343. do { \
  15344. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  15345. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  15346. } while (0)
  15347. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  15348. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  15349. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  15350. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  15351. do { \
  15352. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  15353. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  15354. } while (0)
  15355. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  15356. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  15357. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  15358. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  15359. do { \
  15360. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  15361. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  15362. } while (0)
  15363. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  15364. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  15365. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  15366. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  15367. do { \
  15368. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  15369. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  15370. } while (0)
  15371. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  15372. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  15373. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  15374. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  15375. do { \
  15376. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  15377. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  15378. } while (0)
  15379. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  15380. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  15381. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  15382. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  15383. do { \
  15384. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  15385. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  15386. } while (0)
  15387. /**
  15388. * @brief target -> host peer rate report message
  15389. *
  15390. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  15391. *
  15392. * @details
  15393. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  15394. * justified rate of all the peers.
  15395. *
  15396. * |31 24|23 16|15 8|7 0|
  15397. * |----------------+----------------+----------------+----------------|
  15398. * | peer_count | | msg_type |
  15399. * |-------------------------------------------------------------------|
  15400. * : Payload (variant number of peer rate report) :
  15401. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15402. * Header fields:
  15403. * - msg_type
  15404. * Bits 7:0
  15405. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  15406. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  15407. * - reserved
  15408. * Bits 15:8
  15409. * Purpose:
  15410. * value:
  15411. * - peer_count
  15412. * Bits 31:16
  15413. * Purpose: Specify how many peer rate report elements are present in the payload.
  15414. * value:
  15415. *
  15416. * Payload:
  15417. * There are variant number of peer rate report follow the first 32 bits.
  15418. * The peer rate report is defined as follows.
  15419. *
  15420. * |31 20|19 16|15 0|
  15421. * |-----------------------+---------+---------------------------------|-
  15422. * | reserved | phy | peer_id | \
  15423. * |-------------------------------------------------------------------| -> report #0
  15424. * | rate | /
  15425. * |-----------------------+---------+---------------------------------|-
  15426. * | reserved | phy | peer_id | \
  15427. * |-------------------------------------------------------------------| -> report #1
  15428. * | rate | /
  15429. * |-----------------------+---------+---------------------------------|-
  15430. * | reserved | phy | peer_id | \
  15431. * |-------------------------------------------------------------------| -> report #2
  15432. * | rate | /
  15433. * |-------------------------------------------------------------------|-
  15434. * : :
  15435. * : :
  15436. * : :
  15437. * :-------------------------------------------------------------------:
  15438. *
  15439. * - peer_id
  15440. * Bits 15:0
  15441. * Purpose: identify the peer
  15442. * value:
  15443. * - phy
  15444. * Bits 19:16
  15445. * Purpose: identify which phy is in use
  15446. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  15447. * Please see enum htt_peer_report_phy_type for detail.
  15448. * - reserved
  15449. * Bits 31:20
  15450. * Purpose:
  15451. * value:
  15452. * - rate
  15453. * Bits 31:0
  15454. * Purpose: represent the justified rate of the peer specified by peer_id
  15455. * value:
  15456. */
  15457. enum htt_peer_rate_report_phy_type {
  15458. HTT_PEER_RATE_REPORT_11B = 0,
  15459. HTT_PEER_RATE_REPORT_11A_G,
  15460. HTT_PEER_RATE_REPORT_11N,
  15461. HTT_PEER_RATE_REPORT_11AC,
  15462. };
  15463. #define HTT_PEER_RATE_REPORT_SIZE 8
  15464. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  15465. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  15466. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  15467. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  15468. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  15469. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  15470. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  15471. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  15472. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  15473. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  15474. do { \
  15475. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  15476. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  15477. } while (0)
  15478. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  15479. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  15480. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  15481. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  15482. do { \
  15483. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  15484. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  15485. } while (0)
  15486. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  15487. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  15488. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  15489. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  15490. do { \
  15491. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  15492. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  15493. } while (0)
  15494. /**
  15495. * @brief target -> host flow pool map message
  15496. *
  15497. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  15498. *
  15499. * @details
  15500. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  15501. * a flow of descriptors.
  15502. *
  15503. * This message is in TLV format and indicates the parameters to be setup a
  15504. * flow in the host. Each entry indicates that a particular flow ID is ready to
  15505. * receive descriptors from a specified pool.
  15506. *
  15507. * The message would appear as follows:
  15508. *
  15509. * |31 24|23 16|15 8|7 0|
  15510. * |----------------+----------------+----------------+----------------|
  15511. * header | reserved | num_flows | msg_type |
  15512. * |-------------------------------------------------------------------|
  15513. * | |
  15514. * : payload :
  15515. * | |
  15516. * |-------------------------------------------------------------------|
  15517. *
  15518. * The header field is one DWORD long and is interpreted as follows:
  15519. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  15520. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  15521. * this message
  15522. * b'16-31 - reserved: These bits are reserved for future use
  15523. *
  15524. * Payload:
  15525. * The payload would contain multiple objects of the following structure. Each
  15526. * object represents a flow.
  15527. *
  15528. * |31 24|23 16|15 8|7 0|
  15529. * |----------------+----------------+----------------+----------------|
  15530. * header | reserved | num_flows | msg_type |
  15531. * |-------------------------------------------------------------------|
  15532. * payload0| flow_type |
  15533. * |-------------------------------------------------------------------|
  15534. * | flow_id |
  15535. * |-------------------------------------------------------------------|
  15536. * | reserved0 | flow_pool_id |
  15537. * |-------------------------------------------------------------------|
  15538. * | reserved1 | flow_pool_size |
  15539. * |-------------------------------------------------------------------|
  15540. * | reserved2 |
  15541. * |-------------------------------------------------------------------|
  15542. * payload1| flow_type |
  15543. * |-------------------------------------------------------------------|
  15544. * | flow_id |
  15545. * |-------------------------------------------------------------------|
  15546. * | reserved0 | flow_pool_id |
  15547. * |-------------------------------------------------------------------|
  15548. * | reserved1 | flow_pool_size |
  15549. * |-------------------------------------------------------------------|
  15550. * | reserved2 |
  15551. * |-------------------------------------------------------------------|
  15552. * | . |
  15553. * | . |
  15554. * | . |
  15555. * |-------------------------------------------------------------------|
  15556. *
  15557. * Each payload is 5 DWORDS long and is interpreted as follows:
  15558. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  15559. * this flow is associated. It can be VDEV, peer,
  15560. * or tid (AC). Based on enum htt_flow_type.
  15561. *
  15562. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15563. * object. For flow_type vdev it is set to the
  15564. * vdevid, for peer it is peerid and for tid, it is
  15565. * tid_num.
  15566. *
  15567. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  15568. * in the host for this flow
  15569. * b'16:31 - reserved0: This field in reserved for the future. In case
  15570. * we have a hierarchical implementation (HCM) of
  15571. * pools, it can be used to indicate the ID of the
  15572. * parent-pool.
  15573. *
  15574. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  15575. * Descriptors for this flow will be
  15576. * allocated from this pool in the host.
  15577. * b'16:31 - reserved1: This field in reserved for the future. In case
  15578. * we have a hierarchical implementation of pools,
  15579. * it can be used to indicate the max number of
  15580. * descriptors in the pool. The b'0:15 can be used
  15581. * to indicate min number of descriptors in the
  15582. * HCM scheme.
  15583. *
  15584. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  15585. * we have a hierarchical implementation of pools,
  15586. * b'0:15 can be used to indicate the
  15587. * priority-based borrowing (PBB) threshold of
  15588. * the flow's pool. The b'16:31 are still left
  15589. * reserved.
  15590. */
  15591. enum htt_flow_type {
  15592. FLOW_TYPE_VDEV = 0,
  15593. /* Insert new flow types above this line */
  15594. };
  15595. PREPACK struct htt_flow_pool_map_payload_t {
  15596. A_UINT32 flow_type;
  15597. A_UINT32 flow_id;
  15598. A_UINT32 flow_pool_id:16,
  15599. reserved0:16;
  15600. A_UINT32 flow_pool_size:16,
  15601. reserved1:16;
  15602. A_UINT32 reserved2;
  15603. } POSTPACK;
  15604. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  15605. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  15606. (sizeof(struct htt_flow_pool_map_payload_t))
  15607. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  15608. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  15609. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  15610. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  15611. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  15612. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  15613. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  15614. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  15615. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  15616. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  15617. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  15618. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  15619. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  15620. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  15621. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  15622. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  15623. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  15624. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  15625. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  15626. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  15627. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  15628. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  15629. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  15630. do { \
  15631. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  15632. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  15633. } while (0)
  15634. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  15635. do { \
  15636. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  15637. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  15638. } while (0)
  15639. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  15640. do { \
  15641. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  15642. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  15643. } while (0)
  15644. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  15645. do { \
  15646. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  15647. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  15648. } while (0)
  15649. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  15650. do { \
  15651. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  15652. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  15653. } while (0)
  15654. /**
  15655. * @brief target -> host flow pool unmap message
  15656. *
  15657. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15658. *
  15659. * @details
  15660. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15661. * down a flow of descriptors.
  15662. * This message indicates that for the flow (whose ID is provided) is wanting
  15663. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15664. * pool of descriptors from where descriptors are being allocated for this
  15665. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15666. * be unmapped by the host.
  15667. *
  15668. * The message would appear as follows:
  15669. *
  15670. * |31 24|23 16|15 8|7 0|
  15671. * |----------------+----------------+----------------+----------------|
  15672. * | reserved0 | msg_type |
  15673. * |-------------------------------------------------------------------|
  15674. * | flow_type |
  15675. * |-------------------------------------------------------------------|
  15676. * | flow_id |
  15677. * |-------------------------------------------------------------------|
  15678. * | reserved1 | flow_pool_id |
  15679. * |-------------------------------------------------------------------|
  15680. *
  15681. * The message is interpreted as follows:
  15682. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15683. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15684. * b'8:31 - reserved0: Reserved for future use
  15685. *
  15686. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15687. * this flow is associated. It can be VDEV, peer,
  15688. * or tid (AC). Based on enum htt_flow_type.
  15689. *
  15690. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15691. * object. For flow_type vdev it is set to the
  15692. * vdevid, for peer it is peerid and for tid, it is
  15693. * tid_num.
  15694. *
  15695. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15696. * used in the host for this flow
  15697. * b'16:31 - reserved0: This field in reserved for the future.
  15698. *
  15699. */
  15700. PREPACK struct htt_flow_pool_unmap_t {
  15701. A_UINT32 msg_type:8,
  15702. reserved0:24;
  15703. A_UINT32 flow_type;
  15704. A_UINT32 flow_id;
  15705. A_UINT32 flow_pool_id:16,
  15706. reserved1:16;
  15707. } POSTPACK;
  15708. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15709. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15710. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15711. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15712. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15713. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15714. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15715. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15716. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15717. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15718. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15719. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15720. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15721. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15722. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15723. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15724. do { \
  15725. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15726. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15727. } while (0)
  15728. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15729. do { \
  15730. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15731. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15732. } while (0)
  15733. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15734. do { \
  15735. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15736. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15737. } while (0)
  15738. /**
  15739. * @brief target -> host SRING setup done message
  15740. *
  15741. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15742. *
  15743. * @details
  15744. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15745. * SRNG ring setup is done
  15746. *
  15747. * This message indicates whether the last setup operation is successful.
  15748. * It will be sent to host when host set respose_required bit in
  15749. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15750. * The message would appear as follows:
  15751. *
  15752. * |31 24|23 16|15 8|7 0|
  15753. * |--------------- +----------------+----------------+----------------|
  15754. * | setup_status | ring_id | pdev_id | msg_type |
  15755. * |-------------------------------------------------------------------|
  15756. *
  15757. * The message is interpreted as follows:
  15758. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15759. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15760. * b'8:15 - pdev_id:
  15761. * 0 (for rings at SOC/UMAC level),
  15762. * 1/2/3 mac id (for rings at LMAC level)
  15763. * b'16:23 - ring_id: Identify the ring which is set up
  15764. * More details can be got from enum htt_srng_ring_id
  15765. * b'24:31 - setup_status: Indicate status of setup operation
  15766. * Refer to htt_ring_setup_status
  15767. */
  15768. PREPACK struct htt_sring_setup_done_t {
  15769. A_UINT32 msg_type: 8,
  15770. pdev_id: 8,
  15771. ring_id: 8,
  15772. setup_status: 8;
  15773. } POSTPACK;
  15774. enum htt_ring_setup_status {
  15775. htt_ring_setup_status_ok = 0,
  15776. htt_ring_setup_status_error,
  15777. };
  15778. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15779. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15780. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15781. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15782. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15783. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15784. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15785. do { \
  15786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15787. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15788. } while (0)
  15789. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15790. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15791. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15792. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15793. HTT_SRING_SETUP_DONE_RING_ID_S)
  15794. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15795. do { \
  15796. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15797. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15798. } while (0)
  15799. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15800. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15801. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15802. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15803. HTT_SRING_SETUP_DONE_STATUS_S)
  15804. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15805. do { \
  15806. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15807. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15808. } while (0)
  15809. /**
  15810. * @brief target -> flow map flow info
  15811. *
  15812. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15813. *
  15814. * @details
  15815. * HTT TX map flow entry with tqm flow pointer
  15816. * Sent from firmware to host to add tqm flow pointer in corresponding
  15817. * flow search entry. Flow metadata is replayed back to host as part of this
  15818. * struct to enable host to find the specific flow search entry
  15819. *
  15820. * The message would appear as follows:
  15821. *
  15822. * |31 28|27 18|17 14|13 8|7 0|
  15823. * |-------+------------------------------------------+----------------|
  15824. * | rsvd0 | fse_hsh_idx | msg_type |
  15825. * |-------------------------------------------------------------------|
  15826. * | rsvd1 | tid | peer_id |
  15827. * |-------------------------------------------------------------------|
  15828. * | tqm_flow_pntr_lo |
  15829. * |-------------------------------------------------------------------|
  15830. * | tqm_flow_pntr_hi |
  15831. * |-------------------------------------------------------------------|
  15832. * | fse_meta_data |
  15833. * |-------------------------------------------------------------------|
  15834. *
  15835. * The message is interpreted as follows:
  15836. *
  15837. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15838. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15839. *
  15840. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15841. * for this flow entry
  15842. *
  15843. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15844. *
  15845. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15846. *
  15847. * dword1 - b'14:17 - tid
  15848. *
  15849. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15850. *
  15851. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15852. *
  15853. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15854. *
  15855. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15856. * given by host
  15857. */
  15858. PREPACK struct htt_tx_map_flow_info {
  15859. A_UINT32
  15860. msg_type: 8,
  15861. fse_hsh_idx: 20,
  15862. rsvd0: 4;
  15863. A_UINT32
  15864. peer_id: 14,
  15865. tid: 4,
  15866. rsvd1: 14;
  15867. A_UINT32 tqm_flow_pntr_lo;
  15868. A_UINT32 tqm_flow_pntr_hi;
  15869. struct htt_tx_flow_metadata fse_meta_data;
  15870. } POSTPACK;
  15871. /* DWORD 0 */
  15872. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15873. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15874. /* DWORD 1 */
  15875. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15876. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15877. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15878. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15879. /* DWORD 0 */
  15880. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15881. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15882. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15883. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15884. do { \
  15885. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15886. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15887. } while (0)
  15888. /* DWORD 1 */
  15889. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15890. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15891. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15892. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15893. do { \
  15894. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15895. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15896. } while (0)
  15897. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15898. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15899. HTT_TX_MAP_FLOW_INFO_TID_S)
  15900. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15901. do { \
  15902. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15903. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15904. } while (0)
  15905. /*
  15906. * htt_dbg_ext_stats_status -
  15907. * present - The requested stats have been delivered in full.
  15908. * This indicates that either the stats information was contained
  15909. * in its entirety within this message, or else this message
  15910. * completes the delivery of the requested stats info that was
  15911. * partially delivered through earlier STATS_CONF messages.
  15912. * partial - The requested stats have been delivered in part.
  15913. * One or more subsequent STATS_CONF messages with the same
  15914. * cookie value will be sent to deliver the remainder of the
  15915. * information.
  15916. * error - The requested stats could not be delivered, for example due
  15917. * to a shortage of memory to construct a message holding the
  15918. * requested stats.
  15919. * invalid - The requested stat type is either not recognized, or the
  15920. * target is configured to not gather the stats type in question.
  15921. */
  15922. enum htt_dbg_ext_stats_status {
  15923. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15924. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15925. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15926. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15927. };
  15928. /**
  15929. * @brief target -> host ppdu stats upload
  15930. *
  15931. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15932. *
  15933. * @details
  15934. * The following field definitions describe the format of the HTT target
  15935. * to host ppdu stats indication message.
  15936. *
  15937. *
  15938. * |31 16|15 12|11 10|9 8|7 0 |
  15939. * |----------------------------------------------------------------------|
  15940. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15941. * |----------------------------------------------------------------------|
  15942. * | ppdu_id |
  15943. * |----------------------------------------------------------------------|
  15944. * | Timestamp in us |
  15945. * |----------------------------------------------------------------------|
  15946. * | reserved |
  15947. * |----------------------------------------------------------------------|
  15948. * | type-specific stats info |
  15949. * | (see htt_ppdu_stats.h) |
  15950. * |----------------------------------------------------------------------|
  15951. * Header fields:
  15952. * - MSG_TYPE
  15953. * Bits 7:0
  15954. * Purpose: Identifies this is a PPDU STATS indication
  15955. * message.
  15956. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15957. * - mac_id
  15958. * Bits 9:8
  15959. * Purpose: mac_id of this ppdu_id
  15960. * Value: 0-3
  15961. * - pdev_id
  15962. * Bits 11:10
  15963. * Purpose: pdev_id of this ppdu_id
  15964. * Value: 0-3
  15965. * 0 (for rings at SOC level),
  15966. * 1/2/3 PDEV -> 0/1/2
  15967. * - payload_size
  15968. * Bits 31:16
  15969. * Purpose: total tlv size
  15970. * Value: payload_size in bytes
  15971. */
  15972. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15973. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15974. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15975. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15976. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15977. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15978. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15979. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15980. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15981. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15982. do { \
  15983. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15984. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15985. } while (0)
  15986. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15987. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15988. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15989. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15990. do { \
  15991. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15992. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15993. } while (0)
  15994. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15995. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15996. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15997. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15998. do { \
  15999. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  16000. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  16001. } while (0)
  16002. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  16003. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  16004. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  16005. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  16006. do { \
  16007. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  16008. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  16009. } while (0)
  16010. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  16011. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  16012. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  16013. /* htt_t2h_ppdu_stats_ind_hdr_t
  16014. * This struct contains the fields within the header of the
  16015. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  16016. * stats info.
  16017. * This struct assumes little-endian layout, and thus is only
  16018. * suitable for use within processors known to be little-endian
  16019. * (such as the target).
  16020. * In contrast, the above macros provide endian-portable methods
  16021. * to get and set the bitfields within this PPDU_STATS_IND header.
  16022. */
  16023. typedef struct {
  16024. A_UINT32 msg_type: 8, /* bits 7:0 */
  16025. mac_id: 2, /* bits 9:8 */
  16026. pdev_id: 2, /* bits 11:10 */
  16027. reserved1: 4, /* bits 15:12 */
  16028. payload_size: 16; /* bits 31:16 */
  16029. A_UINT32 ppdu_id;
  16030. A_UINT32 timestamp_us;
  16031. A_UINT32 reserved2;
  16032. } htt_t2h_ppdu_stats_ind_hdr_t;
  16033. /**
  16034. * @brief target -> host extended statistics upload
  16035. *
  16036. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  16037. *
  16038. * @details
  16039. * The following field definitions describe the format of the HTT target
  16040. * to host stats upload confirmation message.
  16041. * The message contains a cookie echoed from the HTT host->target stats
  16042. * upload request, which identifies which request the confirmation is
  16043. * for, and a single stats can span over multiple HTT stats indication
  16044. * due to the HTT message size limitation so every HTT ext stats indication
  16045. * will have tag-length-value stats information elements.
  16046. * The tag-length header for each HTT stats IND message also includes a
  16047. * status field, to indicate whether the request for the stat type in
  16048. * question was fully met, partially met, unable to be met, or invalid
  16049. * (if the stat type in question is disabled in the target).
  16050. * A Done bit 1's indicate the end of the of stats info elements.
  16051. *
  16052. *
  16053. * |31 16|15 12|11|10 8|7 5|4 0|
  16054. * |--------------------------------------------------------------|
  16055. * | reserved | msg type |
  16056. * |--------------------------------------------------------------|
  16057. * | cookie LSBs |
  16058. * |--------------------------------------------------------------|
  16059. * | cookie MSBs |
  16060. * |--------------------------------------------------------------|
  16061. * | stats entry length | rsvd | D| S | stat type |
  16062. * |--------------------------------------------------------------|
  16063. * | type-specific stats info |
  16064. * | (see htt_stats.h) |
  16065. * |--------------------------------------------------------------|
  16066. * Header fields:
  16067. * - MSG_TYPE
  16068. * Bits 7:0
  16069. * Purpose: Identifies this is a extended statistics upload confirmation
  16070. * message.
  16071. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  16072. * - COOKIE_LSBS
  16073. * Bits 31:0
  16074. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16075. * message with its preceding host->target stats request message.
  16076. * Value: LSBs of the opaque cookie specified by the host-side requestor
  16077. * - COOKIE_MSBS
  16078. * Bits 31:0
  16079. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16080. * message with its preceding host->target stats request message.
  16081. * Value: MSBs of the opaque cookie specified by the host-side requestor
  16082. *
  16083. * Stats Information Element tag-length header fields:
  16084. * - STAT_TYPE
  16085. * Bits 7:0
  16086. * Purpose: identifies the type of statistics info held in the
  16087. * following information element
  16088. * Value: htt_dbg_ext_stats_type
  16089. * - STATUS
  16090. * Bits 10:8
  16091. * Purpose: indicate whether the requested stats are present
  16092. * Value: htt_dbg_ext_stats_status
  16093. * - DONE
  16094. * Bits 11
  16095. * Purpose:
  16096. * Indicates the completion of the stats entry, this will be the last
  16097. * stats conf HTT segment for the requested stats type.
  16098. * Value:
  16099. * 0 -> the stats retrieval is ongoing
  16100. * 1 -> the stats retrieval is complete
  16101. * - LENGTH
  16102. * Bits 31:16
  16103. * Purpose: indicate the stats information size
  16104. * Value: This field specifies the number of bytes of stats information
  16105. * that follows the element tag-length header.
  16106. * It is expected but not required that this length is a multiple of
  16107. * 4 bytes.
  16108. */
  16109. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  16110. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  16111. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  16112. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  16113. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  16114. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  16115. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  16116. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  16117. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  16118. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  16119. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  16120. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  16121. do { \
  16122. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  16123. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  16124. } while (0)
  16125. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  16126. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  16127. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  16128. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  16129. do { \
  16130. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  16131. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  16132. } while (0)
  16133. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  16134. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  16135. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  16136. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  16137. do { \
  16138. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  16139. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  16140. } while (0)
  16141. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  16142. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  16143. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  16144. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  16145. do { \
  16146. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  16147. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  16148. } while (0)
  16149. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  16150. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  16151. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  16152. /**
  16153. * @brief target -> host streaming statistics upload
  16154. *
  16155. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  16156. *
  16157. * @details
  16158. * The following field definitions describe the format of the HTT target
  16159. * to host streaming stats upload indication message.
  16160. * The host can use a STREAMING_STATS_REQ message to enable the target to
  16161. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  16162. * use the STREAMING_STATS_REQ message to halt the target's production of
  16163. * STREAMING_STATS_IND messages.
  16164. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  16165. * the stats enabled by the host's STREAMING_STATS_REQ message.
  16166. *
  16167. * |31 8|7 0|
  16168. * |--------------------------------------------------------------|
  16169. * | reserved | msg type |
  16170. * |--------------------------------------------------------------|
  16171. * | type-specific stats info |
  16172. * | (see htt_stats.h) |
  16173. * |--------------------------------------------------------------|
  16174. * Header fields:
  16175. * - MSG_TYPE
  16176. * Bits 7:0
  16177. * Purpose: Identifies this as a streaming statistics upload indication
  16178. * message.
  16179. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  16180. */
  16181. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  16182. typedef enum {
  16183. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  16184. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  16185. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  16186. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  16187. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  16188. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  16189. /* Reserved from 128 - 255 for target internal use.*/
  16190. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  16191. } HTT_PEER_TYPE;
  16192. /** macro to convert MAC address from char array to HTT word format */
  16193. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  16194. (phtt_mac_addr)->mac_addr31to0 = \
  16195. (((c_macaddr)[0] << 0) | \
  16196. ((c_macaddr)[1] << 8) | \
  16197. ((c_macaddr)[2] << 16) | \
  16198. ((c_macaddr)[3] << 24)); \
  16199. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  16200. } while (0)
  16201. /**
  16202. * @brief target -> host monitor mac header indication message
  16203. *
  16204. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  16205. *
  16206. * @details
  16207. * The following diagram shows the format of the monitor mac header message
  16208. * sent from the target to the host.
  16209. * This message is primarily sent when promiscuous rx mode is enabled.
  16210. * One message is sent per rx PPDU.
  16211. *
  16212. * |31 24|23 16|15 8|7 0|
  16213. * |-------------------------------------------------------------|
  16214. * | peer_id | reserved0 | msg_type |
  16215. * |-------------------------------------------------------------|
  16216. * | reserved1 | num_mpdu |
  16217. * |-------------------------------------------------------------|
  16218. * | struct hw_rx_desc |
  16219. * | (see wal_rx_desc.h) |
  16220. * |-------------------------------------------------------------|
  16221. * | struct ieee80211_frame_addr4 |
  16222. * | (see ieee80211_defs.h) |
  16223. * |-------------------------------------------------------------|
  16224. * | struct ieee80211_frame_addr4 |
  16225. * | (see ieee80211_defs.h) |
  16226. * |-------------------------------------------------------------|
  16227. * | ...... |
  16228. * |-------------------------------------------------------------|
  16229. *
  16230. * Header fields:
  16231. * - msg_type
  16232. * Bits 7:0
  16233. * Purpose: Identifies this is a monitor mac header indication message.
  16234. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  16235. * - peer_id
  16236. * Bits 31:16
  16237. * Purpose: Software peer id given by host during association,
  16238. * During promiscuous mode, the peer ID will be invalid (0xFF)
  16239. * for rx PPDUs received from unassociated peers.
  16240. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  16241. * - num_mpdu
  16242. * Bits 15:0
  16243. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  16244. * delivered within the message.
  16245. * Value: 1 to 32
  16246. * num_mpdu is limited to a maximum value of 32, due to buffer
  16247. * size limits. For PPDUs with more than 32 MPDUs, only the
  16248. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  16249. * the PPDU will be provided.
  16250. */
  16251. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  16252. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  16253. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  16254. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  16255. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  16256. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  16257. do { \
  16258. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  16259. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  16260. } while (0)
  16261. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  16262. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  16263. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  16264. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  16265. do { \
  16266. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  16267. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  16268. } while (0)
  16269. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  16270. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  16271. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  16272. /**
  16273. * @brief target -> host flow pool resize Message
  16274. *
  16275. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  16276. *
  16277. * @details
  16278. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  16279. * the flow pool associated with the specified ID is resized
  16280. *
  16281. * The message would appear as follows:
  16282. *
  16283. * |31 16|15 8|7 0|
  16284. * |---------------------------------+----------------+----------------|
  16285. * | reserved0 | Msg type |
  16286. * |-------------------------------------------------------------------|
  16287. * | flow pool new size | flow pool ID |
  16288. * |-------------------------------------------------------------------|
  16289. *
  16290. * The message is interpreted as follows:
  16291. * b'0:7 - msg_type: This will be set to 0x21
  16292. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  16293. *
  16294. * b'0:15 - flow pool ID: Existing flow pool ID
  16295. *
  16296. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  16297. *
  16298. */
  16299. PREPACK struct htt_flow_pool_resize_t {
  16300. A_UINT32 msg_type:8,
  16301. reserved0:24;
  16302. A_UINT32 flow_pool_id:16,
  16303. flow_pool_new_size:16;
  16304. } POSTPACK;
  16305. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  16306. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  16307. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  16308. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  16309. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  16310. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  16311. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  16312. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  16313. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  16314. do { \
  16315. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  16316. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  16317. } while (0)
  16318. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  16319. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  16320. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  16321. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  16322. do { \
  16323. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  16324. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  16325. } while (0)
  16326. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  16327. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  16328. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  16329. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  16330. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  16331. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  16332. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  16333. /*
  16334. * The read and write indices point to the data within the host buffer.
  16335. * Because the first 4 bytes of the host buffer is used for the read index and
  16336. * the next 4 bytes for the write index, the data itself starts at offset 8.
  16337. * The read index and write index are the byte offsets from the base of the
  16338. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  16339. * Refer the ASCII text picture below.
  16340. */
  16341. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  16342. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  16343. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  16344. /*
  16345. ***************************************************************************
  16346. *
  16347. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16348. *
  16349. ***************************************************************************
  16350. *
  16351. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  16352. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  16353. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  16354. * written into the Host memory region mentioned below.
  16355. *
  16356. * Read index is updated by the Host. At any point of time, the read index will
  16357. * indicate the index that will next be read by the Host. The read index is
  16358. * in units of bytes offset from the base of the meta-data buffer.
  16359. *
  16360. * Write index is updated by the FW. At any point of time, the write index will
  16361. * indicate from where the FW can start writing any new data. The write index is
  16362. * in units of bytes offset from the base of the meta-data buffer.
  16363. *
  16364. * If the Host is not fast enough in reading the CFR data, any new capture data
  16365. * would be dropped if there is no space left to write the new captures.
  16366. *
  16367. * The last 4 bytes of the memory region will have the magic pattern
  16368. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  16369. * not overrun the host buffer.
  16370. *
  16371. * ,--------------------. read and write indices store the
  16372. * | | byte offset from the base of the
  16373. * | ,--------+--------. meta-data buffer to the next
  16374. * | | | | location within the data buffer
  16375. * | | v v that will be read / written
  16376. * ************************************************************************
  16377. * * Read * Write * * Magic *
  16378. * * index * index * CFR data1 ...... CFR data N * pattern *
  16379. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  16380. * ************************************************************************
  16381. * |<---------- data buffer ---------->|
  16382. *
  16383. * |<----------------- meta-data buffer allocated in Host ----------------|
  16384. *
  16385. * Note:
  16386. * - Considering the 4 bytes needed to store the Read index (R) and the
  16387. * Write index (W), the initial value is as follows:
  16388. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  16389. * - Buffer empty condition:
  16390. * R = W
  16391. *
  16392. * Regarding CFR data format:
  16393. * --------------------------
  16394. *
  16395. * Each CFR tone is stored in HW as 16-bits with the following format:
  16396. * {bits[15:12], bits[11:6], bits[5:0]} =
  16397. * {unsigned exponent (4 bits),
  16398. * signed mantissa_real (6 bits),
  16399. * signed mantissa_imag (6 bits)}
  16400. *
  16401. * CFR_real = mantissa_real * 2^(exponent-5)
  16402. * CFR_imag = mantissa_imag * 2^(exponent-5)
  16403. *
  16404. *
  16405. * The CFR data is written to the 16-bit unsigned output array (buff) in
  16406. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  16407. *
  16408. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  16409. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  16410. * .
  16411. * .
  16412. * .
  16413. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  16414. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  16415. */
  16416. /* Bandwidth of peer CFR captures */
  16417. typedef enum {
  16418. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  16419. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  16420. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  16421. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  16422. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  16423. HTT_PEER_CFR_CAPTURE_BW_MAX,
  16424. } HTT_PEER_CFR_CAPTURE_BW;
  16425. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  16426. * was captured
  16427. */
  16428. typedef enum {
  16429. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  16430. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  16431. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  16432. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  16433. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  16434. } HTT_PEER_CFR_CAPTURE_MODE;
  16435. typedef enum {
  16436. /* This message type is currently used for the below purpose:
  16437. *
  16438. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  16439. * wmi_peer_cfr_capture_cmd.
  16440. * If payload_present bit is set to 0 then the associated memory region
  16441. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  16442. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  16443. * message; the CFR dump will be present at the end of the message,
  16444. * after the chan_phy_mode.
  16445. */
  16446. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  16447. /* Always keep this last */
  16448. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  16449. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  16450. /**
  16451. * @brief target -> host CFR dump completion indication message definition
  16452. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  16453. *
  16454. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  16455. *
  16456. * @details
  16457. * The following diagram shows the format of the Channel Frequency Response
  16458. * (CFR) dump completion indication. This inidcation is sent to the Host when
  16459. * the channel capture of a peer is copied by Firmware into the Host memory
  16460. *
  16461. * **************************************************************************
  16462. *
  16463. * Message format when the CFR capture message type is
  16464. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16465. *
  16466. * **************************************************************************
  16467. *
  16468. * |31 16|15 |8|7 0|
  16469. * |----------------------------------------------------------------|
  16470. * header: | reserved |P| msg_type |
  16471. * word 0 | | | |
  16472. * |----------------------------------------------------------------|
  16473. * payload: | cfr_capture_msg_type |
  16474. * word 1 | |
  16475. * |----------------------------------------------------------------|
  16476. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  16477. * word 2 | | | | | | | | |
  16478. * |----------------------------------------------------------------|
  16479. * | mac_addr31to0 |
  16480. * word 3 | |
  16481. * |----------------------------------------------------------------|
  16482. * | unused / reserved | mac_addr47to32 |
  16483. * word 4 | | |
  16484. * |----------------------------------------------------------------|
  16485. * | index |
  16486. * word 5 | |
  16487. * |----------------------------------------------------------------|
  16488. * | length |
  16489. * word 6 | |
  16490. * |----------------------------------------------------------------|
  16491. * | timestamp |
  16492. * word 7 | |
  16493. * |----------------------------------------------------------------|
  16494. * | counter |
  16495. * word 8 | |
  16496. * |----------------------------------------------------------------|
  16497. * | chan_mhz |
  16498. * word 9 | |
  16499. * |----------------------------------------------------------------|
  16500. * | band_center_freq1 |
  16501. * word 10 | |
  16502. * |----------------------------------------------------------------|
  16503. * | band_center_freq2 |
  16504. * word 11 | |
  16505. * |----------------------------------------------------------------|
  16506. * | chan_phy_mode |
  16507. * word 12 | |
  16508. * |----------------------------------------------------------------|
  16509. * where,
  16510. * P - payload present bit (payload_present explained below)
  16511. * req_id - memory request id (mem_req_id explained below)
  16512. * S - status field (status explained below)
  16513. * capbw - capture bandwidth (capture_bw explained below)
  16514. * mode - mode of capture (mode explained below)
  16515. * sts - space time streams (sts_count explained below)
  16516. * chbw - channel bandwidth (channel_bw explained below)
  16517. * captype - capture type (cap_type explained below)
  16518. *
  16519. * The following field definitions describe the format of the CFR dump
  16520. * completion indication sent from the target to the host
  16521. *
  16522. * Header fields:
  16523. *
  16524. * Word 0
  16525. * - msg_type
  16526. * Bits 7:0
  16527. * Purpose: Identifies this as CFR TX completion indication
  16528. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  16529. * - payload_present
  16530. * Bit 8
  16531. * Purpose: Identifies how CFR data is sent to host
  16532. * Value: 0 - If CFR Payload is written to host memory
  16533. * 1 - If CFR Payload is sent as part of HTT message
  16534. * (This is the requirement for SDIO/USB where it is
  16535. * not possible to write CFR data to host memory)
  16536. * - reserved
  16537. * Bits 31:9
  16538. * Purpose: Reserved
  16539. * Value: 0
  16540. *
  16541. * Payload fields:
  16542. *
  16543. * Word 1
  16544. * - cfr_capture_msg_type
  16545. * Bits 31:0
  16546. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  16547. * to specify the format used for the remainder of the message
  16548. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16549. * (currently only MSG_TYPE_1 is defined)
  16550. *
  16551. * Word 2
  16552. * - mem_req_id
  16553. * Bits 6:0
  16554. * Purpose: Contain the mem request id of the region where the CFR capture
  16555. * has been stored - of type WMI_HOST_MEM_REQ_ID
  16556. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  16557. this value is invalid)
  16558. * - status
  16559. * Bit 7
  16560. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  16561. * Value: 1 (True) - Successful; 0 (False) - Not successful
  16562. * - capture_bw
  16563. * Bits 10:8
  16564. * Purpose: Carry the bandwidth of the CFR capture
  16565. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  16566. * - mode
  16567. * Bits 13:11
  16568. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  16569. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  16570. * - sts_count
  16571. * Bits 16:14
  16572. * Purpose: Carry the number of space time streams
  16573. * Value: Number of space time streams
  16574. * - channel_bw
  16575. * Bits 19:17
  16576. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  16577. * measurement
  16578. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  16579. * - cap_type
  16580. * Bits 23:20
  16581. * Purpose: Carry the type of the capture
  16582. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  16583. * - vdev_id
  16584. * Bits 31:24
  16585. * Purpose: Carry the virtual device id
  16586. * Value: vdev ID
  16587. *
  16588. * Word 3
  16589. * - mac_addr31to0
  16590. * Bits 31:0
  16591. * Purpose: Contain the bits 31:0 of the peer MAC address
  16592. * Value: Bits 31:0 of the peer MAC address
  16593. *
  16594. * Word 4
  16595. * - mac_addr47to32
  16596. * Bits 15:0
  16597. * Purpose: Contain the bits 47:32 of the peer MAC address
  16598. * Value: Bits 47:32 of the peer MAC address
  16599. *
  16600. * Word 5
  16601. * - index
  16602. * Bits 31:0
  16603. * Purpose: Contain the index at which this CFR dump was written in the Host
  16604. * allocated memory. This index is the number of bytes from the base address.
  16605. * Value: Index position
  16606. *
  16607. * Word 6
  16608. * - length
  16609. * Bits 31:0
  16610. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  16611. * Value: Length of the CFR capture of the peer
  16612. *
  16613. * Word 7
  16614. * - timestamp
  16615. * Bits 31:0
  16616. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  16617. * clock used for this timestamp is private to the target and not visible to
  16618. * the host i.e., Host can interpret only the relative timestamp deltas from
  16619. * one message to the next, but can't interpret the absolute timestamp from a
  16620. * single message.
  16621. * Value: Timestamp in microseconds
  16622. *
  16623. * Word 8
  16624. * - counter
  16625. * Bits 31:0
  16626. * Purpose: Carry the count of the current CFR capture from FW. This is
  16627. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  16628. * in host memory)
  16629. * Value: Count of the current CFR capture
  16630. *
  16631. * Word 9
  16632. * - chan_mhz
  16633. * Bits 31:0
  16634. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  16635. * Value: Primary 20 channel frequency
  16636. *
  16637. * Word 10
  16638. * - band_center_freq1
  16639. * Bits 31:0
  16640. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  16641. * Value: Center frequency 1 in MHz
  16642. *
  16643. * Word 11
  16644. * - band_center_freq2
  16645. * Bits 31:0
  16646. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  16647. * the VDEV
  16648. * 80plus80 mode
  16649. * Value: Center frequency 2 in MHz
  16650. *
  16651. * Word 12
  16652. * - chan_phy_mode
  16653. * Bits 31:0
  16654. * Purpose: Carry the phy mode of the channel, of the VDEV
  16655. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16656. */
  16657. PREPACK struct htt_cfr_dump_ind_type_1 {
  16658. A_UINT32 mem_req_id:7,
  16659. status:1,
  16660. capture_bw:3,
  16661. mode:3,
  16662. sts_count:3,
  16663. channel_bw:3,
  16664. cap_type:4,
  16665. vdev_id:8;
  16666. htt_mac_addr addr;
  16667. A_UINT32 index;
  16668. A_UINT32 length;
  16669. A_UINT32 timestamp;
  16670. A_UINT32 counter;
  16671. struct htt_chan_change_msg chan;
  16672. } POSTPACK;
  16673. PREPACK struct htt_cfr_dump_compl_ind {
  16674. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16675. union {
  16676. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16677. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16678. /* If there is a need to change the memory layout and its associated
  16679. * HTT indication format, a new CFR capture message type can be
  16680. * introduced and added into this union.
  16681. */
  16682. };
  16683. } POSTPACK;
  16684. /*
  16685. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16686. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16687. */
  16688. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16689. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16690. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16691. do { \
  16692. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16693. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16694. } while(0)
  16695. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16696. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16697. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16698. /*
  16699. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16700. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16701. */
  16702. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16703. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16704. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16705. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16706. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16707. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16708. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16709. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16710. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16711. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16712. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16713. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16714. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16715. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16716. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16717. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16718. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16719. do { \
  16720. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16721. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16722. } while (0)
  16723. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16724. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16725. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16726. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16727. do { \
  16728. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16729. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16730. } while (0)
  16731. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16732. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16733. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16734. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16735. do { \
  16736. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16737. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16738. } while (0)
  16739. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16740. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16741. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16742. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16743. do { \
  16744. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16745. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16746. } while (0)
  16747. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16748. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16749. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16750. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16751. do { \
  16752. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16753. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16754. } while (0)
  16755. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16756. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16757. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16758. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16759. do { \
  16760. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16761. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16762. } while (0)
  16763. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16764. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16765. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16766. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16767. do { \
  16768. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16769. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16770. } while (0)
  16771. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16772. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16773. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16774. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16775. do { \
  16776. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16777. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16778. } while (0)
  16779. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16780. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16781. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16782. /**
  16783. * @brief target -> host peer (PPDU) stats message
  16784. *
  16785. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16786. *
  16787. * @details
  16788. * This message is generated by FW when FW is sending stats to host
  16789. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16790. * This message is sent autonomously by the target rather than upon request
  16791. * by the host.
  16792. * The following field definitions describe the format of the HTT target
  16793. * to host peer stats indication message.
  16794. *
  16795. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16796. * or more PPDU stats records.
  16797. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16798. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16799. * then the message would start with the
  16800. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16801. * below.
  16802. *
  16803. * |31 16|15|14|13 11|10 9|8|7 0|
  16804. * |-------------------------------------------------------------|
  16805. * | reserved |MSG_TYPE |
  16806. * |-------------------------------------------------------------|
  16807. * rec 0 | TLV header |
  16808. * rec 0 |-------------------------------------------------------------|
  16809. * rec 0 | ppdu successful bytes |
  16810. * rec 0 |-------------------------------------------------------------|
  16811. * rec 0 | ppdu retry bytes |
  16812. * rec 0 |-------------------------------------------------------------|
  16813. * rec 0 | ppdu failed bytes |
  16814. * rec 0 |-------------------------------------------------------------|
  16815. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16816. * rec 0 |-------------------------------------------------------------|
  16817. * rec 0 | retried MSDUs | successful MSDUs |
  16818. * rec 0 |-------------------------------------------------------------|
  16819. * rec 0 | TX duration | failed MSDUs |
  16820. * rec 0 |-------------------------------------------------------------|
  16821. * ...
  16822. * |-------------------------------------------------------------|
  16823. * rec N | TLV header |
  16824. * rec N |-------------------------------------------------------------|
  16825. * rec N | ppdu successful bytes |
  16826. * rec N |-------------------------------------------------------------|
  16827. * rec N | ppdu retry bytes |
  16828. * rec N |-------------------------------------------------------------|
  16829. * rec N | ppdu failed bytes |
  16830. * rec N |-------------------------------------------------------------|
  16831. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16832. * rec N |-------------------------------------------------------------|
  16833. * rec N | retried MSDUs | successful MSDUs |
  16834. * rec N |-------------------------------------------------------------|
  16835. * rec N | TX duration | failed MSDUs |
  16836. * rec N |-------------------------------------------------------------|
  16837. *
  16838. * where:
  16839. * A = is A-MPDU flag
  16840. * BA = block-ack failure flags
  16841. * BW = bandwidth spec
  16842. * SG = SGI enabled spec
  16843. * S = skipped rate ctrl
  16844. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16845. *
  16846. * Header
  16847. * ------
  16848. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16849. * dword0 - b'8:31 - reserved : Reserved for future use
  16850. *
  16851. * payload include below peer_stats information
  16852. * --------------------------------------------
  16853. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16854. * @tx_success_bytes : total successful bytes in the PPDU.
  16855. * @tx_retry_bytes : total retried bytes in the PPDU.
  16856. * @tx_failed_bytes : total failed bytes in the PPDU.
  16857. * @tx_ratecode : rate code used for the PPDU.
  16858. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16859. * @ba_ack_failed : BA/ACK failed for this PPDU
  16860. * b00 -> BA received
  16861. * b01 -> BA failed once
  16862. * b10 -> BA failed twice, when HW retry is enabled.
  16863. * @bw : BW
  16864. * b00 -> 20 MHz
  16865. * b01 -> 40 MHz
  16866. * b10 -> 80 MHz
  16867. * b11 -> 160 MHz (or 80+80)
  16868. * @sg : SGI enabled
  16869. * @s : skipped ratectrl
  16870. * @peer_id : peer id
  16871. * @tx_success_msdus : successful MSDUs
  16872. * @tx_retry_msdus : retried MSDUs
  16873. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16874. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16875. */
  16876. /**
  16877. * @brief target -> host backpressure event
  16878. *
  16879. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16880. *
  16881. * @details
  16882. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16883. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16884. * This message will only be sent if the backpressure condition has existed
  16885. * continuously for an initial period (100 ms).
  16886. * Repeat messages with updated information will be sent after each
  16887. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16888. * This message indicates the ring id along with current head and tail index
  16889. * locations (i.e. write and read indices).
  16890. * The backpressure time indicates the time in ms for which continuous
  16891. * backpressure has been observed in the ring.
  16892. *
  16893. * The message format is as follows:
  16894. *
  16895. * |31 24|23 16|15 8|7 0|
  16896. * |----------------+----------------+----------------+----------------|
  16897. * | ring_id | ring_type | pdev_id | msg_type |
  16898. * |-------------------------------------------------------------------|
  16899. * | tail_idx | head_idx |
  16900. * |-------------------------------------------------------------------|
  16901. * | backpressure_time_ms |
  16902. * |-------------------------------------------------------------------|
  16903. *
  16904. * The message is interpreted as follows:
  16905. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16906. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16907. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16908. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16909. * the msg is for LMAC ring.
  16910. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16911. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16912. * htt_backpressure_lmac_ring_id. This represents
  16913. * the ring id for which continuous backpressure
  16914. * is seen
  16915. *
  16916. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16917. * the ring indicated by the ring_id
  16918. *
  16919. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16920. * the ring indicated by the ring id
  16921. *
  16922. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16923. * backpressure has been seen in the ring
  16924. * indicated by the ring_id.
  16925. * Units = milliseconds
  16926. */
  16927. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16928. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16929. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16930. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16931. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16932. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16933. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16934. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16935. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16936. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16937. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16938. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16939. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16940. do { \
  16941. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16942. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16943. } while (0)
  16944. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16945. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16946. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16947. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16948. do { \
  16949. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16950. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16951. } while (0)
  16952. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16953. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16954. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16955. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16956. do { \
  16957. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16958. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16959. } while (0)
  16960. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16961. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16962. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16963. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16964. do { \
  16965. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16966. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16967. } while (0)
  16968. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16969. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16970. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16971. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16972. do { \
  16973. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16974. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16975. } while (0)
  16976. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16977. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16978. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16979. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16980. do { \
  16981. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16982. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16983. } while (0)
  16984. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16985. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16986. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16987. enum htt_backpressure_ring_type {
  16988. HTT_SW_RING_TYPE_UMAC,
  16989. HTT_SW_RING_TYPE_LMAC,
  16990. HTT_SW_RING_TYPE_MAX,
  16991. };
  16992. /* Ring id for which the message is sent to host */
  16993. enum htt_backpressure_umac_ringid {
  16994. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16995. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16996. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16997. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16998. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16999. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  17000. HTT_SW_RING_IDX_REO_REO2FW_RING,
  17001. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  17002. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  17003. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  17004. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  17005. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  17006. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  17007. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  17008. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  17009. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  17010. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  17011. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  17012. HTT_SW_UMAC_RING_IDX_MAX,
  17013. };
  17014. enum htt_backpressure_lmac_ringid {
  17015. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  17016. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  17017. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  17018. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  17019. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  17020. HTT_SW_RING_IDX_RXDMA2FW_RING,
  17021. HTT_SW_RING_IDX_RXDMA2SW_RING,
  17022. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  17023. HTT_SW_RING_IDX_RXDMA2REO_RING,
  17024. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  17025. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  17026. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  17027. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  17028. HTT_SW_LMAC_RING_IDX_MAX,
  17029. };
  17030. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  17031. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  17032. pdev_id: 8,
  17033. ring_type: 8, /* htt_backpressure_ring_type */
  17034. /*
  17035. * ring_id holds an enum value from either
  17036. * htt_backpressure_umac_ringid or
  17037. * htt_backpressure_lmac_ringid, based on
  17038. * the ring_type setting.
  17039. */
  17040. ring_id: 8;
  17041. A_UINT16 head_idx;
  17042. A_UINT16 tail_idx;
  17043. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  17044. } POSTPACK;
  17045. /*
  17046. * Defines two 32 bit words that can be used by the target to indicate a per
  17047. * user RU allocation and rate information.
  17048. *
  17049. * This information is currently provided in the "sw_response_reference_ptr"
  17050. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  17051. * "rx_ppdu_end_user_stats" TLV.
  17052. *
  17053. * VALID:
  17054. * The consumer of these words must explicitly check the valid bit,
  17055. * and only attempt interpretation of any of the remaining fields if
  17056. * the valid bit is set to 1.
  17057. *
  17058. * VERSION:
  17059. * The consumer of these words must also explicitly check the version bit,
  17060. * and only use the V0 definition if the VERSION field is set to 0.
  17061. *
  17062. * Version 1 is currently undefined, with the exception of the VALID and
  17063. * VERSION fields.
  17064. *
  17065. * Version 0:
  17066. *
  17067. * The fields below are duplicated per BW.
  17068. *
  17069. * The consumer must determine which BW field to use, based on the UL OFDMA
  17070. * PPDU BW indicated by HW.
  17071. *
  17072. * RU_START: RU26 start index for the user.
  17073. * Note that this is always using the RU26 index, regardless
  17074. * of the actual RU assigned to the user
  17075. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  17076. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  17077. *
  17078. * For example, 20MHz (the value in the top row is RU_START)
  17079. *
  17080. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  17081. * RU Size 1 (52): | | | | | |
  17082. * RU Size 2 (106): | | | |
  17083. * RU Size 3 (242): | |
  17084. *
  17085. * RU_SIZE: Indicates the RU size, as defined by enum
  17086. * htt_ul_ofdma_user_info_ru_size.
  17087. *
  17088. * LDPC: LDPC enabled (if 0, BCC is used)
  17089. *
  17090. * DCM: DCM enabled
  17091. *
  17092. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  17093. * |---------------------------------+--------------------------------|
  17094. * |Ver|Valid| FW internal |
  17095. * |---------------------------------+--------------------------------|
  17096. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  17097. * |---------------------------------+--------------------------------|
  17098. */
  17099. enum htt_ul_ofdma_user_info_ru_size {
  17100. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  17101. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  17102. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  17103. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  17104. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  17105. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  17106. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  17107. };
  17108. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  17109. struct htt_ul_ofdma_user_info_v0 {
  17110. A_UINT32 word0;
  17111. A_UINT32 word1;
  17112. };
  17113. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  17114. A_UINT32 w0_fw_rsvd:30; \
  17115. A_UINT32 w0_valid:1; \
  17116. A_UINT32 w0_version:1;
  17117. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  17118. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17119. };
  17120. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  17121. A_UINT32 w1_nss:3; \
  17122. A_UINT32 w1_mcs:4; \
  17123. A_UINT32 w1_ldpc:1; \
  17124. A_UINT32 w1_dcm:1; \
  17125. A_UINT32 w1_ru_start:7; \
  17126. A_UINT32 w1_ru_size:3; \
  17127. A_UINT32 w1_trig_type:4; \
  17128. A_UINT32 w1_unused:9;
  17129. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  17130. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17131. };
  17132. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  17133. A_UINT32 w0_fw_rsvd:27; \
  17134. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  17135. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  17136. 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) */
  17137. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  17138. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17139. };
  17140. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  17141. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  17142. A_UINT32 w1_trig_type:4; \
  17143. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  17144. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  17145. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17146. };
  17147. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  17148. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  17149. union {
  17150. A_UINT32 word0;
  17151. struct {
  17152. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17153. };
  17154. };
  17155. union {
  17156. A_UINT32 word1;
  17157. struct {
  17158. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17159. };
  17160. };
  17161. } POSTPACK;
  17162. /*
  17163. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  17164. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  17165. * this should be picked.
  17166. */
  17167. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  17168. union {
  17169. A_UINT32 word0;
  17170. struct {
  17171. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17172. };
  17173. };
  17174. union {
  17175. A_UINT32 word1;
  17176. struct {
  17177. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17178. };
  17179. };
  17180. } POSTPACK;
  17181. enum HTT_UL_OFDMA_TRIG_TYPE {
  17182. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  17183. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  17184. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  17185. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  17186. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  17187. };
  17188. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  17189. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  17190. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  17191. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  17192. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  17193. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  17194. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  17195. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  17196. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  17197. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  17198. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  17199. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  17200. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  17201. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  17202. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  17203. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  17204. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  17205. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  17206. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  17207. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  17208. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  17209. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  17210. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  17211. /*--- word 0 ---*/
  17212. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  17213. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  17214. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  17215. do { \
  17216. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  17217. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  17218. } while (0)
  17219. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  17220. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  17221. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  17222. do { \
  17223. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  17224. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  17225. } while (0)
  17226. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  17227. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  17228. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  17229. do { \
  17230. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  17231. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  17232. } while (0)
  17233. /*--- word 1 ---*/
  17234. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  17235. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  17236. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  17237. do { \
  17238. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  17239. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  17240. } while (0)
  17241. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  17242. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  17243. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  17244. do { \
  17245. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  17246. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  17247. } while (0)
  17248. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  17249. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  17250. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  17251. do { \
  17252. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  17253. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  17254. } while (0)
  17255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  17256. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  17257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  17258. do { \
  17259. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  17260. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  17261. } while (0)
  17262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  17263. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  17264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  17265. do { \
  17266. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  17267. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  17268. } while (0)
  17269. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  17270. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  17271. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  17272. do { \
  17273. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  17274. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  17275. } while (0)
  17276. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  17277. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  17278. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  17279. do { \
  17280. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  17281. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  17282. } while (0)
  17283. /**
  17284. * @brief target -> host channel calibration data message
  17285. *
  17286. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  17287. *
  17288. * @brief host -> target channel calibration data message
  17289. *
  17290. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  17291. *
  17292. * @details
  17293. * The following field definitions describe the format of the channel
  17294. * calibration data message sent from the target to the host when
  17295. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  17296. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  17297. * The message is defined as htt_chan_caldata_msg followed by a variable
  17298. * number of 32-bit character values.
  17299. *
  17300. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  17301. * |------------------------------------------------------------------|
  17302. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  17303. * |------------------------------------------------------------------|
  17304. * | payload size | mhz |
  17305. * |------------------------------------------------------------------|
  17306. * | center frequency 2 | center frequency 1 |
  17307. * |------------------------------------------------------------------|
  17308. * | check sum |
  17309. * |------------------------------------------------------------------|
  17310. * | payload |
  17311. * |------------------------------------------------------------------|
  17312. * message info field:
  17313. * - MSG_TYPE
  17314. * Bits 7:0
  17315. * Purpose: identifies this as a channel calibration data message
  17316. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  17317. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  17318. * - SUB_TYPE
  17319. * Bits 11:8
  17320. * Purpose: T2H: indicates whether target is providing chan cal data
  17321. * to the host to store, or requesting that the host
  17322. * download previously-stored data.
  17323. * H2T: indicates whether the host is providing the requested
  17324. * channel cal data, or if it is rejecting the data
  17325. * request because it does not have the requested data.
  17326. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  17327. * - CHKSUM_VALID
  17328. * Bit 12
  17329. * Purpose: indicates if the checksum field is valid
  17330. * value:
  17331. * - FRAG
  17332. * Bit 19:16
  17333. * Purpose: indicates the fragment index for message
  17334. * value: 0 for first fragment, 1 for second fragment, ...
  17335. * - APPEND
  17336. * Bit 20
  17337. * Purpose: indicates if this is the last fragment
  17338. * value: 0 = final fragment, 1 = more fragments will be appended
  17339. *
  17340. * channel and payload size field
  17341. * - MHZ
  17342. * Bits 15:0
  17343. * Purpose: indicates the channel primary frequency
  17344. * Value:
  17345. * - PAYLOAD_SIZE
  17346. * Bits 31:16
  17347. * Purpose: indicates the bytes of calibration data in payload
  17348. * Value:
  17349. *
  17350. * center frequency field
  17351. * - CENTER FREQUENCY 1
  17352. * Bits 15:0
  17353. * Purpose: indicates the channel center frequency
  17354. * Value: channel center frequency, in MHz units
  17355. * - CENTER FREQUENCY 2
  17356. * Bits 31:16
  17357. * Purpose: indicates the secondary channel center frequency,
  17358. * only for 11acvht 80plus80 mode
  17359. * Value: secondary channel center frequency, in MHz units, if applicable
  17360. *
  17361. * checksum field
  17362. * - CHECK_SUM
  17363. * Bits 31:0
  17364. * Purpose: check the payload data, it is just for this fragment.
  17365. * This is intended for the target to check that the channel
  17366. * calibration data returned by the host is the unmodified data
  17367. * that was previously provided to the host by the target.
  17368. * value: checksum of fragment payload
  17369. */
  17370. PREPACK struct htt_chan_caldata_msg {
  17371. /* DWORD 0: message info */
  17372. A_UINT32
  17373. msg_type: 8,
  17374. sub_type: 4 ,
  17375. chksum_valid: 1, /** 1:valid, 0:invalid */
  17376. reserved1: 3,
  17377. frag_idx: 4, /** fragment index for calibration data */
  17378. appending: 1, /** 0: no fragment appending,
  17379. * 1: extra fragment appending */
  17380. reserved2: 11;
  17381. /* DWORD 1: channel and payload size */
  17382. A_UINT32
  17383. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  17384. payload_size: 16; /** unit: bytes */
  17385. /* DWORD 2: center frequency */
  17386. A_UINT32
  17387. band_center_freq1: 16, /** Center frequency 1 in MHz */
  17388. band_center_freq2: 16; /** Center frequency 2 in MHz,
  17389. * valid only for 11acvht 80plus80 mode */
  17390. /* DWORD 3: check sum */
  17391. A_UINT32 chksum;
  17392. /* variable length for calibration data */
  17393. A_UINT32 payload[1/* or more */];
  17394. } POSTPACK;
  17395. /* T2H SUBTYPE */
  17396. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  17397. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  17398. /* H2T SUBTYPE */
  17399. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  17400. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  17401. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  17402. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  17403. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  17404. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  17405. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  17406. do { \
  17407. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  17408. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  17409. } while (0)
  17410. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  17411. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  17412. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  17413. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  17414. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  17415. do { \
  17416. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  17417. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  17418. } while (0)
  17419. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  17420. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  17421. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  17422. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  17423. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  17424. do { \
  17425. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  17426. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  17427. } while (0)
  17428. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  17429. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  17430. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  17431. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  17432. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  17433. do { \
  17434. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  17435. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  17436. } while (0)
  17437. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  17438. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  17439. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  17440. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  17441. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  17442. do { \
  17443. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  17444. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  17445. } while (0)
  17446. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  17447. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  17448. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  17449. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  17450. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  17451. do { \
  17452. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  17453. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  17454. } while (0)
  17455. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  17456. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  17457. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  17458. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  17459. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  17460. do { \
  17461. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  17462. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  17463. } while (0)
  17464. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  17465. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  17466. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  17467. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  17468. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  17469. do { \
  17470. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  17471. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  17472. } while (0)
  17473. /**
  17474. * @brief target -> host FSE CMEM based send
  17475. *
  17476. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  17477. *
  17478. * @details
  17479. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  17480. * FSE placement in CMEM is enabled.
  17481. *
  17482. * This message sends the non-secure CMEM base address.
  17483. * It will be sent to host in response to message
  17484. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  17485. * The message would appear as follows:
  17486. *
  17487. * |31 24|23 16|15 8|7 0|
  17488. * |----------------+----------------+----------------+----------------|
  17489. * | reserved | num_entries | msg_type |
  17490. * |----------------+----------------+----------------+----------------|
  17491. * | base_address_lo |
  17492. * |----------------+----------------+----------------+----------------|
  17493. * | base_address_hi |
  17494. * |-------------------------------------------------------------------|
  17495. *
  17496. * The message is interpreted as follows:
  17497. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  17498. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  17499. * b'8:15 - number_entries: Indicated the number of entries
  17500. * programmed.
  17501. * b'16:31 - reserved.
  17502. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  17503. * CMEM base address
  17504. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  17505. * CMEM base address
  17506. */
  17507. PREPACK struct htt_cmem_base_send_t {
  17508. A_UINT32 msg_type: 8,
  17509. num_entries: 8,
  17510. reserved: 16;
  17511. A_UINT32 base_address_lo;
  17512. A_UINT32 base_address_hi;
  17513. } POSTPACK;
  17514. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  17515. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  17516. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  17517. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  17518. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  17519. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  17520. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  17521. do { \
  17522. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  17523. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  17524. } while (0)
  17525. /**
  17526. * @brief - HTT PPDU ID format
  17527. *
  17528. * @details
  17529. * The following field definitions describe the format of the PPDU ID.
  17530. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  17531. *
  17532. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  17533. * +--------------------------------------------------------------------------
  17534. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  17535. * +--------------------------------------------------------------------------
  17536. *
  17537. * sch id :Schedule command id
  17538. * Bits [11 : 0] : monotonically increasing counter to track the
  17539. * PPDU posted to a specific transmit queue.
  17540. *
  17541. * hwq_id: Hardware Queue ID.
  17542. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  17543. *
  17544. * mac_id: MAC ID
  17545. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  17546. *
  17547. * seq_idx: Sequence index.
  17548. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  17549. * a particular TXOP.
  17550. *
  17551. * tqm_cmd: HWSCH/TQM flag.
  17552. * Bit [23] : Always set to 0.
  17553. *
  17554. * seq_cmd_type: Sequence command type.
  17555. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  17556. * Refer to enum HTT_STATS_FTYPE for values.
  17557. */
  17558. PREPACK struct htt_ppdu_id {
  17559. A_UINT32
  17560. sch_id: 12,
  17561. hwq_id: 5,
  17562. mac_id: 2,
  17563. seq_idx: 2,
  17564. reserved1: 2,
  17565. tqm_cmd: 1,
  17566. seq_cmd_type: 6,
  17567. reserved2: 2;
  17568. } POSTPACK;
  17569. #define HTT_PPDU_ID_SCH_ID_S 0
  17570. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  17571. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  17572. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  17573. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  17574. do { \
  17575. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  17576. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  17577. } while (0)
  17578. #define HTT_PPDU_ID_HWQ_ID_S 12
  17579. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  17580. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  17581. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  17582. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  17583. do { \
  17584. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  17585. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  17586. } while (0)
  17587. #define HTT_PPDU_ID_MAC_ID_S 17
  17588. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  17589. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  17590. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  17591. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  17592. do { \
  17593. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  17594. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  17595. } while (0)
  17596. #define HTT_PPDU_ID_SEQ_IDX_S 19
  17597. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  17598. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  17599. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  17600. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  17601. do { \
  17602. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  17603. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  17604. } while (0)
  17605. #define HTT_PPDU_ID_TQM_CMD_S 23
  17606. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  17607. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  17608. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  17609. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  17610. do { \
  17611. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  17612. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  17613. } while (0)
  17614. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  17615. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  17616. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  17617. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  17618. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  17619. do { \
  17620. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  17621. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  17622. } while (0)
  17623. /**
  17624. * @brief target -> RX PEER METADATA V0 format
  17625. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17626. * message from target, and will confirm to the target which peer metadata
  17627. * version to use in the wmi_init message.
  17628. *
  17629. * The following diagram shows the format of the RX PEER METADATA.
  17630. *
  17631. * |31 24|23 16|15 8|7 0|
  17632. * |-----------------------------------------------------------------------|
  17633. * | Reserved | VDEV ID | PEER ID |
  17634. * |-----------------------------------------------------------------------|
  17635. */
  17636. PREPACK struct htt_rx_peer_metadata_v0 {
  17637. A_UINT32
  17638. peer_id: 16,
  17639. vdev_id: 8,
  17640. reserved1: 8;
  17641. } POSTPACK;
  17642. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  17643. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  17644. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  17645. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  17646. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  17647. do { \
  17648. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  17649. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  17650. } while (0)
  17651. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  17652. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  17653. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17654. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17655. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17656. do { \
  17657. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17658. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17659. } while (0)
  17660. /**
  17661. * @brief target -> RX PEER METADATA V1 format
  17662. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17663. * message from target, and will confirm to the target which peer metadata
  17664. * version to use in the wmi_init message.
  17665. *
  17666. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17667. *
  17668. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17669. * |---------------------------------------------------------------------------|
  17670. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17671. * |---------------------------------------------------------------------------|
  17672. */
  17673. PREPACK struct htt_rx_peer_metadata_v1 {
  17674. A_UINT32
  17675. peer_id: 13,
  17676. ml_peer_valid: 1,
  17677. logical_link_id: 2,
  17678. vdev_id: 8,
  17679. lmac_id: 2,
  17680. chip_id: 3,
  17681. reserved2: 3;
  17682. } POSTPACK;
  17683. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17684. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17685. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17686. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17687. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17688. do { \
  17689. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17690. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17691. } while (0)
  17692. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17693. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17694. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17695. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17696. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17697. do { \
  17698. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17699. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17700. } while (0)
  17701. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17702. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17703. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17704. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17705. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17706. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17707. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17708. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17709. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17710. do { \
  17711. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17712. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17713. } while (0)
  17714. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17715. do { \
  17716. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17717. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17718. } while (0)
  17719. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17720. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17721. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17722. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17723. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17724. do { \
  17725. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17726. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17727. } while (0)
  17728. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17729. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17730. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17731. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17732. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17733. do { \
  17734. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17735. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17736. } while (0)
  17737. /**
  17738. * @brief target -> RX PEER METADATA V1A format
  17739. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17740. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  17741. * and will confirm to the target which peer metadata version to use in the
  17742. * wmi_init message.
  17743. *
  17744. * The following diagram shows the format of the RX PEER METADATA V1A format.
  17745. *
  17746. * |31 29|28 26|25 22|21 14| 13 |12 0|
  17747. * |-------------------------------------------------------------------|
  17748. * |Rsvd2|CHIP ID|logical_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  17749. * |-------------------------------------------------------------------|
  17750. */
  17751. PREPACK struct htt_rx_peer_metadata_v1a {
  17752. A_UINT32
  17753. peer_id: 13,
  17754. ml_peer_valid: 1,
  17755. vdev_id: 8,
  17756. logical_link_id: 4,
  17757. chip_id: 3,
  17758. reserved2: 3;
  17759. } POSTPACK;
  17760. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_S 0
  17761. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_M 0x00001fff
  17762. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_GET(_var) \
  17763. (((_var) & HTT_RX_PEER_META_DATA_V1A_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)
  17764. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_SET(_var, _val) \
  17765. do { \
  17766. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_PEER_ID, _val); \
  17767. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)); \
  17768. } while (0)
  17769. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S 13
  17770. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M 0x00002000
  17771. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_GET(_var) \
  17772. (((_var) & HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)
  17773. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_SET(_var, _val) \
  17774. do { \
  17775. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID, _val); \
  17776. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)); \
  17777. } while (0)
  17778. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S 14
  17779. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M 0x003fc000
  17780. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_GET(_var) \
  17781. (((_var) & HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)
  17782. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_SET(_var, _val) \
  17783. do { \
  17784. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_VDEV_ID, _val); \
  17785. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)); \
  17786. } while (0)
  17787. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S 22
  17788. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M 0x03C00000
  17789. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_GET(_var) \
  17790. (((_var) & HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)
  17791. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_SET(_var, _val) \
  17792. do { \
  17793. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID, _val); \
  17794. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)); \
  17795. } while (0)
  17796. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S 26
  17797. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M 0x1c000000
  17798. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_GET(_var) \
  17799. (((_var) & HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)
  17800. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_SET(_var, _val) \
  17801. do { \
  17802. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_CHIP_ID, _val); \
  17803. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)); \
  17804. } while (0)
  17805. /**
  17806. * @brief target -> RX PEER METADATA V1B format
  17807. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17808. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  17809. * and will confirm to the target which peer metadata version to use in the
  17810. * wmi_init message.
  17811. *
  17812. * The following diagram shows the format of the RX PEER METADATA V1B format.
  17813. *
  17814. * |31 29|28 26|25 22|21 14| 13 |12 0|
  17815. * |--------------------------------------------------------------|
  17816. * |Rsvd2|CHIP ID|hw_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  17817. * |--------------------------------------------------------------|
  17818. */
  17819. PREPACK struct htt_rx_peer_metadata_v1b {
  17820. A_UINT32
  17821. peer_id: 13,
  17822. ml_peer_valid: 1,
  17823. vdev_id: 8,
  17824. hw_link_id: 4,
  17825. chip_id: 3,
  17826. reserved2: 3;
  17827. } POSTPACK;
  17828. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_S 0
  17829. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_M 0x00001fff
  17830. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_GET(_var) \
  17831. (((_var) & HTT_RX_PEER_META_DATA_V1B_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)
  17832. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_SET(_var, _val) \
  17833. do { \
  17834. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_PEER_ID, _val); \
  17835. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)); \
  17836. } while (0)
  17837. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S 13
  17838. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M 0x00002000
  17839. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_GET(_var) \
  17840. (((_var) & HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)
  17841. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_SET(_var, _val) \
  17842. do { \
  17843. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID, _val); \
  17844. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)); \
  17845. } while (0)
  17846. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S 14
  17847. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M 0x003fc000
  17848. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_GET(_var) \
  17849. (((_var) & HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)
  17850. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_SET(_var, _val) \
  17851. do { \
  17852. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_VDEV_ID, _val); \
  17853. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)); \
  17854. } while (0)
  17855. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S 22
  17856. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M 0x03C00000
  17857. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_GET(_var) \
  17858. (((_var) & HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)
  17859. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_SET(_var, _val) \
  17860. do { \
  17861. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID, _val); \
  17862. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)); \
  17863. } while (0)
  17864. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S 26
  17865. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M 0x1c000000
  17866. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_GET(_var) \
  17867. (((_var) & HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)
  17868. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_SET(_var, _val) \
  17869. do { \
  17870. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_CHIP_ID, _val); \
  17871. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)); \
  17872. } while (0)
  17873. /* generic variables for masks and shifts for various fields */
  17874. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_S;
  17875. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_M;
  17876. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_S;
  17877. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_M;
  17878. /* generic function pointers to get/set values from rx peer metadata v0/v1/v1a/v1b */
  17879. extern A_UINT32 (*HTT_RX_PEER_META_DATA_PEER_ID_GET) (A_UINT32 var);
  17880. extern void (*HTT_RX_PEER_META_DATA_PEER_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17881. extern A_UINT32 (*HTT_RX_PEER_META_DATA_VDEV_ID_GET) (A_UINT32 var);
  17882. extern void (*HTT_RX_PEER_META_DATA_VDEV_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17883. extern A_UINT32 (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_GET) (A_UINT32 var);
  17884. extern void (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_SET) (A_UINT32 *var, A_UINT32 val);
  17885. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_GET) (A_UINT32 var);
  17886. extern void (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17887. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LMAC_ID_GET) (A_UINT32 var);
  17888. extern void (*HTT_RX_PEER_META_DATA_LMAC_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17889. extern A_UINT32 (*HTT_RX_PEER_META_DATA_CHIP_ID_GET) (A_UINT32 var);
  17890. extern void (*HTT_RX_PEER_META_DATA_CHIP_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17891. extern A_UINT32 (*HTT_RX_PEER_META_DATA_HW_LINK_ID_GET) (A_UINT32 var);
  17892. extern void (*HTT_RX_PEER_META_DATA_HW_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  17893. /*
  17894. * In some systems, the host SW wants to specify priorities between
  17895. * different MSDU / flow queues within the same peer-TID.
  17896. * The below enums are used for the host to identify to the target
  17897. * which MSDU queue's priority it wants to adjust.
  17898. */
  17899. /*
  17900. * The MSDUQ index describe index of TCL HW, where each index is
  17901. * used for queuing particular types of MSDUs.
  17902. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17903. */
  17904. enum HTT_MSDUQ_INDEX {
  17905. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17906. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17907. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17908. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17909. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17910. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17911. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17912. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17913. HTT_MSDUQ_MAX_INDEX,
  17914. };
  17915. /* MSDU qtype definition */
  17916. enum HTT_MSDU_QTYPE {
  17917. /*
  17918. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17919. * relative priority. Instead, the relative priority of CRIT_0 versus
  17920. * CRIT_1 is controlled by the FW, through the configuration parameters
  17921. * it applies to the queues.
  17922. */
  17923. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17924. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17925. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17926. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17927. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17928. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17929. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17930. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17931. /* New MSDU_QTYPE should be added above this line */
  17932. /*
  17933. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17934. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17935. * any host/target message definitions. The QTYPE_MAX value can
  17936. * only be used internally within the host or within the target.
  17937. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17938. * it must regard the unexpected value as a default qtype value,
  17939. * or ignore it.
  17940. */
  17941. HTT_MSDU_QTYPE_MAX,
  17942. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17943. };
  17944. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17945. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17946. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17947. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17948. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17949. };
  17950. /**
  17951. * @brief target -> host mlo timestamp offset indication
  17952. *
  17953. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17954. *
  17955. * @details
  17956. * The following field definitions describe the format of the HTT target
  17957. * to host mlo timestamp offset indication message.
  17958. *
  17959. *
  17960. * |31 16|15 12|11 10|9 8|7 0 |
  17961. * |----------------------------------------------------------------------|
  17962. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17963. * |----------------------------------------------------------------------|
  17964. * | Sync time stamp lo in us |
  17965. * |----------------------------------------------------------------------|
  17966. * | Sync time stamp hi in us |
  17967. * |----------------------------------------------------------------------|
  17968. * | mlo time stamp offset lo in us |
  17969. * |----------------------------------------------------------------------|
  17970. * | mlo time stamp offset hi in us |
  17971. * |----------------------------------------------------------------------|
  17972. * | mlo time stamp offset clocks in clock ticks |
  17973. * |----------------------------------------------------------------------|
  17974. * |31 26|25 16|15 0 |
  17975. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17976. * | | compensation in clks | |
  17977. * |----------------------------------------------------------------------|
  17978. * |31 22|21 0 |
  17979. * | rsvd 3 | mlo time stamp comp timer period |
  17980. * |----------------------------------------------------------------------|
  17981. * The message is interpreted as follows:
  17982. *
  17983. * dword0 - b'0:7 - msg_type: This will be set to
  17984. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17985. * value: 0x28
  17986. *
  17987. * dword0 - b'9:8 - pdev_id
  17988. *
  17989. * dword0 - b'11:10 - chip_id
  17990. *
  17991. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17992. *
  17993. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17994. *
  17995. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17996. * which last sync interrupt was received
  17997. *
  17998. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17999. * which last sync interrupt was received
  18000. *
  18001. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  18002. *
  18003. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  18004. *
  18005. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  18006. *
  18007. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  18008. *
  18009. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  18010. * for sub us resolution
  18011. *
  18012. * dword6 - b'31:26 - rsvd2: Reserved for future use
  18013. *
  18014. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  18015. * is applied, in us
  18016. *
  18017. * dword7 - b'31:22 - rsvd3: Reserved for future use
  18018. */
  18019. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  18020. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  18021. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  18022. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  18023. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  18024. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  18025. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  18026. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  18027. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  18028. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  18029. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  18030. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  18031. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  18032. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  18033. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  18034. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  18035. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  18036. do { \
  18037. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  18038. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  18039. } while (0)
  18040. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  18041. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  18042. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  18043. do { \
  18044. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  18045. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  18046. } while (0)
  18047. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  18048. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  18049. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  18050. do { \
  18051. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  18052. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  18053. } while (0)
  18054. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  18055. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  18056. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  18057. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  18058. do { \
  18059. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  18060. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  18061. } while (0)
  18062. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  18063. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  18064. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  18065. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  18066. do { \
  18067. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  18068. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  18069. } while (0)
  18070. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  18071. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  18072. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  18073. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  18074. do { \
  18075. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  18076. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  18077. } while (0)
  18078. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  18079. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  18080. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  18081. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  18082. do { \
  18083. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  18084. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  18085. } while (0)
  18086. typedef struct {
  18087. A_UINT32 msg_type: 8, /* bits 7:0 */
  18088. pdev_id: 2, /* bits 9:8 */
  18089. chip_id: 2, /* bits 11:10 */
  18090. reserved1: 4, /* bits 15:12 */
  18091. mac_clk_freq_mhz: 16; /* bits 31:16 */
  18092. A_UINT32 sync_timestamp_lo_us;
  18093. A_UINT32 sync_timestamp_hi_us;
  18094. A_UINT32 mlo_timestamp_offset_lo_us;
  18095. A_UINT32 mlo_timestamp_offset_hi_us;
  18096. A_UINT32 mlo_timestamp_offset_clks;
  18097. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  18098. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  18099. reserved2: 6; /* bits 31:26 */
  18100. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  18101. reserved3: 10; /* bits 31:22 */
  18102. } htt_t2h_mlo_offset_ind_t;
  18103. /*
  18104. * @brief target -> host VDEV TX RX STATS
  18105. *
  18106. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  18107. *
  18108. * @details
  18109. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  18110. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  18111. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  18112. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  18113. * periodically by target even in the absence of any further HTT request
  18114. * messages from host.
  18115. *
  18116. * The message is formatted as follows:
  18117. *
  18118. * |31 16|15 8|7 0|
  18119. * |---------------------------------+----------------+----------------|
  18120. * | payload_size | pdev_id | msg_type |
  18121. * |---------------------------------+----------------+----------------|
  18122. * | reserved0 |
  18123. * |-------------------------------------------------------------------|
  18124. * | reserved1 |
  18125. * |-------------------------------------------------------------------|
  18126. * | reserved2 |
  18127. * |-------------------------------------------------------------------|
  18128. * | |
  18129. * | VDEV specific Tx Rx stats info |
  18130. * | |
  18131. * |-------------------------------------------------------------------|
  18132. *
  18133. * The message is interpreted as follows:
  18134. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  18135. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  18136. * b'8:15 - pdev_id
  18137. * b'16:31 - size in bytes of the payload that follows the 16-byte
  18138. * message header fields (msg_type through reserved2)
  18139. * dword1 - b'0:31 - reserved0.
  18140. * dword2 - b'0:31 - reserved1.
  18141. * dword3 - b'0:31 - reserved2.
  18142. */
  18143. typedef struct {
  18144. A_UINT32 msg_type: 8,
  18145. pdev_id: 8,
  18146. payload_size: 16;
  18147. A_UINT32 reserved0;
  18148. A_UINT32 reserved1;
  18149. A_UINT32 reserved2;
  18150. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  18151. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  18152. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  18153. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  18154. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  18155. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  18156. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  18157. do { \
  18158. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  18159. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  18160. } while (0)
  18161. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  18162. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  18163. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  18164. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  18165. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  18166. do { \
  18167. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  18168. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  18169. } while (0)
  18170. /* SOC related stats */
  18171. typedef struct {
  18172. htt_tlv_hdr_t tlv_hdr;
  18173. /* When TQM is not able to find the peers during Tx, then it drops the packets
  18174. * This can be due to either the peer is deleted or deletion is ongoing
  18175. * */
  18176. A_UINT32 inv_peers_msdu_drop_count_lo;
  18177. A_UINT32 inv_peers_msdu_drop_count_hi;
  18178. } htt_t2h_soc_txrx_stats_common_tlv;
  18179. /* VDEV HW Tx/Rx stats */
  18180. typedef struct {
  18181. htt_tlv_hdr_t tlv_hdr;
  18182. A_UINT32 vdev_id;
  18183. /* Rx msdu byte cnt */
  18184. A_UINT32 rx_msdu_byte_cnt_lo;
  18185. A_UINT32 rx_msdu_byte_cnt_hi;
  18186. /* Rx msdu cnt */
  18187. A_UINT32 rx_msdu_cnt_lo;
  18188. A_UINT32 rx_msdu_cnt_hi;
  18189. /* tx msdu byte cnt */
  18190. A_UINT32 tx_msdu_byte_cnt_lo;
  18191. A_UINT32 tx_msdu_byte_cnt_hi;
  18192. /* tx msdu cnt */
  18193. A_UINT32 tx_msdu_cnt_lo;
  18194. A_UINT32 tx_msdu_cnt_hi;
  18195. /* tx excessive retry discarded msdu cnt */
  18196. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  18197. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  18198. /* TX congestion ctrl msdu drop cnt */
  18199. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  18200. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  18201. /* discarded tx msdus cnt coz of time to live expiry */
  18202. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  18203. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  18204. /* tx excessive retry discarded msdu byte cnt */
  18205. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  18206. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  18207. /* TX congestion ctrl msdu drop byte cnt */
  18208. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  18209. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  18210. /* discarded tx msdus byte cnt coz of time to live expiry */
  18211. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  18212. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  18213. /* TQM bypass frame cnt */
  18214. A_UINT32 tqm_bypass_frame_cnt_lo;
  18215. A_UINT32 tqm_bypass_frame_cnt_hi;
  18216. /* TQM bypass byte cnt */
  18217. A_UINT32 tqm_bypass_byte_cnt_lo;
  18218. A_UINT32 tqm_bypass_byte_cnt_hi;
  18219. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  18220. /*
  18221. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  18222. *
  18223. * @details
  18224. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  18225. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  18226. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  18227. * the default MSDU queues of each of the specified TIDs for the peer
  18228. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  18229. * If the default MSDU queues of a given TID within the peer are not linked
  18230. * to a service class, the svc_class_id field for that TID will have a
  18231. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  18232. * queues for that TID are not mapped to any service class.
  18233. *
  18234. * |31 16|15 8|7 0|
  18235. * |------------------------------+--------------+--------------|
  18236. * | peer ID | reserved | msg type |
  18237. * |------------------------------+--------------+------+-------|
  18238. * | reserved | svc class ID | TID |
  18239. * |------------------------------------------------------------|
  18240. * ...
  18241. * |------------------------------------------------------------|
  18242. * | reserved | svc class ID | TID |
  18243. * |------------------------------------------------------------|
  18244. * Header fields:
  18245. * dword0 - b'7:0 - msg_type: This will be set to
  18246. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  18247. * b'31:16 - peer ID
  18248. * dword1 - b'7:0 - TID
  18249. * b'15:8 - svc class ID
  18250. * (dword2, etc. same format as dword1)
  18251. */
  18252. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  18253. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  18254. A_UINT32 msg_type :8,
  18255. reserved0 :8,
  18256. peer_id :16;
  18257. struct {
  18258. A_UINT32 tid :8,
  18259. svc_class_id :8,
  18260. reserved1 :16;
  18261. } tid_reports[1/*or more*/];
  18262. } POSTPACK;
  18263. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  18264. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  18265. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  18266. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  18267. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  18268. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  18269. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  18270. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  18271. do { \
  18272. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  18273. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  18274. } while (0)
  18275. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  18276. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  18277. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  18278. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  18279. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  18280. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  18281. do { \
  18282. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  18283. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  18284. } while (0)
  18285. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  18286. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  18287. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  18288. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  18289. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  18290. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  18291. do { \
  18292. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  18293. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  18294. } while (0)
  18295. /*
  18296. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  18297. *
  18298. * @details
  18299. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  18300. * flow if the flow is seen the associated service class is conveyed to the
  18301. * target via TCL Data Command. Target on the other hand internally creates the
  18302. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  18303. * of the newly created MSDUQ and some other identifiers to uniquely identity
  18304. * the newly created MSDUQ
  18305. *
  18306. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  18307. * |------------------------------+------------------------+--------------|
  18308. * | peer ID | HTT qtype | msg type |
  18309. * |---------------------------------+--------------+--+---+-------+------|
  18310. * | reserved |AST list index|FO|WC | HLOS | remap|
  18311. * | | | | | TID | TID |
  18312. * |---------------------+------------------------------------------------|
  18313. * | reserved1 | tgt_opaque_id |
  18314. * |---------------------+------------------------------------------------|
  18315. *
  18316. * Header fields:
  18317. *
  18318. * dword0 - b'7:0 - msg_type: This will be set to
  18319. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  18320. * b'15:8 - HTT qtype
  18321. * b'31:16 - peer ID
  18322. *
  18323. * dword1 - b'3:0 - remap TID, as assigned in firmware
  18324. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  18325. * hlos_tid : Common to Lithium and Beryllium
  18326. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  18327. * TCL Data Command : Beryllium
  18328. * b10 - flow_override (FO), as sent by host in
  18329. * TCL Data Command: Beryllium
  18330. * b11:14 - ast_list_idx
  18331. * Array index into the list of extension AST entries
  18332. * (not the actual AST 16-bit index).
  18333. * The ast_list_idx is one-based, with the following
  18334. * range of values:
  18335. * - legacy targets supporting 16 user-defined
  18336. * MSDU queues: 1-2
  18337. * - legacy targets supporting 48 user-defined
  18338. * MSDU queues: 1-6
  18339. * - new targets: 0 (peer_id is used instead)
  18340. * Note that since ast_list_idx is one-based,
  18341. * the host will need to subtract 1 to use it as an
  18342. * index into a list of extension AST entries.
  18343. * b15:31 - reserved
  18344. *
  18345. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  18346. * unique MSDUQ id in firmware
  18347. * b'24:31 - reserved1
  18348. */
  18349. PREPACK struct htt_t2h_sawf_msduq_event {
  18350. A_UINT32 msg_type : 8,
  18351. htt_qtype : 8,
  18352. peer_id :16;
  18353. A_UINT32 remap_tid : 4,
  18354. hlos_tid : 4,
  18355. who_classify_info_sel : 2,
  18356. flow_override : 1,
  18357. ast_list_idx : 4,
  18358. reserved :17;
  18359. A_UINT32 tgt_opaque_id :24,
  18360. reserved1 : 8;
  18361. } POSTPACK;
  18362. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  18363. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  18364. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  18365. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  18366. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  18367. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  18368. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  18369. do { \
  18370. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  18371. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  18372. } while (0)
  18373. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  18374. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  18375. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  18376. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  18377. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  18378. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  18379. do { \
  18380. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  18381. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  18382. } while (0)
  18383. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  18384. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  18385. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  18386. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  18387. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  18388. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  18389. do { \
  18390. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  18391. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  18392. } while (0)
  18393. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  18394. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  18395. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  18396. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  18397. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  18398. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  18399. do { \
  18400. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  18401. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  18402. } while (0)
  18403. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  18404. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  18405. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  18406. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  18407. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  18408. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  18409. do { \
  18410. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  18411. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  18412. } while (0)
  18413. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  18414. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  18415. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  18416. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  18417. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  18418. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  18419. do { \
  18420. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  18421. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  18422. } while (0)
  18423. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  18424. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  18425. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  18426. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  18427. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  18428. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  18429. do { \
  18430. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  18431. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  18432. } while (0)
  18433. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  18434. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  18435. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  18436. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  18437. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  18438. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  18439. do { \
  18440. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  18441. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  18442. } while (0)
  18443. /**
  18444. * @brief target -> PPDU id format indication
  18445. *
  18446. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  18447. *
  18448. * @details
  18449. * The following field definitions describe the format of the HTT target
  18450. * to host PPDU ID format indication message.
  18451. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  18452. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  18453. * seq_idx :- Sequence control index of this PPDU.
  18454. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  18455. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  18456. * tqm_cmd:-
  18457. *
  18458. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  18459. * |--------------------------------------------------+------------------------|
  18460. * | rsvd0 | msg type |
  18461. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18462. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  18463. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18464. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  18465. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18466. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  18467. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18468. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  18469. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18470. * Where: OF = bit offset, NB = number of bits, V = valid
  18471. * The message is interpreted as follows:
  18472. *
  18473. * dword0 - b'7:0 - msg_type: This will be set to
  18474. * HTT_T2H_PPDU_ID_FMT_IND
  18475. * value: 0x30
  18476. *
  18477. * dword0 - b'31:8 - reserved
  18478. *
  18479. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  18480. *
  18481. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  18482. *
  18483. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  18484. *
  18485. * dword1 - b'15:11 - reserved for future use
  18486. *
  18487. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  18488. *
  18489. * dword1 - b'21:17 - number of bits in ring_id
  18490. *
  18491. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  18492. *
  18493. * dword1 - b'31:27 - reserved for future use
  18494. *
  18495. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  18496. *
  18497. * dword2 - b'5:1 - number of bits in sequence index
  18498. *
  18499. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  18500. *
  18501. * dword2 - b'15:11 - reserved for future use
  18502. *
  18503. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  18504. *
  18505. * dword2 - b'21:17 - number of bits in link_id
  18506. *
  18507. * dword2 - b'26:22 - offset of link_id (in number of bits)
  18508. *
  18509. * dword2 - b'31:27 - reserved for future use
  18510. *
  18511. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  18512. *
  18513. * dword3 - b'5:1 - number of bits in seq_cmd_type
  18514. *
  18515. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  18516. *
  18517. * dword3 - b'15:11 - reserved for future use
  18518. *
  18519. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  18520. *
  18521. * dword3 - b'21:17 - number of bits in tqm_cmd
  18522. *
  18523. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  18524. *
  18525. * dword3 - b'31:27 - reserved for future use
  18526. *
  18527. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  18528. *
  18529. * dword4 - b'5:1 - number of bits in mac_id
  18530. *
  18531. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  18532. *
  18533. * dword4 - b'15:11 - reserved for future use
  18534. *
  18535. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  18536. *
  18537. * dword4 - b'21:17 - number of bits in crc
  18538. *
  18539. * dword4 - b'26:22 - offset of crc (in number of bits)
  18540. *
  18541. * dword4 - b'31:27 - reserved for future use
  18542. *
  18543. */
  18544. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  18545. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  18546. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  18547. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  18548. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  18549. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  18550. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  18551. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  18552. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  18553. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  18554. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  18555. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  18556. /* macros for accessing lower 16 bits in dword */
  18557. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  18558. do { \
  18559. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  18560. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  18561. } while (0)
  18562. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  18563. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  18564. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  18565. do { \
  18566. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  18567. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  18568. } while (0)
  18569. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  18570. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  18571. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  18572. do { \
  18573. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  18574. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  18575. } while (0)
  18576. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  18577. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  18578. /* macros for accessing upper 16 bits in dword */
  18579. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  18580. do { \
  18581. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  18582. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  18583. } while (0)
  18584. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  18585. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  18586. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  18587. do { \
  18588. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  18589. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  18590. } while (0)
  18591. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  18592. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  18593. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  18594. do { \
  18595. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  18596. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  18597. } while (0)
  18598. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  18599. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  18600. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  18601. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18602. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  18603. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18604. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  18605. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18606. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  18607. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18608. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  18609. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18610. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  18611. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18612. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  18613. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18614. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  18615. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18616. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  18617. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18618. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  18619. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18620. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  18621. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18622. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  18623. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18624. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  18625. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18626. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  18627. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18628. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  18629. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18630. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  18631. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18632. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  18633. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18634. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  18635. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18636. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  18637. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18638. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  18639. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18640. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  18641. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18642. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  18643. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18644. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  18645. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18646. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  18647. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18648. /* offsets in number dwords */
  18649. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  18650. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  18651. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  18652. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  18653. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  18654. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  18655. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  18656. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  18657. typedef struct {
  18658. A_UINT32 msg_type: 8, /* bits 7:0 */
  18659. rsvd0: 24;/* bits 31:8 */
  18660. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  18661. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  18662. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  18663. rsvd1: 5, /* bits 15:11 */
  18664. ring_id_valid: 1, /* bits 16:16 */
  18665. ring_id_bits: 5, /* bits 21:17 */
  18666. ring_id_offset: 5, /* bits 26:22 */
  18667. rsvd2: 5; /* bits 31:27 */
  18668. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  18669. seq_idx_bits: 5, /* bits 5:1 */
  18670. seq_idx_offset: 5, /* bits 10:6 */
  18671. rsvd3: 5, /* bits 15:11 */
  18672. link_id_valid: 1, /* bits 16:16 */
  18673. link_id_bits: 5, /* bits 21:17 */
  18674. link_id_offset: 5, /* bits 26:22 */
  18675. rsvd4: 5; /* bits 31:27 */
  18676. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  18677. seq_cmd_type_bits: 5, /* bits 5:1 */
  18678. seq_cmd_type_offset: 5, /* bits 10:6 */
  18679. rsvd5: 5, /* bits 15:11 */
  18680. tqm_cmd_valid: 1, /* bits 16:16 */
  18681. tqm_cmd_bits: 5, /* bits 21:17 */
  18682. tqm_cmd_offset: 5, /* bits 26:12 */
  18683. rsvd6: 5; /* bits 31:27 */
  18684. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  18685. mac_id_bits: 5, /* bits 5:1 */
  18686. mac_id_offset: 5, /* bits 10:6 */
  18687. rsvd8: 5, /* bits 15:11 */
  18688. crc_valid: 1, /* bits 16:16 */
  18689. crc_bits: 5, /* bits 21:17 */
  18690. crc_offset: 5, /* bits 26:12 */
  18691. rsvd9: 5; /* bits 31:27 */
  18692. } htt_t2h_ppdu_id_fmt_ind_t;
  18693. /**
  18694. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  18695. *
  18696. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  18697. *
  18698. * @details
  18699. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  18700. * when RX_CCE_SUPER_RULE setup is done
  18701. *
  18702. * This message shows the configuration results after the setup operation.
  18703. * It will always be sent to host.
  18704. * The message would appear as follows:
  18705. *
  18706. * |31 24|23 16|15 8|7 0|
  18707. * |-----------------+-----------------+----------------+----------------|
  18708. * | result | response_type | vdev_id | msg_type |
  18709. * |---------------------------------------------------------------------|
  18710. *
  18711. * The message is interpreted as follows:
  18712. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  18713. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  18714. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  18715. * b'16:23 - response_type: Indicate the response type of this setup
  18716. * done msg
  18717. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  18718. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  18719. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18720. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  18721. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18722. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  18723. * b'24:31 - result: Indicate result of setup operation
  18724. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  18725. * b'24 - is_rule_enough: indicate if there are
  18726. * enough free cce rule slots
  18727. * 0: not enough
  18728. * 1: enough
  18729. * b'25:31 - avail_rule_num: indicate the number of
  18730. * remaining free cce rule slots, only makes sense
  18731. * when is_rule_enough = 0
  18732. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  18733. * b'24 - cfg_result_0: indicate the config result
  18734. * of RX_CCE_SUPER_RULE_0
  18735. * 0: Install/Uninstall fails
  18736. * 1: Install/Uninstall succeeds
  18737. * b'25 - cfg_result_1: indicate the config result
  18738. * of RX_CCE_SUPER_RULE_1
  18739. * 0: Install/Uninstall fails
  18740. * 1: Install/Uninstall succeeds
  18741. * b'26:31 - reserved
  18742. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  18743. * b'24 - cfg_result_0: indicate the config result
  18744. * of RX_CCE_SUPER_RULE_0
  18745. * 0: Release fails
  18746. * 1: Release succeeds
  18747. * b'25 - cfg_result_1: indicate the config result
  18748. * of RX_CCE_SUPER_RULE_1
  18749. * 0: Release fails
  18750. * 1: Release succeeds
  18751. * b'26:31 - reserved
  18752. */
  18753. enum htt_rx_cce_super_rule_setup_done_response_type {
  18754. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  18755. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18756. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18757. /*All reply type should be before this*/
  18758. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  18759. };
  18760. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  18761. A_UINT8 msg_type;
  18762. A_UINT8 vdev_id;
  18763. A_UINT8 response_type;
  18764. union {
  18765. struct {
  18766. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  18767. A_UINT8 is_rule_enough: 1,
  18768. avail_rule_num: 7;
  18769. };
  18770. struct {
  18771. /*
  18772. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  18773. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  18774. */
  18775. A_UINT8 cfg_result_0: 1,
  18776. cfg_result_1: 1,
  18777. rsvd: 6;
  18778. };
  18779. } result;
  18780. } POSTPACK;
  18781. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  18782. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  18783. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  18784. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  18785. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  18786. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  18787. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  18788. do { \
  18789. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  18790. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  18791. } while (0)
  18792. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  18793. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  18794. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  18795. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  18796. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  18797. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  18798. do { \
  18799. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  18800. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  18801. } while (0)
  18802. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  18803. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  18804. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  18805. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  18806. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  18807. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  18808. do { \
  18809. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  18810. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  18811. } while (0)
  18812. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  18813. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  18814. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  18815. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  18816. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  18817. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  18818. do { \
  18819. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  18820. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  18821. } while (0)
  18822. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  18823. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18824. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18825. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18826. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18827. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18828. do { \
  18829. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18830. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18831. } while (0)
  18832. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18833. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18834. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18835. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18836. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18837. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18838. do { \
  18839. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18840. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18841. } while (0)
  18842. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18843. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18844. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18845. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18846. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18847. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18848. do { \
  18849. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18850. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18851. } while (0)
  18852. /**
  18853. * @brief target -> host CoDel MSDU queue latencies array configuration
  18854. *
  18855. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  18856. *
  18857. * @details
  18858. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  18859. * by the target to inform the host of the location and size of the DDR array of
  18860. * per MSDU queue latency metrics. This array is updated by the host and
  18861. * read by the target. The target uses these metric values to determine
  18862. * which MSDU queues have latencies exceeding their CoDel latency target.
  18863. *
  18864. * |31 16|15 8|7 0|
  18865. * |-------------------------------------------+----------|
  18866. * | number of array elements | reserved | MSG_TYPE |
  18867. * |-------------------------------------------+----------|
  18868. * | array physical address, low bits |
  18869. * |------------------------------------------------------|
  18870. * | array physical address, high bits |
  18871. * |------------------------------------------------------|
  18872. * Header fields:
  18873. * - MSG_TYPE
  18874. * Bits 7:0
  18875. * Purpose: Identifies this as a CoDel MSDU queue latencies
  18876. * array configuration message.
  18877. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  18878. * - NUM_ELEM
  18879. * Bits 31:16
  18880. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  18881. * Value: Specifies the number of elements in the MSDU queue latency
  18882. * metrics array. This value is the same as the maximum number of
  18883. * MSDU queues supported by the target.
  18884. * Since each array element is 16 bits, the size in bytes of the
  18885. * MSDU queue latency metrics array is twice the number of elements.
  18886. * - PADDR_LOW
  18887. * Bits 31:0
  18888. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18889. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  18890. * metrics array.
  18891. * - PADDR_HIGH
  18892. * Bits 31:0
  18893. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18894. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  18895. * metrics array.
  18896. */
  18897. typedef struct {
  18898. A_UINT32 msg_type: 8, /* bits 7:0 */
  18899. reserved: 8, /* bits 15:8 */
  18900. num_elem: 16; /* bits 31:16 */
  18901. A_UINT32 paddr_low;
  18902. A_UINT32 paddr_high;
  18903. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  18904. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  18905. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  18906. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  18907. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  18908. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  18909. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  18910. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  18911. do { \
  18912. HTT_CHECK_SET_VAL( \
  18913. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  18914. ((_var) |= ((_val) << \
  18915. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  18916. } while (0)
  18917. /*
  18918. * This CoDel MSDU queue latencies array whose location and number of
  18919. * elements are specified by this HTT_T2H message consists of 16-bit elements
  18920. * that each specify a statistical summary (min) of a MSDU queue's latency,
  18921. * using microseconds units.
  18922. */
  18923. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  18924. /**
  18925. * @brief target -> host rx completion indication message definition
  18926. *
  18927. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DATA_IND
  18928. *
  18929. * @details
  18930. * The following diagram shows the format of the Rx completion indication sent
  18931. * from the target to the host
  18932. *
  18933. * |31|29|28 24|23 12|11 9|8| 7|6|5|4|3|2|1|0|
  18934. * |---------------+----------------------------+----------------|
  18935. * | vdev_id | peer_id | msg_type |
  18936. * hdr: |---------------+--------------------------+-+----------------|
  18937. * | rsvd0 |F| msdu_cnt |
  18938. * pyld: |==========================================+=+================|
  18939. * MSDU 0 | buf addr lo (bits 31:0) |
  18940. * |-----+--------------------------------------+----------------|
  18941. * |rsvd1| SW buffer cookie | buf addr hi |
  18942. * |--+--+-----------------------------+--------+--+-+-+-+-+-+-+-|
  18943. * |R2| W| MSDU length | TID |MC|D|S|C|L|F|R|M|
  18944. * |-------------------------------------------------+---------+-|
  18945. * | rsvd3 | err info|E|
  18946. * |=================================================+=========+=|
  18947. * MSDU 1 | buf addr lo (bits 31:0) |
  18948. * : ... :
  18949. * | rsvd3 | err info|E|
  18950. * |-------------------------------------------------------------|
  18951. * Where:
  18952. * F = fragment
  18953. * M = MPDU retry bit
  18954. * R = raw MPDU frame
  18955. * F = first MSDU in MPDU
  18956. * L = last MSDU in MPDU
  18957. * C = MSDU continuation
  18958. * S = Souce Addr is valid
  18959. * D = Dest Addr is valid
  18960. * MC = Dest Addr is multicast / broadcast
  18961. * W = is first MSDU after WoW wakeup
  18962. * R2 = rsvd2
  18963. * E = error valid
  18964. */
  18965. /* htt_t2h_rx_data_msdu_err:
  18966. * To be filled in "htt_t2h_rx_data_msdu_info.error_info" field
  18967. * when FW forwards MSDU to host.
  18968. */
  18969. typedef enum htt_t2h_rx_data_msdu_err {
  18970. /* ERR_DECRYPT:
  18971. * FW sets this when rxdma_error_code = <enum 3 rxdma_decrypt_err>.
  18972. * host maintains error stats, recycles buffer.
  18973. */
  18974. HTT_RXDATA_ERR_DECRYPT = 0,
  18975. /* ERR_TKIP_MIC:
  18976. * FW sets this when rxdma_error_code = <enum 4 rxdma_tkip_mic_err>.
  18977. * Host maintains error stats, recycles buffer, sends notification to
  18978. * middleware.
  18979. */
  18980. HTT_RXDATA_ERR_TKIP_MIC = 1,
  18981. /* ERR_UNENCRYPTED:
  18982. * FW sets this when rxdma_error_code = <enum 5 rxdma_unecrypted_err>.
  18983. * Host maintains error stats, recycles buffer.
  18984. */
  18985. HTT_RXDATA_ERR_UNENCRYPTED = 2,
  18986. /* ERR_MSDU_LIMIT:
  18987. * FW sets this when rxdma_error_code = <enum 7 rxdma_msdu_limit_err>.
  18988. * Host maintains error stats, recycles buffer.
  18989. */
  18990. HTT_RXDATA_ERR_MSDU_LIMIT = 3,
  18991. /* ERR_FLUSH_REQUEST:
  18992. * FW sets this when rxdma_error_code = <enum 13 rxdma_flush_request>.
  18993. * Host maintains error stats, recycles buffer.
  18994. */
  18995. HTT_RXDATA_ERR_FLUSH_REQUEST = 4,
  18996. /* ERR_OOR:
  18997. * FW full reorder layer maps this error to <enum 7 regular_frame_OOR>.
  18998. * Host maintains error stats, recycles buffer mainly for low
  18999. * TCP KPI debugging.
  19000. */
  19001. HTT_RXDATA_ERR_OOR = 5,
  19002. /* ERR_2K_JUMP:
  19003. * FW full reorder layer maps this error to <enum 5 regular_frame_2k_jump>.
  19004. * Host maintains error stats, recycles buffer mainly for low
  19005. * TCP KPI debugging.
  19006. */
  19007. HTT_RXDATA_ERR_2K_JUMP = 6,
  19008. /* ERR_ZERO_LEN_MSDU:
  19009. * FW sets this error flag for a 0 length MSDU.
  19010. * Host maintains error stats, recycles buffer.
  19011. */
  19012. HTT_RXDATA_ERR_ZERO_LEN_MSDU = 7,
  19013. /* add new error codes here */
  19014. HTT_RXDATA_ERR_MAX = 32
  19015. } htt_t2h_rx_data_msdu_err_e;
  19016. struct htt_t2h_rx_data_ind_t
  19017. {
  19018. A_UINT32 /* word 0 */
  19019. /* msg_type:
  19020. * Set to Rx data indication i.e. HTT_T2H_MSG_TYPE_RX_DATA_IND.
  19021. */
  19022. msg_type: 8,
  19023. peer_id: 16, /* This will provide peer data */
  19024. vdev_id: 8; /* This will provide vdev id info */
  19025. A_UINT32 /* word 1 */
  19026. /* msdu_cnt:
  19027. * Total number of MSDUs (htt_t2h_rx_data_msdu_info items) in message.
  19028. */
  19029. msdu_cnt: 8,
  19030. frag: 1, /* this bit will be set for 802.11 frag MPDU */
  19031. rsvd0: 23;
  19032. /* NOTE:
  19033. * To preserve backwards compatibility,
  19034. * no new fields can be added in this struct.
  19035. */
  19036. };
  19037. struct htt_t2h_rx_data_msdu_info
  19038. {
  19039. A_UINT32 /* word 0 */
  19040. buffer_addr_low : 32;
  19041. A_UINT32 /* word 1 */
  19042. buffer_addr_high : 8,
  19043. sw_buffer_cookie : 21,
  19044. rsvd1 : 3;
  19045. A_UINT32 /* word 2 */
  19046. mpdu_retry_bit : 1, /* used for stats maintenance */
  19047. raw_mpdu_frame : 1, /* used for pkt drop and processing */
  19048. first_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19049. last_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19050. msdu_continuation : 1, /* used for MSDU scatter/gather support */
  19051. sa_is_valid : 1, /* used for HW issue check in
  19052. * is_sa_da_idx_valid() */
  19053. da_is_valid : 1, /* used for HW issue check and
  19054. * intra-BSS forwarding */
  19055. da_is_mcbc : 1,
  19056. tid_info : 8, /* used for stats maintenance */
  19057. msdu_length : 14,
  19058. is_first_pkt_after_wkp : 1, /* indicates this is the first rx MSDU
  19059. * provided by fw after WoW exit */
  19060. rsvd2 : 1;
  19061. A_UINT32 /* word 3 */
  19062. error_valid : 1, /* Set if the MSDU has any error */
  19063. error_info : 5, /* If error_valid is TRUE, then refer to
  19064. * "htt_t2h_rx_data_msdu_err_e" for
  19065. * checking error reason. */
  19066. rsvd3 : 26;
  19067. /* NOTE:
  19068. * To preserve backwards compatibility,
  19069. * no new fields can be added in this struct.
  19070. */
  19071. };
  19072. /* HTT_RX_DATA_IND_HDR_SIZE: 2 4-byte words
  19073. * This is the size of htt_t2h_rx_data_ind_t alone which is fixed overhead
  19074. * for every Rx DATA IND sent by FW to host.
  19075. */
  19076. #define HTT_RX_DATA_IND_HDR_SIZE (2*4)
  19077. /* HTT_RX_DATA_MSDU_INFO_SIZE: 4 4-bytes words
  19078. * This is the size of each MSDU detail that will be piggybacked with the
  19079. * RX IND header.
  19080. */
  19081. #define HTT_RX_DATA_MSDU_INFO_SIZE (4*4)
  19082. /* member definitions of htt_t2h_rx_data_ind_t */
  19083. #define HTT_RX_DATA_IND_PEER_ID_M 0x00ffff00
  19084. #define HTT_RX_DATA_IND_PEER_ID_S 8
  19085. #define HTT_RX_DATA_IND_PEER_ID_SET(word, value) \
  19086. do { \
  19087. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_PEER_ID, value); \
  19088. (word) |= (value) << HTT_RX_DATA_IND_PEER_ID_S; \
  19089. } while (0)
  19090. #define HTT_RX_DATA_IND_PEER_ID_GET(word) \
  19091. (((word) & HTT_RX_DATA_IND_PEER_ID_M) >> HTT_RX_DATA_IND_PEER_ID_S)
  19092. #define HTT_RX_DATA_IND_VDEV_ID_M 0xff000000
  19093. #define HTT_RX_DATA_IND_VDEV_ID_S 24
  19094. #define HTT_RX_DATA_IND_VDEV_ID_SET(word, value) \
  19095. do { \
  19096. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_VDEV_ID, value); \
  19097. (word) |= (value) << HTT_RX_DATA_IND_VDEV_ID_S; \
  19098. } while (0)
  19099. #define HTT_RX_DATA_IND_VDEV_ID_GET(word) \
  19100. (((word) & HTT_RX_DATA_IND_VDEV_ID_M) >> HTT_RX_DATA_IND_VDEV_ID_S)
  19101. #define HTT_RX_DATA_IND_MSDU_CNT_M 0x000000ff
  19102. #define HTT_RX_DATA_IND_MSDU_CNT_S 0
  19103. #define HTT_RX_DATA_IND_MSDU_CNT_SET(word, value) \
  19104. do { \
  19105. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_MSDU_CNT, value); \
  19106. (word) |= (value) << HTT_RX_DATA_IND_MSDU_CNT_S; \
  19107. } while (0)
  19108. #define HTT_RX_DATA_IND_MSDU_CNT_GET(word) \
  19109. (((word) & HTT_RX_DATA_IND_MSDU_CNT_M) >> HTT_RX_DATA_IND_MSDU_CNT_S)
  19110. #define HTT_RX_DATA_IND_FRAG_M 0x00000100
  19111. #define HTT_RX_DATA_IND_FRAG_S 8
  19112. #define HTT_RX_DATA_IND_FRAG_SET(word, value) \
  19113. do { \
  19114. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_FRAG, value); \
  19115. (word) |= (value) << HTT_RX_DATA_IND_FRAG_S; \
  19116. } while (0)
  19117. #define HTT_RX_DATA_IND_FRAG_GET(word) \
  19118. (((word) & HTT_RX_DATA_IND_FRAG_M) >> HTT_RX_DATA_IND_FRAG_S)
  19119. /* member definitions of htt_t2h_rx_data_msdu_info */
  19120. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M 0xFFFFFFFF
  19121. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S 0
  19122. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M 0x000000FF
  19123. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S 0
  19124. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_SET(word, value) \
  19125. do { \
  19126. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW, value); \
  19127. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S; \
  19128. } while (0)
  19129. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_GET(word) \
  19130. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S)
  19131. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_SET(word, value) \
  19132. do { \
  19133. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH, value); \
  19134. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S; \
  19135. } while (0)
  19136. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_GET(word) \
  19137. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S)
  19138. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M 0x1FFFFF00
  19139. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S 8
  19140. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  19141. do { \
  19142. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE, value); \
  19143. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S; \
  19144. } while (0)
  19145. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_GET(word) \
  19146. (((word) & HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M) >> HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S)
  19147. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M 0x00000001
  19148. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S 0
  19149. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_SET(word, value) \
  19150. do { \
  19151. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT, value); \
  19152. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S; \
  19153. } while (0)
  19154. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_GET(word) \
  19155. (((word) & HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M) >> HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S)
  19156. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M 0x00000002
  19157. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S 1
  19158. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_SET(word, value) \
  19159. do { \
  19160. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME, value); \
  19161. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S; \
  19162. } while (0)
  19163. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_GET(word) \
  19164. (((word) & HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M) >> HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S)
  19165. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M 0x00000004
  19166. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S 2
  19167. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_SET(word, value) \
  19168. do { \
  19169. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU, value); \
  19170. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S; \
  19171. } while (0)
  19172. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_GET(word) \
  19173. (((word) & HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S)
  19174. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M 0x00000008
  19175. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S 3
  19176. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_SET(word, value) \
  19177. do { \
  19178. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU, value); \
  19179. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S; \
  19180. } while (0)
  19181. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_GET(word) \
  19182. (((word) & HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S)
  19183. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M 0x00000010
  19184. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S 4
  19185. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_SET(word, value) \
  19186. do { \
  19187. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION, value); \
  19188. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S; \
  19189. } while (0)
  19190. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_GET(word) \
  19191. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S)
  19192. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M 0x00000020
  19193. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S 5
  19194. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_SET(word, value) \
  19195. do { \
  19196. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SA_IS_VALID, value); \
  19197. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S; \
  19198. } while (0)
  19199. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_GET(word) \
  19200. (((word) & HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S)
  19201. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M 0x00000040
  19202. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S 6
  19203. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_SET(word, value) \
  19204. do { \
  19205. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_VALID, value); \
  19206. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S; \
  19207. } while (0)
  19208. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_GET(word) \
  19209. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S)
  19210. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M 0x00000080
  19211. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S 7
  19212. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_SET(word, value) \
  19213. do { \
  19214. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC, value); \
  19215. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S; \
  19216. } while (0)
  19217. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_GET(word) \
  19218. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S)
  19219. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_M 0x0000FF00
  19220. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_S 8
  19221. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_SET(word, value) \
  19222. do { \
  19223. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_TID_INFO, value); \
  19224. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_TID_INFO_S; \
  19225. } while (0)
  19226. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_GET(word) \
  19227. (((word) & HTT_RX_DATA_MSDU_INFO_TID_INFO_M) >> HTT_RX_DATA_MSDU_INFO_TID_INFO_S)
  19228. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M 0x3FFF0000
  19229. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S 16
  19230. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_SET(word, value) \
  19231. do { \
  19232. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH, value); \
  19233. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S; \
  19234. } while (0)
  19235. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_GET(word) \
  19236. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S)
  19237. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M 0x40000000
  19238. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S 30
  19239. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_SET(word, value) \
  19240. do { \
  19241. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP, value); \
  19242. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S; \
  19243. } while (0)
  19244. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_GET(word) \
  19245. (((word) & HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M) >> HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S)
  19246. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M 0x00000001
  19247. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S 0
  19248. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_SET(word, value) \
  19249. do { \
  19250. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_VALID, value); \
  19251. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S; \
  19252. } while (0)
  19253. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_GET(word) \
  19254. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S)
  19255. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M 0x0000001E
  19256. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S 1
  19257. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_SET(word, value) \
  19258. do { \
  19259. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_INFO, value); \
  19260. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S; \
  19261. } while (0)
  19262. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_GET(word) \
  19263. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S)
  19264. #endif