htt.h 1.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290
  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. * 3.120 Add HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND, _RESP defs.
  242. * 3.121 Add HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND def.
  243. * 3.122 Add is_umac_hang flag in H2T UMAC_HANG_RECOVERY_SOC_START_PRE_RESET msg
  244. * 3.123 Add HTT_OPTION_TLV_TCL_METADATA_V21 def.
  245. * 3.124 Add HTT_T2H_MSG_TYPE_PEER_EXTENDED_EVENT def.
  246. * 3.125 Expand fisa_aggr_limit bits in fisa_control_bits_v2.
  247. * 3.126 Add HTT_RXDATA_ERR_INVALID_PEER def.
  248. * 3.127 Add transmit_count fields in htt_tx_wbm_completion_vX structs.
  249. * 3.128 Add H2T TX_LATENCY_STATS_CFG + T2H TX_LATENCY_STATS_PERIODIC_IND
  250. * msg defs
  251. * 3.129 Add HTT_TX_FW2WBM_REINJECT_REASON_SAWF_SVC_CLASS_ID_ABSENT def.
  252. */
  253. #define HTT_CURRENT_VERSION_MAJOR 3
  254. #define HTT_CURRENT_VERSION_MINOR 129
  255. #define HTT_NUM_TX_FRAG_DESC 1024
  256. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  257. #define HTT_CHECK_SET_VAL(field, val) \
  258. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  259. /* macros to assist in sign-extending fields from HTT messages */
  260. #define HTT_SIGN_BIT_MASK(field) \
  261. ((field ## _M + (1 << field ## _S)) >> 1)
  262. #define HTT_SIGN_BIT(_val, field) \
  263. (_val & HTT_SIGN_BIT_MASK(field))
  264. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  265. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  266. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  267. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  268. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  269. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  270. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  271. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  272. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  273. /*
  274. * TEMPORARY:
  275. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  276. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  277. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  278. * updated.
  279. */
  280. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  281. /*
  282. * TEMPORARY:
  283. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  284. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  285. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  286. * updated.
  287. */
  288. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  289. /**
  290. * htt_dbg_stats_type -
  291. * bit positions for each stats type within a stats type bitmask
  292. * The bitmask contains 24 bits.
  293. */
  294. enum htt_dbg_stats_type {
  295. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  296. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  297. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  298. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  299. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  300. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  301. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  302. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  303. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  304. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  305. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  306. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  307. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  308. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  309. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  310. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  311. /* bits 16-23 currently reserved */
  312. /* keep this last */
  313. HTT_DBG_NUM_STATS
  314. };
  315. /*=== HTT option selection TLVs ===
  316. * Certain HTT messages have alternatives or options.
  317. * For such cases, the host and target need to agree on which option to use.
  318. * Option specification TLVs can be appended to the VERSION_REQ and
  319. * VERSION_CONF messages to select options other than the default.
  320. * These TLVs are entirely optional - if they are not provided, there is a
  321. * well-defined default for each option. If they are provided, they can be
  322. * provided in any order. Each TLV can be present or absent independent of
  323. * the presence / absence of other TLVs.
  324. *
  325. * The HTT option selection TLVs use the following format:
  326. * |31 16|15 8|7 0|
  327. * |---------------------------------+----------------+----------------|
  328. * | value (payload) | length | tag |
  329. * |-------------------------------------------------------------------|
  330. * The value portion need not be only 2 bytes; it can be extended by any
  331. * integer number of 4-byte units. The total length of the TLV, including
  332. * the tag and length fields, must be a multiple of 4 bytes. The length
  333. * field specifies the total TLV size in 4-byte units. Thus, the typical
  334. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  335. * field, would store 0x1 in its length field, to show that the TLV occupies
  336. * a single 4-byte unit.
  337. */
  338. /*--- TLV header format - applies to all HTT option TLVs ---*/
  339. enum HTT_OPTION_TLV_TAGS {
  340. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  341. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  342. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  343. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  344. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  345. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  346. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  347. };
  348. #define HTT_TCL_METADATA_VER_SZ 4
  349. PREPACK struct htt_option_tlv_header_t {
  350. A_UINT8 tag;
  351. A_UINT8 length;
  352. } POSTPACK;
  353. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  354. #define HTT_OPTION_TLV_TAG_S 0
  355. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  356. #define HTT_OPTION_TLV_LENGTH_S 8
  357. /*
  358. * value0 - 16 bit value field stored in word0
  359. * The TLV's value field may be longer than 2 bytes, in which case
  360. * the remainder of the value is stored in word1, word2, etc.
  361. */
  362. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  363. #define HTT_OPTION_TLV_VALUE0_S 16
  364. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  365. do { \
  366. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  367. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  368. } while (0)
  369. #define HTT_OPTION_TLV_TAG_GET(word) \
  370. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  371. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  372. do { \
  373. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  374. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  375. } while (0)
  376. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  377. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  378. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  379. do { \
  380. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  381. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  382. } while (0)
  383. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  384. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  385. /*--- format of specific HTT option TLVs ---*/
  386. /*
  387. * HTT option TLV for specifying LL bus address size
  388. * Some chips require bus addresses used by the target to access buffers
  389. * within the host's memory to be 32 bits; others require bus addresses
  390. * used by the target to access buffers within the host's memory to be
  391. * 64 bits.
  392. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  393. * a suffix to the VERSION_CONF message to specify which bus address format
  394. * the target requires.
  395. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  396. * default to providing bus addresses to the target in 32-bit format.
  397. */
  398. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  399. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  400. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  401. };
  402. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  403. struct htt_option_tlv_header_t hdr;
  404. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  405. } POSTPACK;
  406. /*
  407. * HTT option TLV for specifying whether HL systems should indicate
  408. * over-the-air tx completion for individual frames, or should instead
  409. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  410. * requests an OTA tx completion for a particular tx frame.
  411. * This option does not apply to LL systems, where the TX_COMPL_IND
  412. * is mandatory.
  413. * This option is primarily intended for HL systems in which the tx frame
  414. * downloads over the host --> target bus are as slow as or slower than
  415. * the transmissions over the WLAN PHY. For cases where the bus is faster
  416. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  417. * and consequently will send one TX_COMPL_IND message that covers several
  418. * tx frames. For cases where the WLAN PHY is faster than the bus,
  419. * the target will end up transmitting very short A-MPDUs, and consequently
  420. * sending many TX_COMPL_IND messages, which each cover a very small number
  421. * of tx frames.
  422. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  423. * a suffix to the VERSION_REQ message to request whether the host desires to
  424. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  425. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  426. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  427. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  428. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  429. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  430. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  431. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  432. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  433. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  434. * TLV.
  435. */
  436. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  437. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  438. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  439. };
  440. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying how many tx queue groups the target
  446. * may establish.
  447. * This TLV specifies the maximum value the target may send in the
  448. * txq_group_id field of any TXQ_GROUP information elements sent by
  449. * the target to the host. This allows the host to pre-allocate an
  450. * appropriate number of tx queue group structs.
  451. *
  452. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  453. * a suffix to the VERSION_REQ message to specify whether the host supports
  454. * tx queue groups at all, and if so if there is any limit on the number of
  455. * tx queue groups that the host supports.
  456. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  457. * a suffix to the VERSION_CONF message. If the host has specified in the
  458. * VER_REQ message a limit on the number of tx queue groups the host can
  459. * support, the target shall limit its specification of the maximum tx groups
  460. * to be no larger than this host-specified limit.
  461. *
  462. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  463. * shall preallocate 4 tx queue group structs, and the target shall not
  464. * specify a txq_group_id larger than 3.
  465. */
  466. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  467. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  468. /*
  469. * values 1 through N specify the max number of tx queue groups
  470. * the sender supports
  471. */
  472. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  473. };
  474. /* TEMPORARY backwards-compatibility alias for a typo fix -
  475. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  476. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  477. * to support the old name (with the typo) until all references to the
  478. * old name are replaced with the new name.
  479. */
  480. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  481. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  482. struct htt_option_tlv_header_t hdr;
  483. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  484. } POSTPACK;
  485. /*
  486. * HTT option TLV for specifying whether the target supports an extended
  487. * version of the HTT tx descriptor. If the target provides this TLV
  488. * and specifies in the TLV that the target supports an extended version
  489. * of the HTT tx descriptor, the target must check the "extension" bit in
  490. * the HTT tx descriptor, and if the extension bit is set, to expect a
  491. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  492. * descriptor. Furthermore, the target must provide room for the HTT
  493. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  494. * This option is intended for systems where the host needs to explicitly
  495. * control the transmission parameters such as tx power for individual
  496. * tx frames.
  497. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  498. * as a suffix to the VERSION_CONF message to explicitly specify whether
  499. * the target supports the HTT tx MSDU extension descriptor.
  500. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  501. * by the host as lack of target support for the HTT tx MSDU extension
  502. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  503. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  504. * the HTT tx MSDU extension descriptor.
  505. * The host is not required to provide the HTT tx MSDU extension descriptor
  506. * just because the target supports it; the target must check the
  507. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  508. * extension descriptor is present.
  509. */
  510. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  511. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  512. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  513. };
  514. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  515. struct htt_option_tlv_header_t hdr;
  516. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  517. } POSTPACK;
  518. /*
  519. * For the tcl data command V2 and higher support added a new
  520. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  521. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  522. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  523. * HTT option TLV for specifying which version of the TCL metadata struct
  524. * should be used:
  525. * V1 -> use htt_tx_tcl_metadata struct
  526. * V2 -> use htt_tx_tcl_metadata_v2 struct
  527. * Old FW will only support V1.
  528. * New FW will support V2. New FW will still support V1, at least during
  529. * a transition period.
  530. * Similarly, old host will only support V1, and new host will support V1 + V2.
  531. *
  532. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  533. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  534. * of TCL metadata the host supports. If the host doesn't provide a
  535. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  536. * is implicitly understood that the host only supports V1.
  537. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  538. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  539. * the host shall use. The target shall only select one of the versions
  540. * supported by the host. If the target doesn't provide a
  541. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  542. * is implicitly understood that the V1 TCL metadata shall be used.
  543. *
  544. * Feb 2023: Added version HTT_OPTION_TLV_TCL_METADATA_V21 = 21
  545. * read as version 2.1. We added support for Dynamic AST Index Allocation
  546. * for Alder+Pine in version 2.1. For HTT_OPTION_TLV_TCL_METADATA_V2 = 2
  547. * we will retain older behavior of making sure the AST Index for SAWF
  548. * in Pine is allocated using wifitool ath2 setUnitTestCmd 0x48 2 536 1
  549. * and the FW will crash in wal_tx_de_fast.c. For version 2.1 and
  550. * above we will use htt_tx_tcl_svc_class_id_metadata.ast_index
  551. * in TCLV2 command and do the dynamic AST allocations.
  552. */
  553. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  554. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  555. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  556. /* values 3-20 reserved */
  557. HTT_OPTION_TLV_TCL_METADATA_V21 = 21,
  558. };
  559. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  560. struct htt_option_tlv_header_t hdr;
  561. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  562. } POSTPACK;
  563. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  564. HTT_OPTION_TLV_VALUE0_SET(word, value)
  565. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  566. HTT_OPTION_TLV_VALUE0_GET(word)
  567. typedef struct {
  568. union {
  569. /* BIT [11 : 0] :- tag
  570. * BIT [23 : 12] :- length
  571. * BIT [31 : 24] :- reserved
  572. */
  573. A_UINT32 tag__length;
  574. /*
  575. * The following struct is not endian-portable.
  576. * It is suitable for use within the target, which is known to be
  577. * little-endian.
  578. * The host should use the above endian-portable macros to access
  579. * the tag and length bitfields in an endian-neutral manner.
  580. */
  581. struct {
  582. A_UINT32 tag : 12, /* BIT [11 : 0] */
  583. length : 12, /* BIT [23 : 12] */
  584. reserved : 8; /* BIT [31 : 24] */
  585. };
  586. };
  587. } htt_tlv_hdr_t;
  588. /** HTT stats TLV tag values */
  589. typedef enum {
  590. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  591. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  592. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  593. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  594. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  595. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv, PUBLISH_FUNC=get_sring_name_data */
  596. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv, PUBLISH_CODE=#inbound_req->tx_hwq_id_mac_id_word = ((htt_tx_hwq_stats_cmn_tlv *)tag_buf)->mac_id__hwq_id__word;#, PUBLISH_FUNC=create_json_response_for_htt_stats_tx_hwq */
  597. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  598. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_tx_hwq */
  599. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_tx_hwq */
  600. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_tx_hwq */
  601. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  602. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  603. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  604. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  605. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  606. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  607. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  608. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  609. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  610. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  611. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  612. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  613. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  614. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  615. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  616. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  617. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv, PUBLISH_FUNC=create_json_response_for_sring_stats */
  618. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  619. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  620. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  621. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  622. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  623. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  624. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  625. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  626. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv, PUBLISH_CODE=#inbound_req->tx_sched_txq_id_mac_id_word = ((htt_tx_pdev_stats_sched_per_txq_tlv *)tag_buf)->mac_id__txq_id__word;#, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  627. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv, PUBLISH_SKIP */
  628. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  629. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  630. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  631. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v, PUBLISH_FUNC=create_json_response_for_sfm_client */
  632. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv, PUBLISH_FUNC=create_json_response_for_sfm_client */
  633. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  634. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  635. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  636. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  637. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  638. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  639. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  640. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  641. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  642. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  643. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  644. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv, PUBLISH_FUNC=create_json_response_for_hwstats_intr_misc */
  645. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  646. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  647. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  648. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  649. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  650. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  651. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  652. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  653. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv, TOPIC=advanced */
  654. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  655. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  656. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  657. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  658. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  659. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  660. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats), PUBLISH_FUNC=update_htt_pdev_cca_stat_context */
  661. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats), PUBLISH_FUNC=update_htt_pdev_cca_stat_context */
  662. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv, PUBLISH_FUNC=update_htt_pdev_cca_stat_context */
  663. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv, PUBLISH_FUNC=create_json_response_for_htt_pdev_cca_stat */
  664. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv, PUBLISH_FUNC=create_json_response_for_htt_tx_pdev_mpdu_stat */
  665. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  666. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  667. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  668. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  669. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  670. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  671. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  672. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  673. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  674. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  675. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  676. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  677. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  678. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  679. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  680. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv, PUBLISH_FUNC=create_json_response_for_ring_bkp_pressure_stats */
  681. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv, PUBLISH_FUNC=create_json_response_for_latency_prof_stats */
  682. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  683. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  684. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  685. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv, PUBLISH_FUNC=create_json_response_for_htt_rx_pdev_ul_ofdma_user_stat */
  686. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  687. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  688. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  689. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv, TOPIC=peer */
  690. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v, PUBLISH_FUNC=create_json_response_for_htt_stats_sched_txq */
  691. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  692. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  693. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv, PUBLISH_FUNC=create_json_response_for_rx_pdev_rate_ext */
  694. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  695. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  696. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  697. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  698. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  699. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  700. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  701. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  702. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  703. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  704. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  705. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  706. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  707. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  708. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  709. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  710. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  711. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  712. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  713. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  714. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  715. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  716. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  717. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  718. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv, PUBLISH_FUNC=create_json_response_for_htt_tx_rate_stats_per */
  719. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv, PUBLISH_FUNC=create_json_response_for_htt_stats_mu_ppdu */
  720. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  721. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv, TOPIC=advanced */
  722. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  723. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv, TOPIC=advanced */
  724. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv, TOPIC=advanced */
  725. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  726. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv, TOPIC=advanced */
  727. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv, TOPIC=advanced */
  728. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv, TOPIC=advanced */
  729. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv, TOPIC=advanced */
  730. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  731. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  732. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  733. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv, TOPIC=advanced */
  734. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv, TOPIC=advanced */
  735. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  736. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  737. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  738. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  739. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  740. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  741. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  742. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  743. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  744. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv, PUBLISH_FUNC_FILE=create_json_response_for_txbf_ofdma_wrapper */
  745. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  746. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv, TOPIC=advanced */
  747. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  748. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  749. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  750. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  751. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  752. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv, TOPIC=advanced */
  753. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv, TOPIC=advanced */
  754. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  755. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv, PUBLISH_FUNC=create_json_response_for_htt_pdev_sched_algo_ofdma_stats */
  756. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  757. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  758. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv - DEPRECATED */
  759. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  760. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  761. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v, TOPIC=advanced */
  762. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv, TOPIC=advanced */
  763. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv, TOPIC=advanced */
  764. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  765. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v, TOPIC=advanced */
  766. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  767. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  768. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  769. HTT_STATS_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  770. HTT_STATS_PEER_BE_OFDMA_STATS_TAG = 180, /* htt_peer_be_ofdma_stats_tlv */
  771. HTT_STATS_MLO_UMAC_SSR_TRIGGER_TAG = 181, /* htt_mlo_umac_ssr_trigger_stats_tlv */
  772. HTT_STATS_MLO_UMAC_SSR_CMN_TAG = 182, /* htt_mlo_umac_ssr_common_stats_tlv */
  773. HTT_STATS_MLO_UMAC_SSR_KPI_TSTMP_TAG = 183, /* htt_mlo_umac_ssr_kpi_tstamp_stats_tlv */
  774. HTT_STATS_MLO_UMAC_SSR_DBG_TAG = 184, /* htt_mlo_umac_ssr_dbg_tlv */
  775. HTT_STATS_MLO_UMAC_SSR_HANDSHAKE_TAG = 185, /* htt_mlo_umac_htt_handshake_stats_tlv */
  776. HTT_STATS_MLO_UMAC_SSR_MLO_TAG = 186, /* htt_mlo_umac_ssr_mlo_stats_tlv */
  777. HTT_STATS_PDEV_TDMA_TAG = 187, /* htt_pdev_tdma_stats_tlv */
  778. HTT_STATS_CODEL_SVC_CLASS_TAG = 188, /* htt_codel_svc_class_stats_tlv */
  779. HTT_STATS_CODEL_MSDUQ_TAG = 189, /* htt_codel_msduq_stats_tlv */
  780. HTT_STATS_MLO_SCHED_STATS_TAG = 190, /* htt_mlo_sched_stats_tlv */
  781. HTT_STATS_PDEV_MLO_IPC_STATS_TAG = 191, /* htt_pdev_mlo_ipc_stats_tlv */
  782. HTT_STATS_WHAL_WSI_TAG = 192, /* htt_stats_whal_wsi_tlv */
  783. HTT_STATS_LATENCY_PROF_CAL_DATA_TAG = 193, /* htt_stats_latency_prof_cal_data_tlv */
  784. HTT_STATS_PDEV_RTT_RESP_STATS_TAG = 194, /* htt_stats_pdev_rtt_resp_stats_tlv */
  785. HTT_STATS_PDEV_RTT_INIT_STATS_TAG = 195, /* htt_stats_pdev_rtt_init_stats_tlv */
  786. HTT_STATS_PDEV_RTT_HW_STATS_TAG = 196, /* htt_stats_pdev_rtt_hw_stats_tlv */
  787. HTT_STATS_PDEV_RTT_TBR_SELFGEN_QUEUED_STATS_TAG = 197, /* htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv */
  788. HTT_STATS_PDEV_RTT_TBR_CMD_RESULT_STATS_TAG = 198, /* htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv */
  789. HTT_STATS_MAX_TAG,
  790. } htt_stats_tlv_tag_t;
  791. /* retain deprecated enum name as an alias for the current enum name */
  792. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  793. #define HTT_STATS_TLV_TAG_M 0x00000fff
  794. #define HTT_STATS_TLV_TAG_S 0
  795. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  796. #define HTT_STATS_TLV_LENGTH_S 12
  797. #define HTT_STATS_TLV_TAG_GET(_var) \
  798. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  799. HTT_STATS_TLV_TAG_S)
  800. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  801. do { \
  802. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  803. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  804. } while (0)
  805. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  806. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  807. HTT_STATS_TLV_LENGTH_S)
  808. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  809. do { \
  810. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  811. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  812. } while (0)
  813. /*=== host -> target messages ===============================================*/
  814. enum htt_h2t_msg_type {
  815. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  816. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  817. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  818. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  819. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  820. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  821. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  822. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  823. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  824. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  825. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  826. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  827. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  828. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  829. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  830. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  831. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  832. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  833. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  834. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  835. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  836. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  837. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  838. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  839. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  840. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  841. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  842. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  843. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  844. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  845. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  846. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  847. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  848. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  849. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  850. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  851. HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP = 0x24,
  852. HTT_H2T_MSG_TYPE_TX_LATENCY_STATS_CFG = 0x25,
  853. /* keep this last */
  854. HTT_H2T_NUM_MSGS
  855. };
  856. /*
  857. * HTT host to target message type -
  858. * stored in bits 7:0 of the first word of the message
  859. */
  860. #define HTT_H2T_MSG_TYPE_M 0xff
  861. #define HTT_H2T_MSG_TYPE_S 0
  862. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  863. do { \
  864. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  865. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  866. } while (0)
  867. #define HTT_H2T_MSG_TYPE_GET(word) \
  868. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  869. /**
  870. * @brief host -> target version number request message definition
  871. *
  872. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  873. *
  874. *
  875. * |31 24|23 16|15 8|7 0|
  876. * |----------------+----------------+----------------+----------------|
  877. * | reserved | msg type |
  878. * |-------------------------------------------------------------------|
  879. * : option request TLV (optional) |
  880. * :...................................................................:
  881. *
  882. * The VER_REQ message may consist of a single 4-byte word, or may be
  883. * extended with TLVs that specify which HTT options the host is requesting
  884. * from the target.
  885. * The following option TLVs may be appended to the VER_REQ message:
  886. * - HL_SUPPRESS_TX_COMPL_IND
  887. * - HL_MAX_TX_QUEUE_GROUPS
  888. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  889. * may be appended to the VER_REQ message (but only one TLV of each type).
  890. *
  891. * Header fields:
  892. * - MSG_TYPE
  893. * Bits 7:0
  894. * Purpose: identifies this as a version number request message
  895. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  896. */
  897. #define HTT_VER_REQ_BYTES 4
  898. /* TBDXXX: figure out a reasonable number */
  899. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  900. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  901. /**
  902. * @brief HTT tx MSDU descriptor
  903. *
  904. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  905. *
  906. * @details
  907. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  908. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  909. * the target firmware needs for the FW's tx processing, particularly
  910. * for creating the HW msdu descriptor.
  911. * The same HTT tx descriptor is used for HL and LL systems, though
  912. * a few fields within the tx descriptor are used only by LL or
  913. * only by HL.
  914. * The HTT tx descriptor is defined in two manners: by a struct with
  915. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  916. * definitions.
  917. * The target should use the struct def, for simplicitly and clarity,
  918. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  919. * neutral. Specifically, the host shall use the get/set macros built
  920. * around the mask + shift defs.
  921. */
  922. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  923. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  924. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  925. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  926. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  927. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  928. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  929. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  930. #define HTT_TX_VDEV_ID_WORD 0
  931. #define HTT_TX_VDEV_ID_MASK 0x3f
  932. #define HTT_TX_VDEV_ID_SHIFT 16
  933. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  934. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  935. #define HTT_TX_MSDU_LEN_DWORD 1
  936. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  937. /*
  938. * HTT_VAR_PADDR macros
  939. * Allow physical / bus addresses to be either a single 32-bit value,
  940. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  941. */
  942. #define HTT_VAR_PADDR32(var_name) \
  943. A_UINT32 var_name
  944. #define HTT_VAR_PADDR64_LE(var_name) \
  945. struct { \
  946. /* little-endian: lo precedes hi */ \
  947. A_UINT32 lo; \
  948. A_UINT32 hi; \
  949. } var_name
  950. /*
  951. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  952. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  953. * addresses are stored in a XXX-bit field.
  954. * This macro is used to define both htt_tx_msdu_desc32_t and
  955. * htt_tx_msdu_desc64_t structs.
  956. */
  957. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  958. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  959. { \
  960. /* DWORD 0: flags and meta-data */ \
  961. A_UINT32 \
  962. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  963. \
  964. /* pkt_subtype - \
  965. * Detailed specification of the tx frame contents, extending the \
  966. * general specification provided by pkt_type. \
  967. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  968. * pkt_type | pkt_subtype \
  969. * ============================================================== \
  970. * 802.3 | bit 0:3 - Reserved \
  971. * | bit 4: 0x0 - Copy-Engine Classification Results \
  972. * | not appended to the HTT message \
  973. * | 0x1 - Copy-Engine Classification Results \
  974. * | appended to the HTT message in the \
  975. * | format: \
  976. * | [HTT tx desc, frame header, \
  977. * | CE classification results] \
  978. * | The CE classification results begin \
  979. * | at the next 4-byte boundary after \
  980. * | the frame header. \
  981. * ------------+------------------------------------------------- \
  982. * Eth2 | bit 0:3 - Reserved \
  983. * | bit 4: 0x0 - Copy-Engine Classification Results \
  984. * | not appended to the HTT message \
  985. * | 0x1 - Copy-Engine Classification Results \
  986. * | appended to the HTT message. \
  987. * | See the above specification of the \
  988. * | CE classification results location. \
  989. * ------------+------------------------------------------------- \
  990. * native WiFi | bit 0:3 - Reserved \
  991. * | bit 4: 0x0 - Copy-Engine Classification Results \
  992. * | not appended to the HTT message \
  993. * | 0x1 - Copy-Engine Classification Results \
  994. * | appended to the HTT message. \
  995. * | See the above specification of the \
  996. * | CE classification results location. \
  997. * ------------+------------------------------------------------- \
  998. * mgmt | 0x0 - 802.11 MAC header absent \
  999. * | 0x1 - 802.11 MAC header present \
  1000. * ------------+------------------------------------------------- \
  1001. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  1002. * | 0x1 - 802.11 MAC header present \
  1003. * | bit 1: 0x0 - allow aggregation \
  1004. * | 0x1 - don't allow aggregation \
  1005. * | bit 2: 0x0 - perform encryption \
  1006. * | 0x1 - don't perform encryption \
  1007. * | bit 3: 0x0 - perform tx classification / queuing \
  1008. * | 0x1 - don't perform tx classification; \
  1009. * | insert the frame into the "misc" \
  1010. * | tx queue \
  1011. * | bit 4: 0x0 - Copy-Engine Classification Results \
  1012. * | not appended to the HTT message \
  1013. * | 0x1 - Copy-Engine Classification Results \
  1014. * | appended to the HTT message. \
  1015. * | See the above specification of the \
  1016. * | CE classification results location. \
  1017. */ \
  1018. pkt_subtype: 5, \
  1019. \
  1020. /* pkt_type - \
  1021. * General specification of the tx frame contents. \
  1022. * The htt_pkt_type enum should be used to specify and check the \
  1023. * value of this field. \
  1024. */ \
  1025. pkt_type: 3, \
  1026. \
  1027. /* vdev_id - \
  1028. * ID for the vdev that is sending this tx frame. \
  1029. * For certain non-standard packet types, e.g. pkt_type == raw \
  1030. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  1031. * This field is used primarily for determining where to queue \
  1032. * broadcast and multicast frames. \
  1033. */ \
  1034. vdev_id: 6, \
  1035. /* ext_tid - \
  1036. * The extended traffic ID. \
  1037. * If the TID is unknown, the extended TID is set to \
  1038. * HTT_TX_EXT_TID_INVALID. \
  1039. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  1040. * value of the QoS TID. \
  1041. * If the tx frame is non-QoS data, then the extended TID is set to \
  1042. * HTT_TX_EXT_TID_NON_QOS. \
  1043. * If the tx frame is multicast or broadcast, then the extended TID \
  1044. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1045. */ \
  1046. ext_tid: 5, \
  1047. \
  1048. /* postponed - \
  1049. * This flag indicates whether the tx frame has been downloaded to \
  1050. * the target before but discarded by the target, and now is being \
  1051. * downloaded again; or if this is a new frame that is being \
  1052. * downloaded for the first time. \
  1053. * This flag allows the target to determine the correct order for \
  1054. * transmitting new vs. old frames. \
  1055. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1056. * This flag only applies to HL systems, since in LL systems, \
  1057. * the tx flow control is handled entirely within the target. \
  1058. */ \
  1059. postponed: 1, \
  1060. \
  1061. /* extension - \
  1062. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1063. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1064. * \
  1065. * 0x0 - no extension MSDU descriptor is present \
  1066. * 0x1 - an extension MSDU descriptor immediately follows the \
  1067. * regular MSDU descriptor \
  1068. */ \
  1069. extension: 1, \
  1070. \
  1071. /* cksum_offload - \
  1072. * This flag indicates whether checksum offload is enabled or not \
  1073. * for this frame. Target FW use this flag to turn on HW checksumming \
  1074. * 0x0 - No checksum offload \
  1075. * 0x1 - L3 header checksum only \
  1076. * 0x2 - L4 checksum only \
  1077. * 0x3 - L3 header checksum + L4 checksum \
  1078. */ \
  1079. cksum_offload: 2, \
  1080. \
  1081. /* tx_comp_req - \
  1082. * This flag indicates whether Tx Completion \
  1083. * from fw is required or not. \
  1084. * This flag is only relevant if tx completion is not \
  1085. * universally enabled. \
  1086. * For all LL systems, tx completion is mandatory, \
  1087. * so this flag will be irrelevant. \
  1088. * For HL systems tx completion is optional, but HL systems in which \
  1089. * the bus throughput exceeds the WLAN throughput will \
  1090. * probably want to always use tx completion, and thus \
  1091. * would not check this flag. \
  1092. * This flag is required when tx completions are not used universally, \
  1093. * but are still required for certain tx frames for which \
  1094. * an OTA delivery acknowledgment is needed by the host. \
  1095. * In practice, this would be for HL systems in which the \
  1096. * bus throughput is less than the WLAN throughput. \
  1097. * \
  1098. * 0x0 - Tx Completion Indication from Fw not required \
  1099. * 0x1 - Tx Completion Indication from Fw is required \
  1100. */ \
  1101. tx_compl_req: 1; \
  1102. \
  1103. \
  1104. /* DWORD 1: MSDU length and ID */ \
  1105. A_UINT32 \
  1106. len: 16, /* MSDU length, in bytes */ \
  1107. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1108. * and this id is used to calculate fragmentation \
  1109. * descriptor pointer inside the target based on \
  1110. * the base address, configured inside the target. \
  1111. */ \
  1112. \
  1113. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1114. /* frags_desc_ptr - \
  1115. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1116. * where the tx frame's fragments reside in memory. \
  1117. * This field only applies to LL systems, since in HL systems the \
  1118. * (degenerate single-fragment) fragmentation descriptor is created \
  1119. * within the target. \
  1120. */ \
  1121. _paddr__frags_desc_ptr_; \
  1122. \
  1123. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1124. /* \
  1125. * Peer ID : Target can use this value to know which peer-id packet \
  1126. * destined to. \
  1127. * It's intended to be specified by host in case of NAWDS. \
  1128. */ \
  1129. A_UINT16 peerid; \
  1130. \
  1131. /* \
  1132. * Channel frequency: This identifies the desired channel \
  1133. * frequency (in mhz) for tx frames. This is used by FW to help \
  1134. * determine when it is safe to transmit or drop frames for \
  1135. * off-channel operation. \
  1136. * The default value of zero indicates to FW that the corresponding \
  1137. * VDEV's home channel (if there is one) is the desired channel \
  1138. * frequency. \
  1139. */ \
  1140. A_UINT16 chanfreq; \
  1141. \
  1142. /* Reason reserved is commented is increasing the htt structure size \
  1143. * leads to some weird issues. \
  1144. * A_UINT32 reserved_dword3_bits0_31; \
  1145. */ \
  1146. } POSTPACK
  1147. /* define a htt_tx_msdu_desc32_t type */
  1148. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1149. /* define a htt_tx_msdu_desc64_t type */
  1150. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1151. /*
  1152. * Make htt_tx_msdu_desc_t be an alias for either
  1153. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1154. */
  1155. #if HTT_PADDR64
  1156. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1157. #else
  1158. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1159. #endif
  1160. /* decriptor information for Management frame*/
  1161. /*
  1162. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1163. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1164. */
  1165. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1166. extern A_UINT32 mgmt_hdr_len;
  1167. PREPACK struct htt_mgmt_tx_desc_t {
  1168. A_UINT32 msg_type;
  1169. #if HTT_PADDR64
  1170. A_UINT64 frag_paddr; /* DMAble address of the data */
  1171. #else
  1172. A_UINT32 frag_paddr; /* DMAble address of the data */
  1173. #endif
  1174. A_UINT32 desc_id; /* returned to host during completion
  1175. * to free the meory*/
  1176. A_UINT32 len; /* Fragment length */
  1177. A_UINT32 vdev_id; /* virtual device ID*/
  1178. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1179. } POSTPACK;
  1180. PREPACK struct htt_mgmt_tx_compl_ind {
  1181. A_UINT32 desc_id;
  1182. A_UINT32 status;
  1183. } POSTPACK;
  1184. /*
  1185. * This SDU header size comes from the summation of the following:
  1186. * 1. Max of:
  1187. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1188. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1189. * b. 802.11 header, for raw frames: 36 bytes
  1190. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1191. * QoS header, HT header)
  1192. * c. 802.3 header, for ethernet frames: 14 bytes
  1193. * (destination address, source address, ethertype / length)
  1194. * 2. Max of:
  1195. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1196. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1197. * 3. 802.1Q VLAN header: 4 bytes
  1198. * 4. LLC/SNAP header: 8 bytes
  1199. */
  1200. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1201. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1202. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1203. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1204. A_COMPILE_TIME_ASSERT(
  1205. htt_encap_hdr_size_max_check_nwifi,
  1206. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1207. A_COMPILE_TIME_ASSERT(
  1208. htt_encap_hdr_size_max_check_enet,
  1209. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1210. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1211. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1212. #define HTT_TX_HDR_SIZE_802_1Q 4
  1213. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1214. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1215. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1216. HTT_TX_HDR_SIZE_802_1Q + \
  1217. HTT_TX_HDR_SIZE_LLC_SNAP)
  1218. #define HTT_HL_TX_FRM_HDR_LEN \
  1219. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1220. #define HTT_LL_TX_FRM_HDR_LEN \
  1221. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1222. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1223. /* dword 0 */
  1224. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1225. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1226. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1227. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1228. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1229. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1230. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1231. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1232. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1233. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1234. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1235. #define HTT_TX_DESC_PKT_TYPE_S 13
  1236. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1237. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1238. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1239. #define HTT_TX_DESC_VDEV_ID_S 16
  1240. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1241. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1242. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1243. #define HTT_TX_DESC_EXT_TID_S 22
  1244. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1245. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1246. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1247. #define HTT_TX_DESC_POSTPONED_S 27
  1248. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1249. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1250. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1251. #define HTT_TX_DESC_EXTENSION_S 28
  1252. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1253. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1254. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1255. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1256. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1257. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1258. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1259. #define HTT_TX_DESC_TX_COMP_S 31
  1260. /* dword 1 */
  1261. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1262. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1263. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1264. #define HTT_TX_DESC_FRM_LEN_S 0
  1265. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1266. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1267. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1268. #define HTT_TX_DESC_FRM_ID_S 16
  1269. /* dword 2 */
  1270. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1271. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1272. /* for systems using 64-bit format for bus addresses */
  1273. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1274. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1275. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1276. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1277. /* for systems using 32-bit format for bus addresses */
  1278. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1279. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1280. /* dword 3 */
  1281. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1282. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1283. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1284. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1285. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1286. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1287. #if HTT_PADDR64
  1288. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1289. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1290. #else
  1291. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1292. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1293. #endif
  1294. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1295. #define HTT_TX_DESC_PEER_ID_S 0
  1296. /*
  1297. * TEMPORARY:
  1298. * The original definitions for the PEER_ID fields contained typos
  1299. * (with _DESC_PADDR appended to this PEER_ID field name).
  1300. * Retain deprecated original names for PEER_ID fields until all code that
  1301. * refers to them has been updated.
  1302. */
  1303. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1304. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1305. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1306. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1307. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1308. HTT_TX_DESC_PEER_ID_M
  1309. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1310. HTT_TX_DESC_PEER_ID_S
  1311. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1312. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1313. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1314. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1315. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1316. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1317. #if HTT_PADDR64
  1318. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1319. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1320. #else
  1321. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1322. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1323. #endif
  1324. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1325. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1326. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1327. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1328. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1332. } while (0)
  1333. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1334. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1335. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1339. } while (0)
  1340. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1341. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1342. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1346. } while (0)
  1347. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1348. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1349. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1350. do { \
  1351. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1352. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1353. } while (0)
  1354. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1355. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1356. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1360. } while (0)
  1361. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1362. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1363. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1364. do { \
  1365. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1366. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1367. } while (0)
  1368. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1369. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1370. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1374. } while (0)
  1375. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1376. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1377. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1378. do { \
  1379. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1380. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1381. } while (0)
  1382. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1383. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1384. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1388. } while (0)
  1389. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1390. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1391. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1394. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1395. } while (0)
  1396. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1397. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1398. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1399. do { \
  1400. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1401. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1402. } while (0)
  1403. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1404. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1405. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1406. do { \
  1407. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1408. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1409. } while (0)
  1410. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1411. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1412. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1413. do { \
  1414. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1415. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1416. } while (0)
  1417. /* enums used in the HTT tx MSDU extension descriptor */
  1418. enum {
  1419. htt_tx_guard_interval_regular = 0,
  1420. htt_tx_guard_interval_short = 1,
  1421. };
  1422. enum {
  1423. htt_tx_preamble_type_ofdm = 0,
  1424. htt_tx_preamble_type_cck = 1,
  1425. htt_tx_preamble_type_ht = 2,
  1426. htt_tx_preamble_type_vht = 3,
  1427. };
  1428. enum {
  1429. htt_tx_bandwidth_5MHz = 0,
  1430. htt_tx_bandwidth_10MHz = 1,
  1431. htt_tx_bandwidth_20MHz = 2,
  1432. htt_tx_bandwidth_40MHz = 3,
  1433. htt_tx_bandwidth_80MHz = 4,
  1434. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1435. };
  1436. /**
  1437. * @brief HTT tx MSDU extension descriptor
  1438. * @details
  1439. * If the target supports HTT tx MSDU extension descriptors, the host has
  1440. * the option of appending the following struct following the regular
  1441. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1442. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1443. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1444. * tx specs for each frame.
  1445. */
  1446. PREPACK struct htt_tx_msdu_desc_ext_t {
  1447. /* DWORD 0: flags */
  1448. A_UINT32
  1449. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1450. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1451. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1452. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1453. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1454. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1455. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1456. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1457. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1458. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1459. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1460. /* DWORD 1: tx power, tx rate, tx BW */
  1461. A_UINT32
  1462. /* pwr -
  1463. * Specify what power the tx frame needs to be transmitted at.
  1464. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1465. * The value needs to be appropriately sign-extended when extracting
  1466. * the value from the message and storing it in a variable that is
  1467. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1468. * automatically handles this sign-extension.)
  1469. * If the transmission uses multiple tx chains, this power spec is
  1470. * the total transmit power, assuming incoherent combination of
  1471. * per-chain power to produce the total power.
  1472. */
  1473. pwr: 8,
  1474. /* mcs_mask -
  1475. * Specify the allowable values for MCS index (modulation and coding)
  1476. * to use for transmitting the frame.
  1477. *
  1478. * For HT / VHT preamble types, this mask directly corresponds to
  1479. * the HT or VHT MCS indices that are allowed. For each bit N set
  1480. * within the mask, MCS index N is allowed for transmitting the frame.
  1481. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1482. * rates versus OFDM rates, so the host has the option of specifying
  1483. * that the target must transmit the frame with CCK or OFDM rates
  1484. * (not HT or VHT), but leaving the decision to the target whether
  1485. * to use CCK or OFDM.
  1486. *
  1487. * For CCK and OFDM, the bits within this mask are interpreted as
  1488. * follows:
  1489. * bit 0 -> CCK 1 Mbps rate is allowed
  1490. * bit 1 -> CCK 2 Mbps rate is allowed
  1491. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1492. * bit 3 -> CCK 11 Mbps rate is allowed
  1493. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1494. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1495. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1496. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1497. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1498. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1499. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1500. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1501. *
  1502. * The MCS index specification needs to be compatible with the
  1503. * bandwidth mask specification. For example, a MCS index == 9
  1504. * specification is inconsistent with a preamble type == VHT,
  1505. * Nss == 1, and channel bandwidth == 20 MHz.
  1506. *
  1507. * Furthermore, the host has only a limited ability to specify to
  1508. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1509. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1510. */
  1511. mcs_mask: 12,
  1512. /* nss_mask -
  1513. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1514. * Each bit in this mask corresponds to a Nss value:
  1515. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1516. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1517. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1518. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1519. * The values in the Nss mask must be suitable for the recipient, e.g.
  1520. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1521. * recipient which only supports 2x2 MIMO.
  1522. */
  1523. nss_mask: 4,
  1524. /* guard_interval -
  1525. * Specify a htt_tx_guard_interval enum value to indicate whether
  1526. * the transmission should use a regular guard interval or a
  1527. * short guard interval.
  1528. */
  1529. guard_interval: 1,
  1530. /* preamble_type_mask -
  1531. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1532. * may choose from for transmitting this frame.
  1533. * The bits in this mask correspond to the values in the
  1534. * htt_tx_preamble_type enum. For example, to allow the target
  1535. * to transmit the frame as either CCK or OFDM, this field would
  1536. * be set to
  1537. * (1 << htt_tx_preamble_type_ofdm) |
  1538. * (1 << htt_tx_preamble_type_cck)
  1539. */
  1540. preamble_type_mask: 4,
  1541. reserved1_31_29: 3; /* unused, set to 0x0 */
  1542. /* DWORD 2: tx chain mask, tx retries */
  1543. A_UINT32
  1544. /* chain_mask - specify which chains to transmit from */
  1545. chain_mask: 4,
  1546. /* retry_limit -
  1547. * Specify the maximum number of transmissions, including the
  1548. * initial transmission, to attempt before giving up if no ack
  1549. * is received.
  1550. * If the tx rate is specified, then all retries shall use the
  1551. * same rate as the initial transmission.
  1552. * If no tx rate is specified, the target can choose whether to
  1553. * retain the original rate during the retransmissions, or to
  1554. * fall back to a more robust rate.
  1555. */
  1556. retry_limit: 4,
  1557. /* bandwidth_mask -
  1558. * Specify what channel widths may be used for the transmission.
  1559. * A value of zero indicates "don't care" - the target may choose
  1560. * the transmission bandwidth.
  1561. * The bits within this mask correspond to the htt_tx_bandwidth
  1562. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1563. * The bandwidth_mask must be consistent with the preamble_type_mask
  1564. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1565. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1566. */
  1567. bandwidth_mask: 6,
  1568. reserved2_31_14: 18; /* unused, set to 0x0 */
  1569. /* DWORD 3: tx expiry time (TSF) LSBs */
  1570. A_UINT32 expire_tsf_lo;
  1571. /* DWORD 4: tx expiry time (TSF) MSBs */
  1572. A_UINT32 expire_tsf_hi;
  1573. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1574. } POSTPACK;
  1575. /* DWORD 0 */
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1582. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1589. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1592. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1595. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1596. /* DWORD 1 */
  1597. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1598. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1599. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1600. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1601. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1602. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1603. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1604. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1605. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1606. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1607. /* DWORD 2 */
  1608. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1609. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1610. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1611. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1612. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1613. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1614. /* DWORD 0 */
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1621. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1622. } while (0)
  1623. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1625. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1626. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1633. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1634. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL( \
  1637. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1638. ((_var) |= ((_val) \
  1639. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL( \
  1647. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1648. ((_var) |= ((_val) \
  1649. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1654. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1661. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1662. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1669. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1670. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1677. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1678. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1685. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1686. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1690. } while (0)
  1691. /* DWORD 1 */
  1692. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1694. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1695. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1696. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1697. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1698. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1699. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1700. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1701. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1703. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1704. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1711. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1712. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1719. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1720. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1727. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1728. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1732. } while (0)
  1733. /* DWORD 2 */
  1734. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1736. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1737. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1744. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1745. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1748. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1749. } while (0)
  1750. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1751. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1752. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1753. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1754. do { \
  1755. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1756. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1757. } while (0)
  1758. typedef enum {
  1759. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1760. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1761. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1762. } htt_11ax_ltf_subtype_t;
  1763. typedef enum {
  1764. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1765. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1766. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1767. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1768. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1769. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1770. } htt_tx_ext2_preamble_type_t;
  1771. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1772. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1773. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1774. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1775. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1776. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1777. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1778. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1779. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1780. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1781. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1782. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1783. /**
  1784. * @brief HTT tx MSDU extension descriptor v2
  1785. * @details
  1786. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1787. * is received as tcl_exit_base->host_meta_info in firmware.
  1788. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1789. * are already part of tcl_exit_base.
  1790. */
  1791. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1792. /* DWORD 0: flags */
  1793. A_UINT32
  1794. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1795. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1796. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1797. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1798. valid_retries : 1, /* if set, tx retries spec is valid */
  1799. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1800. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1801. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1802. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1803. valid_key_flags : 1, /* if set, key flags is valid */
  1804. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1805. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1806. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1807. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1808. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1809. 1 = ENCRYPT,
  1810. 2 ~ 3 - Reserved */
  1811. /* retry_limit -
  1812. * Specify the maximum number of transmissions, including the
  1813. * initial transmission, to attempt before giving up if no ack
  1814. * is received.
  1815. * If the tx rate is specified, then all retries shall use the
  1816. * same rate as the initial transmission.
  1817. * If no tx rate is specified, the target can choose whether to
  1818. * retain the original rate during the retransmissions, or to
  1819. * fall back to a more robust rate.
  1820. */
  1821. retry_limit : 4,
  1822. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1823. * Valid only for 11ax preamble types HE_SU
  1824. * and HE_EXT_SU
  1825. */
  1826. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1827. * Valid only for 11ax preamble types HE_SU
  1828. * and HE_EXT_SU
  1829. */
  1830. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1831. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1832. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1833. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1834. */
  1835. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1836. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1837. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1838. * Use cases:
  1839. * Any time firmware uses TQM-BYPASS for Data
  1840. * TID, firmware expect host to set this bit.
  1841. */
  1842. /* DWORD 1: tx power, tx rate */
  1843. A_UINT32
  1844. power : 8, /* unit of the power field is 0.5 dbm
  1845. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1846. * signed value ranging from -64dbm to 63.5 dbm
  1847. */
  1848. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1849. * Setting more than one MCS isn't currently
  1850. * supported by the target (but is supported
  1851. * in the interface in case in the future
  1852. * the target supports specifications of
  1853. * a limited set of MCS values.
  1854. */
  1855. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1856. * Setting more than one Nss isn't currently
  1857. * supported by the target (but is supported
  1858. * in the interface in case in the future
  1859. * the target supports specifications of
  1860. * a limited set of Nss values.
  1861. */
  1862. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1863. update_peer_cache : 1; /* When set these custom values will be
  1864. * used for all packets, until the next
  1865. * update via this ext header.
  1866. * This is to make sure not all packets
  1867. * need to include this header.
  1868. */
  1869. /* DWORD 2: tx chain mask, tx retries */
  1870. A_UINT32
  1871. /* chain_mask - specify which chains to transmit from */
  1872. chain_mask : 8,
  1873. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1874. * TODO: Update Enum values for key_flags
  1875. */
  1876. /*
  1877. * Channel frequency: This identifies the desired channel
  1878. * frequency (in MHz) for tx frames. This is used by FW to help
  1879. * determine when it is safe to transmit or drop frames for
  1880. * off-channel operation.
  1881. * The default value of zero indicates to FW that the corresponding
  1882. * VDEV's home channel (if there is one) is the desired channel
  1883. * frequency.
  1884. */
  1885. chanfreq : 16;
  1886. /* DWORD 3: tx expiry time (TSF) LSBs */
  1887. A_UINT32 expire_tsf_lo;
  1888. /* DWORD 4: tx expiry time (TSF) MSBs */
  1889. A_UINT32 expire_tsf_hi;
  1890. /* DWORD 5: flags to control routing / processing of the MSDU */
  1891. A_UINT32
  1892. /* learning_frame
  1893. * When this flag is set, this frame will be dropped by FW
  1894. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1895. */
  1896. learning_frame : 1,
  1897. /* send_as_standalone
  1898. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1899. * i.e. with no A-MSDU or A-MPDU aggregation.
  1900. * The scope is extended to other use-cases.
  1901. */
  1902. send_as_standalone : 1,
  1903. /* is_host_opaque_valid
  1904. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1905. * with valid information.
  1906. */
  1907. is_host_opaque_valid : 1,
  1908. traffic_end_indication: 1,
  1909. rsvd0 : 28;
  1910. /* DWORD 6 : Host opaque cookie for special frames */
  1911. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1912. rsvd1 : 16;
  1913. /*
  1914. * This structure can be expanded further up to 40 bytes
  1915. * by adding further DWORDs as needed.
  1916. */
  1917. } POSTPACK;
  1918. /* DWORD 0 */
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1945. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1946. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1947. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1948. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1949. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1950. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1951. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1952. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1953. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1954. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1955. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1956. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1957. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1958. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1959. /* DWORD 1 */
  1960. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1961. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1962. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1963. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1964. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1965. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1966. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1967. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1968. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1969. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1970. /* DWORD 2 */
  1971. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1972. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1973. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1974. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1975. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1976. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1977. /* DWORD 5 */
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1984. /* DWORD 6 */
  1985. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1986. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1987. /* DWORD 0 */
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL( \
  2018. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  2019. ((_var) |= ((_val) \
  2020. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  2021. } while (0)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  2023. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  2024. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  2025. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  2029. } while (0)
  2030. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  2031. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  2032. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  2033. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  2034. do { \
  2035. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  2036. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  2037. } while (0)
  2038. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  2039. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  2040. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  2041. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  2042. do { \
  2043. HTT_CHECK_SET_VAL( \
  2044. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2045. ((_var) |= ((_val) \
  2046. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2055. } while (0)
  2056. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2071. } while (0)
  2072. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2079. } while (0)
  2080. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2081. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2082. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2083. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2087. } while (0)
  2088. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2089. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2090. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2091. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2095. } while (0)
  2096. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2103. } while (0)
  2104. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2105. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2106. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2107. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2111. } while (0)
  2112. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2113. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2114. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2115. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2118. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2119. } while (0)
  2120. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2121. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2122. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2123. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2127. } while (0)
  2128. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2129. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2130. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2131. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2132. do { \
  2133. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2134. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2135. } while (0)
  2136. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2137. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2138. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2139. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2140. do { \
  2141. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2142. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2143. } while (0)
  2144. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2145. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2146. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2147. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2151. } while (0)
  2152. /* DWORD 1 */
  2153. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2154. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2155. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2156. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2157. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2158. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2159. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2160. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2161. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2162. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2163. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2164. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2165. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2169. } while (0)
  2170. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2171. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2172. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2173. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2177. } while (0)
  2178. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2179. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2180. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2181. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2182. do { \
  2183. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2184. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2185. } while (0)
  2186. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2187. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2188. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2189. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2190. do { \
  2191. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2192. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2193. } while (0)
  2194. /* DWORD 2 */
  2195. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2196. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2197. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2198. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2199. do { \
  2200. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2201. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2202. } while (0)
  2203. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2204. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2205. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2206. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2207. do { \
  2208. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2209. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2210. } while (0)
  2211. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2212. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2213. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2214. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2215. do { \
  2216. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2217. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2218. } while (0)
  2219. /* DWORD 5 */
  2220. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2221. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2222. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2223. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2224. do { \
  2225. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2226. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2227. } while (0)
  2228. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2229. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2230. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2231. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2232. do { \
  2233. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2234. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2235. } while (0)
  2236. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2237. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2238. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2239. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2240. do { \
  2241. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2242. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2243. } while (0)
  2244. /* DWORD 6 */
  2245. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2246. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2247. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2248. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2252. } while (0)
  2253. typedef enum {
  2254. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2255. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2256. } htt_tcl_metadata_type;
  2257. /**
  2258. * @brief HTT TCL command number format
  2259. * @details
  2260. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2261. * available to firmware as tcl_exit_base->tcl_status_number.
  2262. * For regular / multicast packets host will send vdev and mac id and for
  2263. * NAWDS packets, host will send peer id.
  2264. * A_UINT32 is used to avoid endianness conversion problems.
  2265. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2266. */
  2267. typedef struct {
  2268. A_UINT32
  2269. type: 1, /* vdev_id based or peer_id based */
  2270. rsvd: 31;
  2271. } htt_tx_tcl_vdev_or_peer_t;
  2272. typedef struct {
  2273. A_UINT32
  2274. type: 1, /* vdev_id based or peer_id based */
  2275. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2276. vdev_id: 8,
  2277. pdev_id: 2,
  2278. host_inspected:1,
  2279. rsvd: 19;
  2280. } htt_tx_tcl_vdev_metadata;
  2281. typedef struct {
  2282. A_UINT32
  2283. type: 1, /* vdev_id based or peer_id based */
  2284. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2285. peer_id: 14,
  2286. rsvd: 16;
  2287. } htt_tx_tcl_peer_metadata;
  2288. PREPACK struct htt_tx_tcl_metadata {
  2289. union {
  2290. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2291. htt_tx_tcl_vdev_metadata vdev_meta;
  2292. htt_tx_tcl_peer_metadata peer_meta;
  2293. };
  2294. } POSTPACK;
  2295. /* DWORD 0 */
  2296. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2297. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2298. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2299. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2300. /* VDEV metadata */
  2301. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2302. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2303. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2304. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2305. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2306. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2307. /* PEER metadata */
  2308. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2309. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2310. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2311. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2312. HTT_TX_TCL_METADATA_TYPE_S)
  2313. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2314. do { \
  2315. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2316. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2317. } while (0)
  2318. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2319. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2320. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2321. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2322. do { \
  2323. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2324. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2325. } while (0)
  2326. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2327. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2328. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2329. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2330. do { \
  2331. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2332. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2333. } while (0)
  2334. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2335. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2336. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2337. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2338. do { \
  2339. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2340. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2341. } while (0)
  2342. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2343. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2344. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2345. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2349. } while (0)
  2350. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2351. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2352. HTT_TX_TCL_METADATA_PEER_ID_S)
  2353. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2354. do { \
  2355. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2356. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2357. } while (0)
  2358. /*------------------------------------------------------------------
  2359. * V2 Version of TCL Data Command
  2360. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2361. * MLO global_seq all flavours of TCL Data Cmd.
  2362. *-----------------------------------------------------------------*/
  2363. typedef enum {
  2364. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2365. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2366. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2367. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2368. } htt_tcl_metadata_type_v2;
  2369. /**
  2370. * @brief HTT TCL command number format
  2371. * @details
  2372. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2373. * available to firmware as tcl_exit_base->tcl_status_number.
  2374. * A_UINT32 is used to avoid endianness conversion problems.
  2375. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2376. */
  2377. typedef struct {
  2378. A_UINT32
  2379. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2380. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2381. vdev_id: 8,
  2382. pdev_id: 2,
  2383. host_inspected:1,
  2384. rsvd: 2,
  2385. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2386. } htt_tx_tcl_vdev_metadata_v2;
  2387. typedef struct {
  2388. A_UINT32
  2389. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2390. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2391. peer_id: 13,
  2392. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2393. } htt_tx_tcl_peer_metadata_v2;
  2394. typedef struct {
  2395. A_UINT32
  2396. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2397. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2398. svc_class_id: 8,
  2399. ast_index: 3, /* Indicates to firmware the AST index to be used for Pine for AST Override */
  2400. rsvd: 2,
  2401. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2402. } htt_tx_tcl_svc_class_id_metadata;
  2403. typedef struct {
  2404. A_UINT32
  2405. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2406. host_inspected: 1,
  2407. global_seq_no: 12,
  2408. rsvd: 1,
  2409. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2410. } htt_tx_tcl_global_seq_metadata;
  2411. PREPACK struct htt_tx_tcl_metadata_v2 {
  2412. union {
  2413. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2414. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2415. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2416. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2417. };
  2418. } POSTPACK;
  2419. /* DWORD 0 */
  2420. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2421. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2422. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2423. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2424. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2425. /* VDEV V2 metadata */
  2426. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2427. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2428. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2429. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2430. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2431. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2432. /* PEER V2 metadata */
  2433. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2434. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2435. /* SVC_CLASS_ID metadata */
  2436. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2437. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2438. /* Global Seq no metadata */
  2439. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2440. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2441. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2442. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2443. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2444. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2445. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2446. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2447. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2448. do { \
  2449. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2450. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2451. } while (0)
  2452. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2453. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2454. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2455. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2459. } while (0)
  2460. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2461. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2462. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2463. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2464. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2465. do { \
  2466. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2467. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2468. } while (0)
  2469. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2470. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2471. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2472. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2473. do { \
  2474. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2475. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2476. } while (0)
  2477. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2478. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2479. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2480. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2481. do { \
  2482. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2483. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2484. } while (0)
  2485. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2486. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2487. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2488. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2489. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2492. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2493. } while (0)
  2494. /*----- Get and Set V2 type field in Service Class fields ----*/
  2495. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2496. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2497. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2498. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2499. do { \
  2500. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2501. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2502. } while (0)
  2503. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2504. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2505. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2506. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2507. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2508. do { \
  2509. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2510. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2511. } while (0)
  2512. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2513. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2514. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2515. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2516. do { \
  2517. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2518. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2519. } while (0)
  2520. /*------------------------------------------------------------------
  2521. * End V2 Version of TCL Data Command
  2522. *-----------------------------------------------------------------*/
  2523. typedef enum {
  2524. HTT_TX_FW2WBM_TX_STATUS_OK,
  2525. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2526. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2527. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2528. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2529. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2530. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2531. HTT_TX_FW2WBM_TX_STATUS_MAX
  2532. } htt_tx_fw2wbm_tx_status_t;
  2533. typedef enum {
  2534. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2535. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2536. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2537. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2538. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2539. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2540. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2541. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2542. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2543. HTT_TX_FW2WBM_REINJECT_REASON_SAWF_SVC_CLASS_ID_ABSENT,
  2544. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2545. } htt_tx_fw2wbm_reinject_reason_t;
  2546. /**
  2547. * @brief HTT TX WBM Completion from firmware to host
  2548. * @details
  2549. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2550. * DWORD 3 and 4 for software based completions (Exception frames and
  2551. * TQM bypass frames)
  2552. * For software based completions, wbm_release_ring->release_source_module will
  2553. * be set to release_source_fw
  2554. */
  2555. PREPACK struct htt_tx_wbm_completion {
  2556. A_UINT32
  2557. sch_cmd_id: 24,
  2558. exception_frame: 1, /* If set, this packet was queued via exception path */
  2559. rsvd0_31_25: 7;
  2560. A_UINT32
  2561. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2562. * reception of an ACK or BA, this field indicates
  2563. * the RSSI of the received ACK or BA frame.
  2564. * When the frame is removed as result of a direct
  2565. * remove command from the SW, this field is set
  2566. * to 0x0 (which is never a valid value when real
  2567. * RSSI is available).
  2568. * Units: dB w.r.t noise floor
  2569. */
  2570. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2571. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2572. rsvd1_31_16: 16;
  2573. } POSTPACK;
  2574. /* DWORD 0 */
  2575. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2576. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2577. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2578. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2579. /* DWORD 1 */
  2580. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2581. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2582. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2583. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2584. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2585. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2586. /* DWORD 0 */
  2587. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2588. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2589. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2590. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2591. do { \
  2592. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2593. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2594. } while (0)
  2595. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2596. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2597. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2598. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2599. do { \
  2600. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2601. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2602. } while (0)
  2603. /* DWORD 1 */
  2604. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2605. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2606. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2607. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2610. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2611. } while (0)
  2612. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2613. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2614. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2615. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2618. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2619. } while (0)
  2620. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2621. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2622. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2623. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2626. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2627. } while (0)
  2628. /**
  2629. * @brief HTT TX WBM Completion from firmware to host
  2630. * @details
  2631. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2632. * (WBM) offload HW.
  2633. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2634. * For software based completions, release_source_module will
  2635. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2636. * struct wbm_release_ring and then switch to this after looking at
  2637. * release_source_module.
  2638. */
  2639. PREPACK struct htt_tx_wbm_completion_v2 {
  2640. A_UINT32
  2641. used_by_hw0; /* Refer to struct wbm_release_ring */
  2642. A_UINT32
  2643. used_by_hw1; /* Refer to struct wbm_release_ring */
  2644. A_UINT32
  2645. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2646. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2647. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2648. exception_frame: 1,
  2649. transmit_count: 7, /* Refer to struct wbm_release_ring */
  2650. rsvd0: 5, /* For future use */
  2651. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2652. rsvd1: 1; /* For future use */
  2653. A_UINT32
  2654. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2655. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2656. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2657. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2658. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2659. */
  2660. A_UINT32
  2661. data1: 32;
  2662. A_UINT32
  2663. data2: 32;
  2664. A_UINT32
  2665. used_by_hw3; /* Refer to struct wbm_release_ring */
  2666. } POSTPACK;
  2667. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2668. /* DWORD 3 */
  2669. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2670. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2671. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2672. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2673. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2674. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2675. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_M 0x01FC0000
  2676. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_S 18
  2677. /* DWORD 3 */
  2678. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2679. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2680. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2681. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2682. do { \
  2683. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2684. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2685. } while (0)
  2686. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2687. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2688. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2689. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2690. do { \
  2691. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2692. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2693. } while (0)
  2694. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2695. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2696. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2697. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2698. do { \
  2699. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2700. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2701. } while (0)
  2702. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_GET(_var) \
  2703. (((_var) & HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_M) >> \
  2704. HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_S)
  2705. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_SET(_var, _val) \
  2706. do { \
  2707. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT, _val); \
  2708. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TRANSMIT_COUNT_S)); \
  2709. } while (0)
  2710. /**
  2711. * @brief HTT TX WBM Completion from firmware to host (V3)
  2712. * @details
  2713. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2714. * (WBM) offload HW.
  2715. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2716. * For software based completions, release_source_module will
  2717. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2718. * struct wbm_release_ring and then switch to this after looking at
  2719. * release_source_module.
  2720. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2721. * by new generations of targets.
  2722. */
  2723. PREPACK struct htt_tx_wbm_completion_v3 {
  2724. A_UINT32
  2725. used_by_hw0; /* Refer to struct wbm_release_ring */
  2726. A_UINT32
  2727. used_by_hw1; /* Refer to struct wbm_release_ring */
  2728. A_UINT32
  2729. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2730. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2731. used_by_hw3: 15;
  2732. A_UINT32
  2733. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2734. exception_frame: 1,
  2735. transmit_count: 7, /* Refer to struct wbm_release_ring */
  2736. rsvd0: 20; /* For future use */
  2737. A_UINT32
  2738. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2739. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2740. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2741. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2742. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2743. */
  2744. A_UINT32
  2745. data1: 32;
  2746. A_UINT32
  2747. data2: 32;
  2748. A_UINT32
  2749. rsvd1: 20,
  2750. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2751. } POSTPACK;
  2752. /* DWORD 3 */
  2753. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2754. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2755. /* DWORD 4 */
  2756. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2757. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2758. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2759. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2760. #define HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_M 0x00000FE0
  2761. #define HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_S 5
  2762. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2763. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2764. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2765. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2768. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2769. } while (0)
  2770. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2771. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2772. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2773. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2774. do { \
  2775. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2776. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2777. } while (0)
  2778. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2779. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2780. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2781. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2784. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2785. } while (0)
  2786. #define HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_GET(_var) \
  2787. (((_var) & HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_M) >> \
  2788. HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_S)
  2789. #define HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT, _val); \
  2792. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TRANSMIT_COUNT_S)); \
  2793. } while (0)
  2794. typedef enum {
  2795. TX_FRAME_TYPE_UNDEFINED = 0,
  2796. TX_FRAME_TYPE_EAPOL = 1,
  2797. } htt_tx_wbm_status_frame_type;
  2798. /**
  2799. * @brief HTT TX WBM transmit status from firmware to host
  2800. * @details
  2801. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2802. * (WBM) offload HW.
  2803. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2804. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2805. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2806. */
  2807. PREPACK struct htt_tx_wbm_transmit_status {
  2808. A_UINT32
  2809. sch_cmd_id: 24,
  2810. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2811. * reception of an ACK or BA, this field indicates
  2812. * the RSSI of the received ACK or BA frame.
  2813. * When the frame is removed as result of a direct
  2814. * remove command from the SW, this field is set
  2815. * to 0x0 (which is never a valid value when real
  2816. * RSSI is available).
  2817. * Units: dB w.r.t noise floor
  2818. */
  2819. A_UINT32
  2820. sw_peer_id: 16,
  2821. tid_num: 5,
  2822. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2823. * and tid_num fields contain valid data.
  2824. * If this "valid" flag is not set, the
  2825. * sw_peer_id and tid_num fields must be ignored.
  2826. */
  2827. mcast: 1,
  2828. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2829. * contains valid data.
  2830. */
  2831. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2832. transmit_count_valid: 1, /* If this "transmit_count_valid" is set, the
  2833. * transmit_count field in struct
  2834. * htt_tx_wbm_completion_vx has valid data.
  2835. */
  2836. reserved: 3;
  2837. A_UINT32
  2838. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2839. * packets in the wbm completion path
  2840. */
  2841. } POSTPACK;
  2842. /* DWORD 4 */
  2843. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2844. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2845. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2846. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2847. /* DWORD 5 */
  2848. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2849. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2850. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2851. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2852. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2853. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2854. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2855. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2856. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2857. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2858. #define HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_M 0x0F000000
  2859. #define HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_S 24
  2860. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_M 0x10000000
  2861. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_S 28
  2862. /* DWORD 4 */
  2863. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2864. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2865. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2866. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2869. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2870. } while (0)
  2871. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2872. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2873. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2874. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2877. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2878. } while (0)
  2879. /* DWORD 5 */
  2880. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2881. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2882. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2883. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2886. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2887. } while (0)
  2888. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2889. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2890. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2891. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2894. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2895. } while (0)
  2896. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2897. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2898. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2899. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2902. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2903. } while (0)
  2904. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2905. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2906. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2907. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2910. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2911. } while (0)
  2912. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2913. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2914. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2915. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2918. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2919. } while (0)
  2920. #define HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_GET(_var) \
  2921. (((_var) & HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_M) >> \
  2922. HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_S)
  2923. #define HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE, _val); \
  2926. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_FRAME_TYPE_S)); \
  2927. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_GET(_var) \
  2928. (((_var) & HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_M) >> \
  2929. HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_S)
  2930. #define HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2933. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TRANSMIT_CNT_VALID_S)); \
  2934. } while (0)
  2935. /**
  2936. * @brief HTT TX WBM reinject status from firmware to host
  2937. * @details
  2938. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2939. * (WBM) offload HW.
  2940. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2941. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2942. */
  2943. PREPACK struct htt_tx_wbm_reinject_status {
  2944. A_UINT32
  2945. sw_peer_id : 16,
  2946. data_length : 16;
  2947. A_UINT32
  2948. tid : 5,
  2949. msduq_idx : 4,
  2950. reserved1 : 23;
  2951. A_UINT32
  2952. reserved2: 32;
  2953. } POSTPACK;
  2954. #define HTT_TX_WBM_REINJECT_SW_PEER_ID_M 0x0000ffff
  2955. #define HTT_TX_WBM_REINJECT_SW_PEER_ID_S 0
  2956. #define HTT_TX_WBM_REINJECT_DATA_LEN_M 0xffff0000
  2957. #define HTT_TX_WBM_REINJECT_DATA_LEN_S 16
  2958. #define HTT_TX_WBM_REINJECT_TID_M 0x0000001f
  2959. #define HTT_TX_WBM_REINJECT_TID_S 0
  2960. #define HTT_TX_WBM_REINJECT_MSDUQ_ID_M 0x000001e0
  2961. #define HTT_TX_WBM_REINJECT_MSDUQ_ID_S 5
  2962. #define HTT_TX_WBM_REINJECT_SW_PEER_ID_GET(_var)\
  2963. (((_var) & HTT_TX_WBM_REINJECT_SW_PEER_ID_M) >>\
  2964. HTT_TX_WBM_REINJECT_SW_PEER_ID_S)\
  2965. #define HTT_TX_WBM_REINJECT_SW_PEER_ID_SET(_var, _val)\
  2966. do {\
  2967. HTT_CHECK_SET_VAL(HTT_TX_WBM_REINJECT_SW_PEER_ID, _val); \
  2968. ((_var) |= ((_val) << HTT_TX_WBM_REINJECT_SW_PEER_ID_S));\
  2969. } while(0)
  2970. #define HTT_TX_WBM_REINJECT_DATA_LEN_GET(_var)\
  2971. (((_var) & HTT_TX_WBM_REINJECT_DATA_LEN_M) >>\
  2972. HTT_TX_WBM_REINJECT_DATA_LEN_S)\
  2973. #define HTT_TX_WBM_REINJECT_DATA_LEN_SET(_var, _val)\
  2974. do {\
  2975. HTT_CHECK_SET_VAL(HTT_TX_WBM_REINJECT_DATA_LEN, _val); \
  2976. ((_var) |= ((_val) << HTT_TX_WBM_REINJECT_DATA_LEN_S));\
  2977. } while(0)
  2978. #define HTT_TX_WBM_REINJECT_TID_GET(_var)\
  2979. (((_var) & HTT_TX_WBM_REINJECT_TID_M) >>\
  2980. HTT_TX_WBM_REINJECT_TID_S)\
  2981. #define HTT_TX_WBM_REINJECT_TID_SET(_var, _val)\
  2982. do {\
  2983. HTT_CHECK_SET_VAL(HTT_TX_WBM_REINJECT_TID, _val); \
  2984. ((_var) |= ((_val) << HTT_TX_WBM_REINJECT_TID_S));\
  2985. } while(0)
  2986. #define HTT_TX_WBM_REINJECT_MSDUQ_ID_GET(_var)\
  2987. (((_var) & HTT_TX_WBM_REINJECT_MSDUQ_ID_M) >>\
  2988. HTT_TX_WBM_REINJECT_MSDUQ_ID_S)\
  2989. #define HTT_TX_WBM_REINJECT_MSDUQ_ID_SET(_var, _val)\
  2990. do {\
  2991. HTT_CHECK_SET_VAL(HTT_TX_WBM_REINJECT_MSDUQ_ID, _val); \
  2992. ((_var) |= ((_val) << HTT_TX_WBM_REINJECT_MSDUQ_ID_S));\
  2993. } while(0)
  2994. /**
  2995. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2996. * @details
  2997. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2998. * (WBM) offload HW.
  2999. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  3000. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  3001. * FW sends SA addresses to host for all multicast/broadcast packets received on
  3002. * STA side.
  3003. */
  3004. PREPACK struct htt_tx_wbm_mec_addr_notify {
  3005. A_UINT32
  3006. mec_sa_addr_31_0;
  3007. A_UINT32
  3008. mec_sa_addr_47_32: 16,
  3009. sa_ast_index: 16;
  3010. A_UINT32
  3011. vdev_id: 8,
  3012. reserved0: 24;
  3013. } POSTPACK;
  3014. /* DWORD 4 - mec_sa_addr_31_0 */
  3015. /* DWORD 5 */
  3016. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  3017. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  3018. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  3019. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  3020. /* DWORD 6 */
  3021. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  3022. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  3023. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  3024. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  3025. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  3026. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  3029. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  3030. } while (0)
  3031. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  3032. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  3033. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  3034. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  3037. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  3038. } while (0)
  3039. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  3040. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  3041. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  3042. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  3045. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  3046. } while (0)
  3047. typedef enum {
  3048. TX_FLOW_PRIORITY_BE,
  3049. TX_FLOW_PRIORITY_HIGH,
  3050. TX_FLOW_PRIORITY_LOW,
  3051. } htt_tx_flow_priority_t;
  3052. typedef enum {
  3053. TX_FLOW_LATENCY_SENSITIVE,
  3054. TX_FLOW_LATENCY_INSENSITIVE,
  3055. } htt_tx_flow_latency_t;
  3056. typedef enum {
  3057. TX_FLOW_BEST_EFFORT_TRAFFIC,
  3058. TX_FLOW_INTERACTIVE_TRAFFIC,
  3059. TX_FLOW_PERIODIC_TRAFFIC,
  3060. TX_FLOW_BURSTY_TRAFFIC,
  3061. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  3062. } htt_tx_flow_traffic_pattern_t;
  3063. /**
  3064. * @brief HTT TX Flow search metadata format
  3065. * @details
  3066. * Host will set this metadata in flow table's flow search entry along with
  3067. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  3068. * firmware and TQM ring if the flow search entry wins.
  3069. * This metadata is available to firmware in that first MSDU's
  3070. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  3071. * to one of the available flows for specific tid and returns the tqm flow
  3072. * pointer as part of htt_tx_map_flow_info message.
  3073. */
  3074. PREPACK struct htt_tx_flow_metadata {
  3075. A_UINT32
  3076. rsvd0_1_0: 2,
  3077. tid: 4,
  3078. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  3079. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  3080. tid_override: 1, /* If set, tid field in this struct is the final tid.
  3081. * Else choose final tid based on latency, priority.
  3082. */
  3083. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  3084. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  3085. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  3086. } POSTPACK;
  3087. /* DWORD 0 */
  3088. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  3089. #define HTT_TX_FLOW_METADATA_TID_S 2
  3090. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  3091. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  3092. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  3093. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  3094. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  3095. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  3096. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  3097. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  3098. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  3099. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  3100. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  3101. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  3102. /* DWORD 0 */
  3103. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  3104. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  3105. HTT_TX_FLOW_METADATA_TID_S)
  3106. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  3107. do { \
  3108. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  3109. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  3110. } while (0)
  3111. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  3112. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  3113. HTT_TX_FLOW_METADATA_PRIORITY_S)
  3114. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  3117. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  3118. } while (0)
  3119. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  3120. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  3121. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  3122. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  3123. do { \
  3124. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  3125. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  3126. } while (0)
  3127. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  3128. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  3129. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  3130. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  3133. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  3134. } while (0)
  3135. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  3136. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3137. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3138. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3141. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3142. } while (0)
  3143. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3144. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3145. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3146. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3147. do { \
  3148. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3149. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3150. } while (0)
  3151. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3152. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3153. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3154. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3155. do { \
  3156. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3157. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3158. } while (0)
  3159. /**
  3160. * @brief host -> target ADD WDS Entry
  3161. *
  3162. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3163. *
  3164. * @brief host -> target DELETE WDS Entry
  3165. *
  3166. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3167. *
  3168. * @details
  3169. * HTT wds entry from source port learning
  3170. * Host will learn wds entries from rx and send this message to firmware
  3171. * to enable firmware to configure/delete AST entries for wds clients.
  3172. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3173. * and when SA's entry is deleted, firmware removes this AST entry
  3174. *
  3175. * The message would appear as follows:
  3176. *
  3177. * |31 30|29 |17 16|15 8|7 0|
  3178. * |----------------+----------------+----------------+----------------|
  3179. * | rsvd0 |PDVID| vdev_id | msg_type |
  3180. * |-------------------------------------------------------------------|
  3181. * | sa_addr_31_0 |
  3182. * |-------------------------------------------------------------------|
  3183. * | | ta_peer_id | sa_addr_47_32 |
  3184. * |-------------------------------------------------------------------|
  3185. * Where PDVID = pdev_id
  3186. *
  3187. * The message is interpreted as follows:
  3188. *
  3189. * dword0 - b'0:7 - msg_type: This will be set to
  3190. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3191. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3192. *
  3193. * dword0 - b'8:15 - vdev_id
  3194. *
  3195. * dword0 - b'16:17 - pdev_id
  3196. *
  3197. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3198. *
  3199. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3200. *
  3201. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3202. *
  3203. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3204. */
  3205. PREPACK struct htt_wds_entry {
  3206. A_UINT32
  3207. msg_type: 8,
  3208. vdev_id: 8,
  3209. pdev_id: 2,
  3210. rsvd0: 14;
  3211. A_UINT32 sa_addr_31_0;
  3212. A_UINT32
  3213. sa_addr_47_32: 16,
  3214. ta_peer_id: 14,
  3215. rsvd2: 2;
  3216. } POSTPACK;
  3217. /* DWORD 0 */
  3218. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3219. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3220. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3221. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3222. /* DWORD 2 */
  3223. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3224. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3225. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3226. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3227. /* DWORD 0 */
  3228. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3229. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3230. HTT_WDS_ENTRY_VDEV_ID_S)
  3231. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3232. do { \
  3233. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3234. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3235. } while (0)
  3236. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3237. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3238. HTT_WDS_ENTRY_PDEV_ID_S)
  3239. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3240. do { \
  3241. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3242. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3243. } while (0)
  3244. /* DWORD 2 */
  3245. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3246. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3247. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3248. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3249. do { \
  3250. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3251. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3252. } while (0)
  3253. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3254. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3255. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3256. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3257. do { \
  3258. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3259. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3260. } while (0)
  3261. /**
  3262. * @brief MAC DMA rx ring setup specification
  3263. *
  3264. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3265. *
  3266. * @details
  3267. * To allow for dynamic rx ring reconfiguration and to avoid race
  3268. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3269. * it uses. Instead, it sends this message to the target, indicating how
  3270. * the rx ring used by the host should be set up and maintained.
  3271. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3272. * specifications.
  3273. *
  3274. * |31 16|15 8|7 0|
  3275. * |---------------------------------------------------------------|
  3276. * header: | reserved | num rings | msg type |
  3277. * |---------------------------------------------------------------|
  3278. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3279. #if HTT_PADDR64
  3280. * | FW_IDX shadow register physical address (bits 63:32) |
  3281. #endif
  3282. * |---------------------------------------------------------------|
  3283. * | rx ring base physical address (bits 31:0) |
  3284. #if HTT_PADDR64
  3285. * | rx ring base physical address (bits 63:32) |
  3286. #endif
  3287. * |---------------------------------------------------------------|
  3288. * | rx ring buffer size | rx ring length |
  3289. * |---------------------------------------------------------------|
  3290. * | FW_IDX initial value | enabled flags |
  3291. * |---------------------------------------------------------------|
  3292. * | MSDU payload offset | 802.11 header offset |
  3293. * |---------------------------------------------------------------|
  3294. * | PPDU end offset | PPDU start offset |
  3295. * |---------------------------------------------------------------|
  3296. * | MPDU end offset | MPDU start offset |
  3297. * |---------------------------------------------------------------|
  3298. * | MSDU end offset | MSDU start offset |
  3299. * |---------------------------------------------------------------|
  3300. * | frag info offset | rx attention offset |
  3301. * |---------------------------------------------------------------|
  3302. * payload 2, if present, has the same format as payload 1
  3303. * Header fields:
  3304. * - MSG_TYPE
  3305. * Bits 7:0
  3306. * Purpose: identifies this as an rx ring configuration message
  3307. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3308. * - NUM_RINGS
  3309. * Bits 15:8
  3310. * Purpose: indicates whether the host is setting up one rx ring or two
  3311. * Value: 1 or 2
  3312. * Payload:
  3313. * for systems using 64-bit format for bus addresses:
  3314. * - IDX_SHADOW_REG_PADDR_LO
  3315. * Bits 31:0
  3316. * Value: lower 4 bytes of physical address of the host's
  3317. * FW_IDX shadow register
  3318. * - IDX_SHADOW_REG_PADDR_HI
  3319. * Bits 31:0
  3320. * Value: upper 4 bytes of physical address of the host's
  3321. * FW_IDX shadow register
  3322. * - RING_BASE_PADDR_LO
  3323. * Bits 31:0
  3324. * Value: lower 4 bytes of physical address of the host's rx ring
  3325. * - RING_BASE_PADDR_HI
  3326. * Bits 31:0
  3327. * Value: uppper 4 bytes of physical address of the host's rx ring
  3328. * for systems using 32-bit format for bus addresses:
  3329. * - IDX_SHADOW_REG_PADDR
  3330. * Bits 31:0
  3331. * Value: physical address of the host's FW_IDX shadow register
  3332. * - RING_BASE_PADDR
  3333. * Bits 31:0
  3334. * Value: physical address of the host's rx ring
  3335. * - RING_LEN
  3336. * Bits 15:0
  3337. * Value: number of elements in the rx ring
  3338. * - RING_BUF_SZ
  3339. * Bits 31:16
  3340. * Value: size of the buffers referenced by the rx ring, in byte units
  3341. * - ENABLED_FLAGS
  3342. * Bits 15:0
  3343. * Value: 1-bit flags to show whether different rx fields are enabled
  3344. * bit 0: 802.11 header enabled (1) or disabled (0)
  3345. * bit 1: MSDU payload enabled (1) or disabled (0)
  3346. * bit 2: PPDU start enabled (1) or disabled (0)
  3347. * bit 3: PPDU end enabled (1) or disabled (0)
  3348. * bit 4: MPDU start enabled (1) or disabled (0)
  3349. * bit 5: MPDU end enabled (1) or disabled (0)
  3350. * bit 6: MSDU start enabled (1) or disabled (0)
  3351. * bit 7: MSDU end enabled (1) or disabled (0)
  3352. * bit 8: rx attention enabled (1) or disabled (0)
  3353. * bit 9: frag info enabled (1) or disabled (0)
  3354. * bit 10: unicast rx enabled (1) or disabled (0)
  3355. * bit 11: multicast rx enabled (1) or disabled (0)
  3356. * bit 12: ctrl rx enabled (1) or disabled (0)
  3357. * bit 13: mgmt rx enabled (1) or disabled (0)
  3358. * bit 14: null rx enabled (1) or disabled (0)
  3359. * bit 15: phy data rx enabled (1) or disabled (0)
  3360. * - IDX_INIT_VAL
  3361. * Bits 31:16
  3362. * Purpose: Specify the initial value for the FW_IDX.
  3363. * Value: the number of buffers initially present in the host's rx ring
  3364. * - OFFSET_802_11_HDR
  3365. * Bits 15:0
  3366. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3367. * - OFFSET_MSDU_PAYLOAD
  3368. * Bits 31:16
  3369. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3370. * - OFFSET_PPDU_START
  3371. * Bits 15:0
  3372. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3373. * - OFFSET_PPDU_END
  3374. * Bits 31:16
  3375. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3376. * - OFFSET_MPDU_START
  3377. * Bits 15:0
  3378. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3379. * - OFFSET_MPDU_END
  3380. * Bits 31:16
  3381. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3382. * - OFFSET_MSDU_START
  3383. * Bits 15:0
  3384. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3385. * - OFFSET_MSDU_END
  3386. * Bits 31:16
  3387. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3388. * - OFFSET_RX_ATTN
  3389. * Bits 15:0
  3390. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3391. * - OFFSET_FRAG_INFO
  3392. * Bits 31:16
  3393. * Value: offset in QUAD-bytes of frag info table
  3394. */
  3395. /* header fields */
  3396. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3397. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3398. /* payload fields */
  3399. /* for systems using a 64-bit format for bus addresses */
  3400. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3401. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3402. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3403. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3404. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3405. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3406. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3407. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3408. /* for systems using a 32-bit format for bus addresses */
  3409. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3410. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3411. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3412. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3413. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3414. #define HTT_RX_RING_CFG_LEN_S 0
  3415. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3416. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3417. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3418. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3419. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3420. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3421. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3422. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3423. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3424. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3425. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3426. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3427. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3428. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3429. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3430. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3431. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3432. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3433. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3434. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3435. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3436. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3437. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3438. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3439. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3440. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3441. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3442. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3443. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3444. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3445. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3446. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3447. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3448. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3449. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3450. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3451. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3452. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3453. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3454. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3455. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3456. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3457. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3458. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3459. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3460. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3461. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3462. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3463. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3464. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3465. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3466. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3467. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3468. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3469. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3470. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3471. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3472. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3473. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3474. #if HTT_PADDR64
  3475. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3476. #else
  3477. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3478. #endif
  3479. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3480. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3481. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3483. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3486. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3487. } while (0)
  3488. /* degenerate case for 32-bit fields */
  3489. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3490. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3491. ((_var) = (_val))
  3492. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3493. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3494. ((_var) = (_val))
  3495. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3496. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3497. ((_var) = (_val))
  3498. /* degenerate case for 32-bit fields */
  3499. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3500. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3501. ((_var) = (_val))
  3502. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3503. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3504. ((_var) = (_val))
  3505. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3506. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3507. ((_var) = (_val))
  3508. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3509. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3510. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3517. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3524. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3525. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3532. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3533. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3540. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3541. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3545. } while (0)
  3546. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3547. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3548. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3549. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3552. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3553. } while (0)
  3554. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3555. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3556. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3557. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3560. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3561. } while (0)
  3562. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3563. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3564. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3565. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3568. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3569. } while (0)
  3570. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3571. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3572. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3573. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3576. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3577. } while (0)
  3578. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3579. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3580. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3581. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3584. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3585. } while (0)
  3586. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3587. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3588. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3589. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3590. do { \
  3591. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3592. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3593. } while (0)
  3594. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3595. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3596. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3597. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3598. do { \
  3599. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3600. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3601. } while (0)
  3602. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3603. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3604. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3605. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3606. do { \
  3607. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3608. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3609. } while (0)
  3610. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3611. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3612. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3613. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3614. do { \
  3615. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3616. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3617. } while (0)
  3618. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3619. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3620. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3621. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3622. do { \
  3623. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3624. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3625. } while (0)
  3626. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3627. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3628. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3629. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3630. do { \
  3631. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3632. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3633. } while (0)
  3634. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3635. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3636. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3637. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3638. do { \
  3639. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3640. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3641. } while (0)
  3642. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3643. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3644. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3645. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3646. do { \
  3647. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3648. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3649. } while (0)
  3650. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3651. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3652. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3653. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3656. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3657. } while (0)
  3658. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3659. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3660. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3661. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3664. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3665. } while (0)
  3666. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3667. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3668. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3669. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3672. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3673. } while (0)
  3674. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3675. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3676. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3677. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3680. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3681. } while (0)
  3682. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3683. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3684. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3685. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3688. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3689. } while (0)
  3690. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3691. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3692. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3693. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3696. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3697. } while (0)
  3698. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3699. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3700. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3701. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3704. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3705. } while (0)
  3706. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3707. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3708. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3709. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3712. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3713. } while (0)
  3714. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3715. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3716. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3717. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3720. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3721. } while (0)
  3722. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3723. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3724. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3725. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3728. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3729. } while (0)
  3730. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3731. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3732. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3733. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3736. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3737. } while (0)
  3738. /**
  3739. * @brief host -> target FW statistics retrieve
  3740. *
  3741. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3742. *
  3743. * @details
  3744. * The following field definitions describe the format of the HTT host
  3745. * to target FW stats retrieve message. The message specifies the type of
  3746. * stats host wants to retrieve.
  3747. *
  3748. * |31 24|23 16|15 8|7 0|
  3749. * |-----------------------------------------------------------|
  3750. * | stats types request bitmask | msg type |
  3751. * |-----------------------------------------------------------|
  3752. * | stats types reset bitmask | reserved |
  3753. * |-----------------------------------------------------------|
  3754. * | stats type | config value |
  3755. * |-----------------------------------------------------------|
  3756. * | cookie LSBs |
  3757. * |-----------------------------------------------------------|
  3758. * | cookie MSBs |
  3759. * |-----------------------------------------------------------|
  3760. * Header fields:
  3761. * - MSG_TYPE
  3762. * Bits 7:0
  3763. * Purpose: identifies this is a stats upload request message
  3764. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3765. * - UPLOAD_TYPES
  3766. * Bits 31:8
  3767. * Purpose: identifies which types of FW statistics to upload
  3768. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3769. * - RESET_TYPES
  3770. * Bits 31:8
  3771. * Purpose: identifies which types of FW statistics to reset
  3772. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3773. * - CFG_VAL
  3774. * Bits 23:0
  3775. * Purpose: give an opaque configuration value to the specified stats type
  3776. * Value: stats-type specific configuration value
  3777. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3778. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3779. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3780. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3781. * - CFG_STAT_TYPE
  3782. * Bits 31:24
  3783. * Purpose: specify which stats type (if any) the config value applies to
  3784. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3785. * a valid configuration specification
  3786. * - COOKIE_LSBS
  3787. * Bits 31:0
  3788. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3789. * message with its preceding host->target stats request message.
  3790. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3791. * - COOKIE_MSBS
  3792. * Bits 31:0
  3793. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3794. * message with its preceding host->target stats request message.
  3795. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3796. */
  3797. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3798. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3799. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3800. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3801. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3802. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3803. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3804. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3805. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3806. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3807. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3808. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3809. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3810. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3811. do { \
  3812. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3813. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3814. } while (0)
  3815. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3816. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3817. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3818. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3819. do { \
  3820. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3821. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3822. } while (0)
  3823. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3824. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3825. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3826. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3829. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3830. } while (0)
  3831. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3832. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3833. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3834. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3835. do { \
  3836. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3837. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3838. } while (0)
  3839. /**
  3840. * @brief host -> target HTT out-of-band sync request
  3841. *
  3842. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3843. *
  3844. * @details
  3845. * The HTT SYNC tells the target to suspend processing of subsequent
  3846. * HTT host-to-target messages until some other target agent locally
  3847. * informs the target HTT FW that the current sync counter is equal to
  3848. * or greater than (in a modulo sense) the sync counter specified in
  3849. * the SYNC message.
  3850. * This allows other host-target components to synchronize their operation
  3851. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3852. * security key has been downloaded to and activated by the target.
  3853. * In the absence of any explicit synchronization counter value
  3854. * specification, the target HTT FW will use zero as the default current
  3855. * sync value.
  3856. *
  3857. * |31 24|23 16|15 8|7 0|
  3858. * |-----------------------------------------------------------|
  3859. * | reserved | sync count | msg type |
  3860. * |-----------------------------------------------------------|
  3861. * Header fields:
  3862. * - MSG_TYPE
  3863. * Bits 7:0
  3864. * Purpose: identifies this as a sync message
  3865. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3866. * - SYNC_COUNT
  3867. * Bits 15:8
  3868. * Purpose: specifies what sync value the HTT FW will wait for from
  3869. * an out-of-band specification to resume its operation
  3870. * Value: in-band sync counter value to compare against the out-of-band
  3871. * counter spec.
  3872. * The HTT target FW will suspend its host->target message processing
  3873. * as long as
  3874. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3875. */
  3876. #define HTT_H2T_SYNC_MSG_SZ 4
  3877. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3878. #define HTT_H2T_SYNC_COUNT_S 8
  3879. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3880. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3881. HTT_H2T_SYNC_COUNT_S)
  3882. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3885. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3886. } while (0)
  3887. /**
  3888. * @brief host -> target HTT aggregation configuration
  3889. *
  3890. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3891. */
  3892. #define HTT_AGGR_CFG_MSG_SZ 4
  3893. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3894. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3895. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3896. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3897. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3898. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3899. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3900. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3901. do { \
  3902. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3903. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3904. } while (0)
  3905. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3906. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3907. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3908. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3909. do { \
  3910. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3911. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3912. } while (0)
  3913. /**
  3914. * @brief host -> target HTT configure max amsdu info per vdev
  3915. *
  3916. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3917. *
  3918. * @details
  3919. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3920. *
  3921. * |31 21|20 16|15 8|7 0|
  3922. * |-----------------------------------------------------------|
  3923. * | reserved | vdev id | max amsdu | msg type |
  3924. * |-----------------------------------------------------------|
  3925. * Header fields:
  3926. * - MSG_TYPE
  3927. * Bits 7:0
  3928. * Purpose: identifies this as a aggr cfg ex message
  3929. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3930. * - MAX_NUM_AMSDU_SUBFRM
  3931. * Bits 15:8
  3932. * Purpose: max MSDUs per A-MSDU
  3933. * - VDEV_ID
  3934. * Bits 20:16
  3935. * Purpose: ID of the vdev to which this limit is applied
  3936. */
  3937. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3938. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3939. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3940. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3941. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3942. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3943. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3944. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3945. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3946. do { \
  3947. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3948. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3949. } while (0)
  3950. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3951. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3952. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3953. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3954. do { \
  3955. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3956. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3957. } while (0)
  3958. /**
  3959. * @brief HTT WDI_IPA Config Message
  3960. *
  3961. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3962. *
  3963. * @details
  3964. * The HTT WDI_IPA config message is created/sent by host at driver
  3965. * init time. It contains information about data structures used on
  3966. * WDI_IPA TX and RX path.
  3967. * TX CE ring is used for pushing packet metadata from IPA uC
  3968. * to WLAN FW
  3969. * TX Completion ring is used for generating TX completions from
  3970. * WLAN FW to IPA uC
  3971. * RX Indication ring is used for indicating RX packets from FW
  3972. * to IPA uC
  3973. * RX Ring2 is used as either completion ring or as second
  3974. * indication ring. when Ring2 is used as completion ring, IPA uC
  3975. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3976. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3977. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3978. * indicated in RX Indication ring. Please see WDI_IPA specification
  3979. * for more details.
  3980. * |31 24|23 16|15 8|7 0|
  3981. * |----------------+----------------+----------------+----------------|
  3982. * | tx pkt pool size | Rsvd | msg_type |
  3983. * |-------------------------------------------------------------------|
  3984. * | tx comp ring base (bits 31:0) |
  3985. #if HTT_PADDR64
  3986. * | tx comp ring base (bits 63:32) |
  3987. #endif
  3988. * |-------------------------------------------------------------------|
  3989. * | tx comp ring size |
  3990. * |-------------------------------------------------------------------|
  3991. * | tx comp WR_IDX physical address (bits 31:0) |
  3992. #if HTT_PADDR64
  3993. * | tx comp WR_IDX physical address (bits 63:32) |
  3994. #endif
  3995. * |-------------------------------------------------------------------|
  3996. * | tx CE WR_IDX physical address (bits 31:0) |
  3997. #if HTT_PADDR64
  3998. * | tx CE WR_IDX physical address (bits 63:32) |
  3999. #endif
  4000. * |-------------------------------------------------------------------|
  4001. * | rx indication ring base (bits 31:0) |
  4002. #if HTT_PADDR64
  4003. * | rx indication ring base (bits 63:32) |
  4004. #endif
  4005. * |-------------------------------------------------------------------|
  4006. * | rx indication ring size |
  4007. * |-------------------------------------------------------------------|
  4008. * | rx ind RD_IDX physical address (bits 31:0) |
  4009. #if HTT_PADDR64
  4010. * | rx ind RD_IDX physical address (bits 63:32) |
  4011. #endif
  4012. * |-------------------------------------------------------------------|
  4013. * | rx ind WR_IDX physical address (bits 31:0) |
  4014. #if HTT_PADDR64
  4015. * | rx ind WR_IDX physical address (bits 63:32) |
  4016. #endif
  4017. * |-------------------------------------------------------------------|
  4018. * |-------------------------------------------------------------------|
  4019. * | rx ring2 base (bits 31:0) |
  4020. #if HTT_PADDR64
  4021. * | rx ring2 base (bits 63:32) |
  4022. #endif
  4023. * |-------------------------------------------------------------------|
  4024. * | rx ring2 size |
  4025. * |-------------------------------------------------------------------|
  4026. * | rx ring2 RD_IDX physical address (bits 31:0) |
  4027. #if HTT_PADDR64
  4028. * | rx ring2 RD_IDX physical address (bits 63:32) |
  4029. #endif
  4030. * |-------------------------------------------------------------------|
  4031. * | rx ring2 WR_IDX physical address (bits 31:0) |
  4032. #if HTT_PADDR64
  4033. * | rx ring2 WR_IDX physical address (bits 63:32) |
  4034. #endif
  4035. * |-------------------------------------------------------------------|
  4036. *
  4037. * Header fields:
  4038. * Header fields:
  4039. * - MSG_TYPE
  4040. * Bits 7:0
  4041. * Purpose: Identifies this as WDI_IPA config message
  4042. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  4043. * - TX_PKT_POOL_SIZE
  4044. * Bits 15:0
  4045. * Purpose: Total number of TX packet buffer pool allocated by Host for
  4046. * WDI_IPA TX path
  4047. * For systems using 32-bit format for bus addresses:
  4048. * - TX_COMP_RING_BASE_ADDR
  4049. * Bits 31:0
  4050. * Purpose: TX Completion Ring base address in DDR
  4051. * - TX_COMP_RING_SIZE
  4052. * Bits 31:0
  4053. * Purpose: TX Completion Ring size (must be power of 2)
  4054. * - TX_COMP_WR_IDX_ADDR
  4055. * Bits 31:0
  4056. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  4057. * updates the Write Index for WDI_IPA TX completion ring
  4058. * - TX_CE_WR_IDX_ADDR
  4059. * Bits 31:0
  4060. * Purpose: DDR address where IPA uC
  4061. * updates the WR Index for TX CE ring
  4062. * (needed for fusion platforms)
  4063. * - RX_IND_RING_BASE_ADDR
  4064. * Bits 31:0
  4065. * Purpose: RX Indication Ring base address in DDR
  4066. * - RX_IND_RING_SIZE
  4067. * Bits 31:0
  4068. * Purpose: RX Indication Ring size
  4069. * - RX_IND_RD_IDX_ADDR
  4070. * Bits 31:0
  4071. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  4072. * RX indication ring
  4073. * - RX_IND_WR_IDX_ADDR
  4074. * Bits 31:0
  4075. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  4076. * updates the Write Index for WDI_IPA RX indication ring
  4077. * - RX_RING2_BASE_ADDR
  4078. * Bits 31:0
  4079. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  4080. * - RX_RING2_SIZE
  4081. * Bits 31:0
  4082. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4083. * - RX_RING2_RD_IDX_ADDR
  4084. * Bits 31:0
  4085. * Purpose: If Second RX ring is Indication ring, DDR address where
  4086. * IPA uC updates the Read Index for Ring2.
  4087. * If Second RX ring is completion ring, this is NOT used
  4088. * - RX_RING2_WR_IDX_ADDR
  4089. * Bits 31:0
  4090. * Purpose: If Second RX ring is Indication ring, DDR address where
  4091. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  4092. * If second RX ring is completion ring, DDR address where
  4093. * IPA uC updates the Write Index for Ring 2.
  4094. * For systems using 64-bit format for bus addresses:
  4095. * - TX_COMP_RING_BASE_ADDR_LO
  4096. * Bits 31:0
  4097. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  4098. * - TX_COMP_RING_BASE_ADDR_HI
  4099. * Bits 31:0
  4100. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  4101. * - TX_COMP_RING_SIZE
  4102. * Bits 31:0
  4103. * Purpose: TX Completion Ring size (must be power of 2)
  4104. * - TX_COMP_WR_IDX_ADDR_LO
  4105. * Bits 31:0
  4106. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4107. * Lower 4 bytes of DDR address where WIFI FW
  4108. * updates the Write Index for WDI_IPA TX completion ring
  4109. * - TX_COMP_WR_IDX_ADDR_HI
  4110. * Bits 31:0
  4111. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4112. * Higher 4 bytes of DDR address where WIFI FW
  4113. * updates the Write Index for WDI_IPA TX completion ring
  4114. * - TX_CE_WR_IDX_ADDR_LO
  4115. * Bits 31:0
  4116. * Purpose: Lower 4 bytes of DDR address where IPA uC
  4117. * updates the WR Index for TX CE ring
  4118. * (needed for fusion platforms)
  4119. * - TX_CE_WR_IDX_ADDR_HI
  4120. * Bits 31:0
  4121. * Purpose: Higher 4 bytes of DDR address where IPA uC
  4122. * updates the WR Index for TX CE ring
  4123. * (needed for fusion platforms)
  4124. * - RX_IND_RING_BASE_ADDR_LO
  4125. * Bits 31:0
  4126. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  4127. * - RX_IND_RING_BASE_ADDR_HI
  4128. * Bits 31:0
  4129. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  4130. * - RX_IND_RING_SIZE
  4131. * Bits 31:0
  4132. * Purpose: RX Indication Ring size
  4133. * - RX_IND_RD_IDX_ADDR_LO
  4134. * Bits 31:0
  4135. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  4136. * for WDI_IPA RX indication ring
  4137. * - RX_IND_RD_IDX_ADDR_HI
  4138. * Bits 31:0
  4139. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4140. * for WDI_IPA RX indication ring
  4141. * - RX_IND_WR_IDX_ADDR_LO
  4142. * Bits 31:0
  4143. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4144. * Lower 4 bytes of DDR address where WIFI FW
  4145. * updates the Write Index for WDI_IPA RX indication ring
  4146. * - RX_IND_WR_IDX_ADDR_HI
  4147. * Bits 31:0
  4148. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4149. * Higher 4 bytes of DDR address where WIFI FW
  4150. * updates the Write Index for WDI_IPA RX indication ring
  4151. * - RX_RING2_BASE_ADDR_LO
  4152. * Bits 31:0
  4153. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4154. * - RX_RING2_BASE_ADDR_HI
  4155. * Bits 31:0
  4156. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4157. * - RX_RING2_SIZE
  4158. * Bits 31:0
  4159. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4160. * - RX_RING2_RD_IDX_ADDR_LO
  4161. * Bits 31:0
  4162. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4163. * DDR address where IPA uC updates the Read Index for Ring2.
  4164. * If Second RX ring is completion ring, this is NOT used
  4165. * - RX_RING2_RD_IDX_ADDR_HI
  4166. * Bits 31:0
  4167. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4168. * DDR address where IPA uC updates the Read Index for Ring2.
  4169. * If Second RX ring is completion ring, this is NOT used
  4170. * - RX_RING2_WR_IDX_ADDR_LO
  4171. * Bits 31:0
  4172. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4173. * DDR address where WIFI FW updates the Write Index
  4174. * for WDI_IPA RX ring2
  4175. * If second RX ring is completion ring, lower 4 bytes of
  4176. * DDR address where IPA uC updates the Write Index for Ring 2.
  4177. * - RX_RING2_WR_IDX_ADDR_HI
  4178. * Bits 31:0
  4179. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4180. * DDR address where WIFI FW updates the Write Index
  4181. * for WDI_IPA RX ring2
  4182. * If second RX ring is completion ring, higher 4 bytes of
  4183. * DDR address where IPA uC updates the Write Index for Ring 2.
  4184. */
  4185. #if HTT_PADDR64
  4186. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4187. #else
  4188. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4189. #endif
  4190. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4191. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4192. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4193. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4194. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4195. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4196. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4197. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4198. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4199. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4200. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4201. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4202. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4203. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4204. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4205. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4206. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4207. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4208. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4209. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4210. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4211. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4216. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4221. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4223. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4226. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4227. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4228. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4229. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4230. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4231. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4232. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4233. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4234. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4235. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4236. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4237. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4238. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4239. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4240. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4241. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4242. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4243. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4245. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4246. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4247. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4248. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4250. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4252. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4253. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4254. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4255. do { \
  4256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4258. } while (0)
  4259. /* for systems using 32-bit format for bus addr */
  4260. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4261. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4262. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4263. do { \
  4264. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4265. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4266. } while (0)
  4267. /* for systems using 64-bit format for bus addr */
  4268. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4269. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4270. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4273. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4274. } while (0)
  4275. /* for systems using 64-bit format for bus addr */
  4276. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4277. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4278. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4281. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4282. } while (0)
  4283. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4285. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4289. } while (0)
  4290. /* for systems using 32-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4293. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4297. } while (0)
  4298. /* for systems using 64-bit format for bus addr */
  4299. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4300. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4301. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4304. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4305. } while (0)
  4306. /* for systems using 64-bit format for bus addr */
  4307. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4308. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4309. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4312. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4313. } while (0)
  4314. /* for systems using 32-bit format for bus addr */
  4315. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4316. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4317. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4318. do { \
  4319. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4320. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4321. } while (0)
  4322. /* for systems using 64-bit format for bus addr */
  4323. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4324. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4325. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4329. } while (0)
  4330. /* for systems using 64-bit format for bus addr */
  4331. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4332. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4333. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4336. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4337. } while (0)
  4338. /* for systems using 32-bit format for bus addr */
  4339. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4340. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4341. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4342. do { \
  4343. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4344. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4345. } while (0)
  4346. /* for systems using 64-bit format for bus addr */
  4347. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4348. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4349. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4350. do { \
  4351. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4352. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4353. } while (0)
  4354. /* for systems using 64-bit format for bus addr */
  4355. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4356. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4357. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4358. do { \
  4359. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4360. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4361. } while (0)
  4362. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4363. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4364. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4367. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4368. } while (0)
  4369. /* for systems using 32-bit format for bus addr */
  4370. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4371. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4372. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4375. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4376. } while (0)
  4377. /* for systems using 64-bit format for bus addr */
  4378. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4379. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4380. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4381. do { \
  4382. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4383. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4384. } while (0)
  4385. /* for systems using 64-bit format for bus addr */
  4386. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4387. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4388. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4389. do { \
  4390. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4391. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4392. } while (0)
  4393. /* for systems using 32-bit format for bus addr */
  4394. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4395. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4396. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4399. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4400. } while (0)
  4401. /* for systems using 64-bit format for bus addr */
  4402. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4403. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4404. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4405. do { \
  4406. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4407. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4408. } while (0)
  4409. /* for systems using 64-bit format for bus addr */
  4410. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4411. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4412. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4413. do { \
  4414. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4415. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4416. } while (0)
  4417. /* for systems using 32-bit format for bus addr */
  4418. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4419. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4420. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4421. do { \
  4422. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4423. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4424. } while (0)
  4425. /* for systems using 64-bit format for bus addr */
  4426. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4427. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4428. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4429. do { \
  4430. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4431. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4432. } while (0)
  4433. /* for systems using 64-bit format for bus addr */
  4434. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4435. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4436. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4437. do { \
  4438. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4439. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4440. } while (0)
  4441. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4442. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4443. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4444. do { \
  4445. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4446. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4447. } while (0)
  4448. /* for systems using 32-bit format for bus addr */
  4449. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4450. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4451. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4452. do { \
  4453. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4454. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4455. } while (0)
  4456. /* for systems using 64-bit format for bus addr */
  4457. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4458. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4459. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4460. do { \
  4461. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4462. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4463. } while (0)
  4464. /* for systems using 64-bit format for bus addr */
  4465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4466. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4468. do { \
  4469. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4470. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4471. } while (0)
  4472. /* for systems using 32-bit format for bus addr */
  4473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4474. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4476. do { \
  4477. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4478. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4479. } while (0)
  4480. /* for systems using 64-bit format for bus addr */
  4481. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4482. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4483. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4484. do { \
  4485. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4486. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4487. } while (0)
  4488. /* for systems using 64-bit format for bus addr */
  4489. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4490. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4491. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4494. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4495. } while (0)
  4496. /*
  4497. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4498. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4499. * addresses are stored in a XXX-bit field.
  4500. * This macro is used to define both htt_wdi_ipa_config32_t and
  4501. * htt_wdi_ipa_config64_t structs.
  4502. */
  4503. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4504. _paddr__tx_comp_ring_base_addr_, \
  4505. _paddr__tx_comp_wr_idx_addr_, \
  4506. _paddr__tx_ce_wr_idx_addr_, \
  4507. _paddr__rx_ind_ring_base_addr_, \
  4508. _paddr__rx_ind_rd_idx_addr_, \
  4509. _paddr__rx_ind_wr_idx_addr_, \
  4510. _paddr__rx_ring2_base_addr_,\
  4511. _paddr__rx_ring2_rd_idx_addr_,\
  4512. _paddr__rx_ring2_wr_idx_addr_) \
  4513. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4514. { \
  4515. /* DWORD 0: flags and meta-data */ \
  4516. A_UINT32 \
  4517. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4518. reserved: 8, \
  4519. tx_pkt_pool_size: 16;\
  4520. /* DWORD 1 */\
  4521. _paddr__tx_comp_ring_base_addr_;\
  4522. /* DWORD 2 (or 3)*/\
  4523. A_UINT32 tx_comp_ring_size;\
  4524. /* DWORD 3 (or 4)*/\
  4525. _paddr__tx_comp_wr_idx_addr_;\
  4526. /* DWORD 4 (or 6)*/\
  4527. _paddr__tx_ce_wr_idx_addr_;\
  4528. /* DWORD 5 (or 8)*/\
  4529. _paddr__rx_ind_ring_base_addr_;\
  4530. /* DWORD 6 (or 10)*/\
  4531. A_UINT32 rx_ind_ring_size;\
  4532. /* DWORD 7 (or 11)*/\
  4533. _paddr__rx_ind_rd_idx_addr_;\
  4534. /* DWORD 8 (or 13)*/\
  4535. _paddr__rx_ind_wr_idx_addr_;\
  4536. /* DWORD 9 (or 15)*/\
  4537. _paddr__rx_ring2_base_addr_;\
  4538. /* DWORD 10 (or 17) */\
  4539. A_UINT32 rx_ring2_size;\
  4540. /* DWORD 11 (or 18) */\
  4541. _paddr__rx_ring2_rd_idx_addr_;\
  4542. /* DWORD 12 (or 20) */\
  4543. _paddr__rx_ring2_wr_idx_addr_;\
  4544. } POSTPACK
  4545. /* define a htt_wdi_ipa_config32_t type */
  4546. 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));
  4547. /* define a htt_wdi_ipa_config64_t type */
  4548. 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));
  4549. #if HTT_PADDR64
  4550. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4551. #else
  4552. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4553. #endif
  4554. enum htt_wdi_ipa_op_code {
  4555. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4556. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4557. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4558. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4559. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4560. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4561. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4562. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4563. /* keep this last */
  4564. HTT_WDI_IPA_OPCODE_MAX
  4565. };
  4566. /**
  4567. * @brief HTT WDI_IPA Operation Request Message
  4568. *
  4569. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4570. *
  4571. * @details
  4572. * HTT WDI_IPA Operation Request message is sent by host
  4573. * to either suspend or resume WDI_IPA TX or RX path.
  4574. * |31 24|23 16|15 8|7 0|
  4575. * |----------------+----------------+----------------+----------------|
  4576. * | op_code | Rsvd | msg_type |
  4577. * |-------------------------------------------------------------------|
  4578. *
  4579. * Header fields:
  4580. * - MSG_TYPE
  4581. * Bits 7:0
  4582. * Purpose: Identifies this as WDI_IPA Operation Request message
  4583. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4584. * - OP_CODE
  4585. * Bits 31:16
  4586. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4587. * value: = enum htt_wdi_ipa_op_code
  4588. */
  4589. PREPACK struct htt_wdi_ipa_op_request_t
  4590. {
  4591. /* DWORD 0: flags and meta-data */
  4592. A_UINT32
  4593. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4594. reserved: 8,
  4595. op_code: 16;
  4596. } POSTPACK;
  4597. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4598. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4599. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4600. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4601. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4602. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4603. do { \
  4604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4605. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4606. } while (0)
  4607. /*
  4608. * @brief host -> target HTT_MSI_SETUP message
  4609. *
  4610. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4611. *
  4612. * @details
  4613. * After target is booted up, host can send MSI setup message so that
  4614. * target sets up HW registers based on setup message.
  4615. *
  4616. * The message would appear as follows:
  4617. * |31 24|23 16|15|14 8|7 0|
  4618. * |---------------+-----------------+-----------------+-----------------|
  4619. * | reserved | msi_type | pdev_id | msg_type |
  4620. * |---------------------------------------------------------------------|
  4621. * | msi_addr_lo |
  4622. * |---------------------------------------------------------------------|
  4623. * | msi_addr_hi |
  4624. * |---------------------------------------------------------------------|
  4625. * | msi_data |
  4626. * |---------------------------------------------------------------------|
  4627. *
  4628. * The message is interpreted as follows:
  4629. * dword0 - b'0:7 - msg_type: This will be set to
  4630. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4631. * b'8:15 - pdev_id:
  4632. * 0 (for rings at SOC/UMAC level),
  4633. * 1/2/3 mac id (for rings at LMAC level)
  4634. * b'16:23 - msi_type: identify which msi registers need to be setup
  4635. * more details can be got from enum htt_msi_setup_type
  4636. * b'24:31 - reserved
  4637. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4638. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4639. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4640. */
  4641. PREPACK struct htt_msi_setup_t {
  4642. A_UINT32 msg_type: 8,
  4643. pdev_id: 8,
  4644. msi_type: 8,
  4645. reserved: 8;
  4646. A_UINT32 msi_addr_lo;
  4647. A_UINT32 msi_addr_hi;
  4648. A_UINT32 msi_data;
  4649. } POSTPACK;
  4650. enum htt_msi_setup_type {
  4651. HTT_PPDU_END_MSI_SETUP_TYPE,
  4652. /* Insert new types here*/
  4653. };
  4654. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4655. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4656. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4657. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4658. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4659. HTT_MSI_SETUP_PDEV_ID_S)
  4660. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4661. do { \
  4662. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4663. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4664. } while (0)
  4665. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4666. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4667. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4668. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4669. HTT_MSI_SETUP_MSI_TYPE_S)
  4670. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4671. do { \
  4672. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4673. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4674. } while (0)
  4675. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4676. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4677. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4678. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4679. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4680. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4681. do { \
  4682. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4683. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4684. } while (0)
  4685. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4686. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4687. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4688. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4689. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4690. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4691. do { \
  4692. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4693. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4694. } while (0)
  4695. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4696. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4697. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4698. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4699. HTT_MSI_SETUP_MSI_DATA_S)
  4700. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4701. do { \
  4702. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4703. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4704. } while (0)
  4705. /*
  4706. * @brief host -> target HTT_SRING_SETUP message
  4707. *
  4708. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4709. *
  4710. * @details
  4711. * After target is booted up, Host can send SRING setup message for
  4712. * each host facing LMAC SRING. Target setups up HW registers based
  4713. * on setup message and confirms back to Host if response_required is set.
  4714. * Host should wait for confirmation message before sending new SRING
  4715. * setup message
  4716. *
  4717. * The message would appear as follows:
  4718. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4719. * |--------------- +-----------------+-----------------+-----------------|
  4720. * | ring_type | ring_id | pdev_id | msg_type |
  4721. * |----------------------------------------------------------------------|
  4722. * | ring_base_addr_lo |
  4723. * |----------------------------------------------------------------------|
  4724. * | ring_base_addr_hi |
  4725. * |----------------------------------------------------------------------|
  4726. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4727. * |----------------------------------------------------------------------|
  4728. * | ring_head_offset32_remote_addr_lo |
  4729. * |----------------------------------------------------------------------|
  4730. * | ring_head_offset32_remote_addr_hi |
  4731. * |----------------------------------------------------------------------|
  4732. * | ring_tail_offset32_remote_addr_lo |
  4733. * |----------------------------------------------------------------------|
  4734. * | ring_tail_offset32_remote_addr_hi |
  4735. * |----------------------------------------------------------------------|
  4736. * | ring_msi_addr_lo |
  4737. * |----------------------------------------------------------------------|
  4738. * | ring_msi_addr_hi |
  4739. * |----------------------------------------------------------------------|
  4740. * | ring_msi_data |
  4741. * |----------------------------------------------------------------------|
  4742. * | intr_timer_th |IM| intr_batch_counter_th |
  4743. * |----------------------------------------------------------------------|
  4744. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4745. * |----------------------------------------------------------------------|
  4746. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4747. * |----------------------------------------------------------------------|
  4748. * Where
  4749. * IM = sw_intr_mode
  4750. * RR = response_required
  4751. * PTCF = prefetch_timer_cfg
  4752. * IP = IPA drop flag
  4753. *
  4754. * The message is interpreted as follows:
  4755. * dword0 - b'0:7 - msg_type: This will be set to
  4756. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4757. * b'8:15 - pdev_id:
  4758. * 0 (for rings at SOC/UMAC level),
  4759. * 1/2/3 mac id (for rings at LMAC level)
  4760. * b'16:23 - ring_id: identify which ring is to setup,
  4761. * more details can be got from enum htt_srng_ring_id
  4762. * b'24:31 - ring_type: identify type of host rings,
  4763. * more details can be got from enum htt_srng_ring_type
  4764. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4765. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4766. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4767. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4768. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4769. * SW_TO_HW_RING.
  4770. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4771. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4772. * Lower 32 bits of memory address of the remote variable
  4773. * storing the 4-byte word offset that identifies the head
  4774. * element within the ring.
  4775. * (The head offset variable has type A_UINT32.)
  4776. * Valid for HW_TO_SW and SW_TO_SW rings.
  4777. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4778. * Upper 32 bits of memory address of the remote variable
  4779. * storing the 4-byte word offset that identifies the head
  4780. * element within the ring.
  4781. * (The head offset variable has type A_UINT32.)
  4782. * Valid for HW_TO_SW and SW_TO_SW rings.
  4783. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4784. * Lower 32 bits of memory address of the remote variable
  4785. * storing the 4-byte word offset that identifies the tail
  4786. * element within the ring.
  4787. * (The tail offset variable has type A_UINT32.)
  4788. * Valid for HW_TO_SW and SW_TO_SW rings.
  4789. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4790. * Upper 32 bits of memory address of the remote variable
  4791. * storing the 4-byte word offset that identifies the tail
  4792. * element within the ring.
  4793. * (The tail offset variable has type A_UINT32.)
  4794. * Valid for HW_TO_SW and SW_TO_SW rings.
  4795. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4796. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4797. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4798. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4799. * dword10 - b'0:31 - ring_msi_data: MSI data
  4800. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4801. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4802. * dword11 - b'0:14 - intr_batch_counter_th:
  4803. * batch counter threshold is in units of 4-byte words.
  4804. * HW internally maintains and increments batch count.
  4805. * (see SRING spec for detail description).
  4806. * When batch count reaches threshold value, an interrupt
  4807. * is generated by HW.
  4808. * b'15 - sw_intr_mode:
  4809. * This configuration shall be static.
  4810. * Only programmed at power up.
  4811. * 0: generate pulse style sw interrupts
  4812. * 1: generate level style sw interrupts
  4813. * b'16:31 - intr_timer_th:
  4814. * The timer init value when timer is idle or is
  4815. * initialized to start downcounting.
  4816. * In 8us units (to cover a range of 0 to 524 ms)
  4817. * dword12 - b'0:15 - intr_low_threshold:
  4818. * Used only by Consumer ring to generate ring_sw_int_p.
  4819. * Ring entries low threshold water mark, that is used
  4820. * in combination with the interrupt timer as well as
  4821. * the the clearing of the level interrupt.
  4822. * b'16:18 - prefetch_timer_cfg:
  4823. * Used only by Consumer ring to set timer mode to
  4824. * support Application prefetch handling.
  4825. * The external tail offset/pointer will be updated
  4826. * at following intervals:
  4827. * 3'b000: (Prefetch feature disabled; used only for debug)
  4828. * 3'b001: 1 usec
  4829. * 3'b010: 4 usec
  4830. * 3'b011: 8 usec (default)
  4831. * 3'b100: 16 usec
  4832. * Others: Reserved
  4833. * b'19 - response_required:
  4834. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4835. * b'20 - ipa_drop_flag:
  4836. Indicates that host will config ipa drop threshold percentage
  4837. * b'21:31 - reserved: reserved for future use
  4838. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4839. * b'8:15 - ipa drop high threshold percentage:
  4840. * b'16:31 - Reserved
  4841. */
  4842. PREPACK struct htt_sring_setup_t {
  4843. A_UINT32 msg_type: 8,
  4844. pdev_id: 8,
  4845. ring_id: 8,
  4846. ring_type: 8;
  4847. A_UINT32 ring_base_addr_lo;
  4848. A_UINT32 ring_base_addr_hi;
  4849. A_UINT32 ring_size: 16,
  4850. ring_entry_size: 8,
  4851. ring_misc_cfg_flag: 8;
  4852. A_UINT32 ring_head_offset32_remote_addr_lo;
  4853. A_UINT32 ring_head_offset32_remote_addr_hi;
  4854. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4855. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4856. A_UINT32 ring_msi_addr_lo;
  4857. A_UINT32 ring_msi_addr_hi;
  4858. A_UINT32 ring_msi_data;
  4859. A_UINT32 intr_batch_counter_th: 15,
  4860. sw_intr_mode: 1,
  4861. intr_timer_th: 16;
  4862. A_UINT32 intr_low_threshold: 16,
  4863. prefetch_timer_cfg: 3,
  4864. response_required: 1,
  4865. ipa_drop_flag: 1,
  4866. reserved1: 11;
  4867. A_UINT32 ipa_drop_low_threshold: 8,
  4868. ipa_drop_high_threshold: 8,
  4869. reserved: 16;
  4870. } POSTPACK;
  4871. enum htt_srng_ring_type {
  4872. HTT_HW_TO_SW_RING = 0,
  4873. HTT_SW_TO_HW_RING,
  4874. HTT_SW_TO_SW_RING,
  4875. /* Insert new ring types above this line */
  4876. };
  4877. enum htt_srng_ring_id {
  4878. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4879. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4880. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4881. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4882. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4883. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4884. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4885. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4886. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4887. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4888. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4889. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4890. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4891. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4892. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4893. /* Add Other SRING which can't be directly configured by host software above this line */
  4894. };
  4895. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4896. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4897. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4898. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4899. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4900. HTT_SRING_SETUP_PDEV_ID_S)
  4901. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4904. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4905. } while (0)
  4906. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4907. #define HTT_SRING_SETUP_RING_ID_S 16
  4908. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4909. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4910. HTT_SRING_SETUP_RING_ID_S)
  4911. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4914. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4915. } while (0)
  4916. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4917. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4918. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4919. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4920. HTT_SRING_SETUP_RING_TYPE_S)
  4921. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4922. do { \
  4923. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4924. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4925. } while (0)
  4926. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4927. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4928. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4929. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4930. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4931. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4932. do { \
  4933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4934. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4935. } while (0)
  4936. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4937. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4938. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4939. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4940. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4941. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4942. do { \
  4943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4944. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4945. } while (0)
  4946. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4947. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4948. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4949. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4950. HTT_SRING_SETUP_RING_SIZE_S)
  4951. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4952. do { \
  4953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4954. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4955. } while (0)
  4956. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4957. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4958. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4959. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4960. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4961. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4962. do { \
  4963. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4964. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4965. } while (0)
  4966. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4967. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4968. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4969. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4970. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4971. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4972. do { \
  4973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4974. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4975. } while (0)
  4976. /* This control bit is applicable to only Producer, which updates Ring ID field
  4977. * of each descriptor before pushing into the ring.
  4978. * 0: updates ring_id(default)
  4979. * 1: ring_id updating disabled */
  4980. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4981. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4982. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4983. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4984. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4985. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4986. do { \
  4987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4988. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4989. } while (0)
  4990. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4991. * of each descriptor before pushing into the ring.
  4992. * 0: updates Loopcnt(default)
  4993. * 1: Loopcnt updating disabled */
  4994. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4995. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4996. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4997. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4998. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4999. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  5002. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  5003. } while (0)
  5004. /* Secured access enable/disable bit. SRNG drives value of this register bit
  5005. * into security_id port of GXI/AXI. */
  5006. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  5007. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  5008. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  5009. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  5010. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  5011. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  5012. do { \
  5013. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  5014. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  5015. } while (0)
  5016. /* During MSI write operation, SRNG drives value of this register bit into
  5017. * swap bit of GXI/AXI. */
  5018. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  5019. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  5020. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  5021. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  5022. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  5023. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  5024. do { \
  5025. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  5026. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  5027. } while (0)
  5028. /* During Pointer write operation, SRNG drives value of this register bit into
  5029. * swap bit of GXI/AXI. */
  5030. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  5031. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  5032. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  5033. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  5034. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  5035. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  5036. do { \
  5037. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  5038. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  5039. } while (0)
  5040. /* During any data or TLV write operation, SRNG drives value of this register
  5041. * bit into swap bit of GXI/AXI. */
  5042. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  5043. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  5044. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  5045. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  5046. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  5047. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  5048. do { \
  5049. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  5050. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  5051. } while (0)
  5052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  5053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  5054. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  5055. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  5056. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  5057. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  5058. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  5059. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  5060. do { \
  5061. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  5062. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  5063. } while (0)
  5064. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  5065. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  5066. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  5067. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  5068. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  5069. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  5070. do { \
  5071. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  5072. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  5073. } while (0)
  5074. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  5075. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  5076. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  5077. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  5078. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  5079. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  5080. do { \
  5081. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  5082. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  5083. } while (0)
  5084. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  5085. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  5086. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  5087. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  5088. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  5089. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  5090. do { \
  5091. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  5092. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  5093. } while (0)
  5094. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  5095. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  5096. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  5097. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  5098. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  5099. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  5100. do { \
  5101. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  5102. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  5103. } while (0)
  5104. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  5105. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  5106. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  5107. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  5108. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  5109. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  5110. do { \
  5111. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  5112. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  5113. } while (0)
  5114. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  5115. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  5116. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  5117. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  5118. HTT_SRING_SETUP_RING_MSI_DATA_S)
  5119. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  5120. do { \
  5121. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  5122. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  5123. } while (0)
  5124. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  5125. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  5126. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  5127. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  5128. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  5129. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  5130. do { \
  5131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  5132. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  5133. } while (0)
  5134. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  5135. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  5136. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5137. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5138. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5139. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5140. do { \
  5141. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5142. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5143. } while (0)
  5144. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5145. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5146. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5147. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5148. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5149. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5150. do { \
  5151. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5152. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5153. } while (0)
  5154. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5155. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5156. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5157. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5158. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5159. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5160. do { \
  5161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5162. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5163. } while (0)
  5164. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5165. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5166. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5167. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5168. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5169. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5170. do { \
  5171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5172. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5173. } while (0)
  5174. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5175. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5176. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5177. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5178. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5179. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5180. do { \
  5181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5182. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5183. } while (0)
  5184. /**
  5185. * @brief host -> target RX ring selection config message
  5186. *
  5187. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5188. *
  5189. * @details
  5190. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5191. * configure RXDMA rings.
  5192. * The configuration is per ring based and includes both packet subtypes
  5193. * and PPDU/MPDU TLVs.
  5194. *
  5195. * The message would appear as follows:
  5196. *
  5197. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5198. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5199. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5200. * |-----------------------+-----+-----+--------------------------------|
  5201. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5202. * |--------------------------------------------------------------------|
  5203. * | packet_type_enable_flags_0 |
  5204. * |--------------------------------------------------------------------|
  5205. * | packet_type_enable_flags_1 |
  5206. * |--------------------------------------------------------------------|
  5207. * | packet_type_enable_flags_2 |
  5208. * |--------------------------------------------------------------------|
  5209. * | packet_type_enable_flags_3 |
  5210. * |--------------------------------------------------------------------|
  5211. * | tlv_filter_in_flags |
  5212. * |-----------------------------------+--------------------------------|
  5213. * | rx_header_offset | rx_packet_offset |
  5214. * |-----------------------------------+--------------------------------|
  5215. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5216. * |-----------------------------------+--------------------------------|
  5217. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5218. * |-----------------------------------+--------------------------------|
  5219. * | rsvd3 | rx_attention_offset |
  5220. * |--------------------------------------------------------------------|
  5221. * | rsvd4 | mo| fp| rx_drop_threshold |
  5222. * | |ndp|ndp| |
  5223. * |--------------------------------------------------------------------|
  5224. * Where:
  5225. * PS = pkt_swap
  5226. * SS = status_swap
  5227. * OV = rx_offsets_valid
  5228. * DT = drop_thresh_valid
  5229. * CLM = config_length_mgmt
  5230. * CLC = config_length_ctrl
  5231. * CLD = config_length_data
  5232. * RXHDL = rx_hdr_len
  5233. * RX = rxpcu_filter_enable_flag
  5234. * The message is interpreted as follows:
  5235. * dword0 - b'0:7 - msg_type: This will be set to
  5236. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5237. * b'8:15 - pdev_id:
  5238. * 0 (for rings at SOC/UMAC level),
  5239. * 1/2/3 mac id (for rings at LMAC level)
  5240. * b'16:23 - ring_id : Identify the ring to configure.
  5241. * More details can be got from enum htt_srng_ring_id
  5242. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5243. * BUF_RING_CFG_0 defs within HW .h files,
  5244. * e.g. wmac_top_reg_seq_hwioreg.h
  5245. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5246. * BUF_RING_CFG_0 defs within HW .h files,
  5247. * e.g. wmac_top_reg_seq_hwioreg.h
  5248. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5249. * configuration fields are valid
  5250. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5251. * rx_drop_threshold field is valid
  5252. * b'28 - rx_mon_global_en: Enable/Disable global register
  5253. 8 configuration in Rx monitor module.
  5254. * b'29:31 - rsvd1: reserved for future use
  5255. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5256. * in byte units.
  5257. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5258. * b'16:18 - config_length_mgmt (MGMT):
  5259. * Represents the length of mpdu bytes for mgmt pkt.
  5260. * valid values:
  5261. * 001 - 64bytes
  5262. * 010 - 128bytes
  5263. * 100 - 256bytes
  5264. * 111 - Full mpdu bytes
  5265. * b'19:21 - config_length_ctrl (CTRL):
  5266. * Represents the length of mpdu bytes for ctrl pkt.
  5267. * valid values:
  5268. * 001 - 64bytes
  5269. * 010 - 128bytes
  5270. * 100 - 256bytes
  5271. * 111 - Full mpdu bytes
  5272. * b'22:24 - config_length_data (DATA):
  5273. * Represents the length of mpdu bytes for data pkt.
  5274. * valid values:
  5275. * 001 - 64bytes
  5276. * 010 - 128bytes
  5277. * 100 - 256bytes
  5278. * 111 - Full mpdu bytes
  5279. * b'25:26 - rx_hdr_len:
  5280. * Specifies the number of bytes of recvd packet to copy
  5281. * into the rx_hdr tlv.
  5282. * supported values for now by host:
  5283. * 01 - 64bytes
  5284. * 10 - 128bytes
  5285. * 11 - 256bytes
  5286. * default - 128 bytes
  5287. * b'27 - rxpcu_filter_enable_flag
  5288. * For Scan Radio Host CPU utilization is very high.
  5289. * In order to reduce CPU utilization we need to filter out
  5290. * certain configured MAC frames.
  5291. * To filter out configured MAC address frames, RxPCU should
  5292. * be zero which means allow all frames for MD at RxOLE
  5293. * host wil fiter out frames.
  5294. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5295. * b'28:31 - rsvd2: Reserved for future use
  5296. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5297. * Enable MGMT packet from 0b0000 to 0b1001
  5298. * bits from low to high: FP, MD, MO - 3 bits
  5299. * FP: Filter_Pass
  5300. * MD: Monitor_Direct
  5301. * MO: Monitor_Other
  5302. * 10 mgmt subtypes * 3 bits -> 30 bits
  5303. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5304. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5305. * Enable MGMT packet from 0b1010 to 0b1111
  5306. * bits from low to high: FP, MD, MO - 3 bits
  5307. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5308. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5309. * Enable CTRL packet from 0b0000 to 0b1001
  5310. * bits from low to high: FP, MD, MO - 3 bits
  5311. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5312. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5313. * Enable CTRL packet from 0b1010 to 0b1111,
  5314. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5315. * bits from low to high: FP, MD, MO - 3 bits
  5316. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5317. * dword6 - b'0:31 - tlv_filter_in_flags:
  5318. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5319. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5320. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5321. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5322. * A value of 0 will be considered as ignore this config.
  5323. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5324. * e.g. wmac_top_reg_seq_hwioreg.h
  5325. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5326. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5327. * A value of 0 will be considered as ignore this config.
  5328. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5329. * e.g. wmac_top_reg_seq_hwioreg.h
  5330. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5331. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5332. * A value of 0 will be considered as ignore this config.
  5333. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5334. * e.g. wmac_top_reg_seq_hwioreg.h
  5335. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5336. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5337. * A value of 0 will be considered as ignore this config.
  5338. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5339. * e.g. wmac_top_reg_seq_hwioreg.h
  5340. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5341. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5342. * A value of 0 will be considered as ignore this config.
  5343. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5344. * e.g. wmac_top_reg_seq_hwioreg.h
  5345. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5346. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5347. * A value of 0 will be considered as ignore this config.
  5348. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5349. * e.g. wmac_top_reg_seq_hwioreg.h
  5350. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5351. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5352. * A value of 0 will be considered as ignore this config.
  5353. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5354. * e.g. wmac_top_reg_seq_hwioreg.h
  5355. * - b'16:31 - rsvd3 for future use
  5356. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5357. * to source rings. Consumer drops packets if the available
  5358. * words in the ring falls below the configured threshold
  5359. * value.
  5360. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5361. * by host. 1 -> subscribed
  5362. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5363. * by host. 1 -> subscribed
  5364. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5365. * subscribed by host. 1 -> subscribed
  5366. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5367. * selection for the FP PHY ERR status tlv.
  5368. * 0 - wbm2rxdma_buf_source_ring
  5369. * 1 - fw2rxdma_buf_source_ring
  5370. * 2 - sw2rxdma_buf_source_ring
  5371. * 3 - no_buffer_ring
  5372. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5373. * selection for the FP PHY ERR status tlv.
  5374. * 0 - rxdma_release_ring
  5375. * 1 - rxdma2fw_ring
  5376. * 2 - rxdma2sw_ring
  5377. * 3 - rxdma2reo_ring
  5378. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5379. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5380. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5381. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5382. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5383. * 0: MSDU level logging
  5384. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5385. * 0: MSDU level logging
  5386. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5387. * 0: MSDU level logging
  5388. * - b'23 - word_mask_compaction: enable/disable word mask for
  5389. * mpdu/msdu start/end tlvs
  5390. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5391. * manager override
  5392. * - b'25:28 - rbm_override_val: return buffer manager override value
  5393. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5394. * which have to be posted to host from phy.
  5395. * Corresponding to errors defined in
  5396. * phyrx_abort_request_reason enums 0 to 31.
  5397. * Refer to RXPCU register definition header files for the
  5398. * phyrx_abort_request_reason enum definition.
  5399. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5400. * errors which have to be posted to host from phy.
  5401. * Corresponding to errors defined in
  5402. * phyrx_abort_request_reason enums 32 to 63.
  5403. * Refer to RXPCU register definition header files for the
  5404. * phyrx_abort_request_reason enum definition.
  5405. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5406. * applicable if word mask enabled
  5407. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5408. * applicable if word mask enabled
  5409. * - b'19:31 - rsvd7
  5410. * dword15- b'0:16 - rx_msdu_end_word_mask
  5411. * - b'17:31 - rsvd5
  5412. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5413. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5414. * buffer
  5415. * 1: RX_PKT TLV logging at specified offset for the
  5416. * subsequent buffer
  5417. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5418. */
  5419. PREPACK struct htt_rx_ring_selection_cfg_t {
  5420. A_UINT32 msg_type: 8,
  5421. pdev_id: 8,
  5422. ring_id: 8,
  5423. status_swap: 1,
  5424. pkt_swap: 1,
  5425. rx_offsets_valid: 1,
  5426. drop_thresh_valid: 1,
  5427. rx_mon_global_en: 1,
  5428. rsvd1: 3;
  5429. A_UINT32 ring_buffer_size: 16,
  5430. config_length_mgmt:3,
  5431. config_length_ctrl:3,
  5432. config_length_data:3,
  5433. rx_hdr_len: 2,
  5434. rxpcu_filter_enable_flag:1,
  5435. rsvd2: 4;
  5436. A_UINT32 packet_type_enable_flags_0;
  5437. A_UINT32 packet_type_enable_flags_1;
  5438. A_UINT32 packet_type_enable_flags_2;
  5439. A_UINT32 packet_type_enable_flags_3;
  5440. A_UINT32 tlv_filter_in_flags;
  5441. A_UINT32 rx_packet_offset: 16,
  5442. rx_header_offset: 16;
  5443. A_UINT32 rx_mpdu_end_offset: 16,
  5444. rx_mpdu_start_offset: 16;
  5445. A_UINT32 rx_msdu_end_offset: 16,
  5446. rx_msdu_start_offset: 16;
  5447. A_UINT32 rx_attn_offset: 16,
  5448. rsvd3: 16;
  5449. A_UINT32 rx_drop_threshold: 10,
  5450. fp_ndp: 1,
  5451. mo_ndp: 1,
  5452. fp_phy_err: 1,
  5453. fp_phy_err_buf_src: 2,
  5454. fp_phy_err_buf_dest: 2,
  5455. pkt_type_enable_msdu_or_mpdu_logging:3,
  5456. dma_mpdu_mgmt: 1,
  5457. dma_mpdu_ctrl: 1,
  5458. dma_mpdu_data: 1,
  5459. word_mask_compaction_enable:1,
  5460. rbm_override_enable: 1,
  5461. rbm_override_val: 4,
  5462. rsvd4: 3;
  5463. A_UINT32 phy_err_mask;
  5464. A_UINT32 phy_err_mask_cont;
  5465. A_UINT32 rx_mpdu_start_word_mask:16,
  5466. rx_mpdu_end_word_mask: 3,
  5467. rsvd7: 13;
  5468. A_UINT32 rx_msdu_end_word_mask: 17,
  5469. rsvd5: 15;
  5470. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5471. rx_pkt_tlv_offset: 15,
  5472. rsvd6: 16;
  5473. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5474. rx_mpdu_end_word_mask_v2: 8,
  5475. rsvd8: 4;
  5476. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5477. rsvd9: 12;
  5478. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5479. rsvd10: 12;
  5480. A_UINT32 packet_type_enable_fpmo_flags0;
  5481. A_UINT32 packet_type_enable_fpmo_flags1;
  5482. } POSTPACK;
  5483. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5484. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5485. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5486. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5487. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5488. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5489. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5493. } while (0)
  5494. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5495. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5496. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5497. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5498. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5499. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5502. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5503. } while (0)
  5504. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5505. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5506. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5507. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5508. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5509. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5513. } while (0)
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5515. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5516. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5517. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5518. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5519. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5523. } while (0)
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5527. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5528. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5533. } while (0)
  5534. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5535. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5536. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5537. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5538. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5539. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5542. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5543. } while (0)
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5547. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5548. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5552. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5553. } while (0)
  5554. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5555. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5556. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5557. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5558. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5559. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5562. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5563. } while (0)
  5564. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5565. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5566. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5567. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5568. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5569. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5573. } while (0)
  5574. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5575. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5576. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5577. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5578. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5579. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5583. } while (0)
  5584. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5585. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5586. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5587. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5588. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5589. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5592. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5593. } while (0)
  5594. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5595. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5596. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5597. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5598. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5603. } while(0)
  5604. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5605. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5606. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5607. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5608. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5609. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5610. do { \
  5611. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5612. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5613. } while(0)
  5614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5617. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5618. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5623. } while (0)
  5624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5627. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5628. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5633. } while (0)
  5634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5637. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5638. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5640. do { \
  5641. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5642. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5643. } while (0)
  5644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5647. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5648. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5652. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5653. } while (0)
  5654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5657. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5658. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5659. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5660. do { \
  5661. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5662. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5663. } while (0)
  5664. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5665. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5666. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5667. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5668. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5669. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5672. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5673. } while (0)
  5674. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5675. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5676. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5677. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5678. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5679. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5683. } while (0)
  5684. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5685. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5687. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5688. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5689. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5692. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5693. } while (0)
  5694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5697. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5698. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5702. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5703. } while (0)
  5704. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5705. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5707. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5708. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5709. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5710. do { \
  5711. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5712. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5713. } while (0)
  5714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5717. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5718. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5719. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5720. do { \
  5721. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5722. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5723. } while (0)
  5724. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5725. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5726. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5727. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5728. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5729. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5730. do { \
  5731. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5732. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5733. } while (0)
  5734. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5735. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5737. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5738. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5739. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5742. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5743. } while (0)
  5744. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5745. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5746. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5747. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5748. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5749. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5750. do { \
  5751. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5752. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5753. } while (0)
  5754. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5755. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5756. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5757. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5758. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5759. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5760. do { \
  5761. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5762. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5763. } while (0)
  5764. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5765. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5766. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5767. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5768. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5769. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5770. do { \
  5771. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5772. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5773. } while (0)
  5774. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5775. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5776. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5777. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5778. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5779. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5780. do { \
  5781. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5782. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5783. } while (0)
  5784. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5785. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5786. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5787. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5788. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5789. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5790. do { \
  5791. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5792. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5793. } while (0)
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5797. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5798. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5800. do { \
  5801. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5802. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5803. } while (0)
  5804. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5805. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5806. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5807. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5808. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5809. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5810. do { \
  5811. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5812. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5813. } while (0)
  5814. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5815. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5816. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5817. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5818. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5819. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5820. do { \
  5821. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5822. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5823. } while (0)
  5824. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5825. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5826. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5827. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5828. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5829. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5830. do { \
  5831. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5832. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5833. } while (0)
  5834. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5835. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5836. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5837. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5838. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5839. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5840. do { \
  5841. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5842. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5843. } while (0)
  5844. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5845. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5846. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5847. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5848. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5849. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5850. do { \
  5851. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5852. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5853. } while (0)
  5854. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5855. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5856. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5857. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5858. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5859. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5860. do { \
  5861. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5862. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5863. } while (0)
  5864. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5865. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5866. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5867. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5868. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5869. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5870. do { \
  5871. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5872. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5873. } while (0)
  5874. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5875. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5876. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5877. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5878. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5879. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5880. do { \
  5881. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5882. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5883. } while (0)
  5884. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5885. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5886. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5887. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5888. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5889. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5890. do { \
  5891. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5892. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5893. } while (0)
  5894. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5895. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5896. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5897. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5898. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5899. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5900. do { \
  5901. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5902. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5903. } while (0)
  5904. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5905. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5906. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5907. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5908. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5909. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5910. do { \
  5911. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5912. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5913. } while (0)
  5914. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5915. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5916. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5917. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5918. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5919. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5920. do { \
  5921. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5922. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5923. } while (0)
  5924. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5925. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5926. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5927. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5928. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5929. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5930. do { \
  5931. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5932. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5933. } while (0)
  5934. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5935. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5936. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5937. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5938. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5939. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5942. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5943. } while (0)
  5944. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5945. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5946. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5947. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5948. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5949. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5950. do { \
  5951. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5952. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5953. } while (0)
  5954. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5955. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5956. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5957. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5958. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5959. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5960. do { \
  5961. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5962. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5963. } while (0)
  5964. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5965. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5966. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5967. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5968. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5969. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5970. do { \
  5971. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5972. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5973. } while (0)
  5974. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5975. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5976. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5977. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5978. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5979. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5982. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5983. } while (0)
  5984. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5985. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5986. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5987. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5988. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5989. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5990. do { \
  5991. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5992. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5993. } while (0)
  5994. /*
  5995. * Subtype based MGMT frames enable bits.
  5996. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5997. */
  5998. /* association request */
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  6005. /* association response */
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  6012. /* Reassociation request */
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  6019. /* Reassociation response */
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  6026. /* Probe request */
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  6033. /* Probe response */
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  6040. /* Timing Advertisement */
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  6047. /* Reserved */
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  6054. /* Beacon */
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  6061. /* ATIM */
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  6068. /* Disassociation */
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  6075. /* Authentication */
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  6082. /* Deauthentication */
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  6089. /* Action */
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  6096. /* Action No Ack */
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  6103. /* Reserved */
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  6110. /*
  6111. * Subtype based CTRL frames enable bits.
  6112. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  6113. */
  6114. /* Reserved */
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  6121. /* Reserved */
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  6128. /* Reserved */
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  6135. /* Reserved */
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6142. /* Reserved */
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6149. /* Reserved */
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6156. /* Reserved */
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6163. /* Control Wrapper */
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6170. /* Block Ack Request */
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6177. /* Block Ack*/
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6184. /* PS-POLL */
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6191. /* RTS */
  6192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6198. /* CTS */
  6199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6205. /* ACK */
  6206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6212. /* CF-END */
  6213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6219. /* CF-END + CF-ACK */
  6220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6226. /* Multicast data */
  6227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6233. /* Unicast data */
  6234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6236. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6237. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6240. /* NULL data */
  6241. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6242. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6243. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6244. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6245. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6246. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6247. /* FPMO mode flags */
  6248. /* MGMT */
  6249. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6254. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6256. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6258. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6259. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6260. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6261. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6265. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6268. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6269. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6270. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6275. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6276. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6277. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6278. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6279. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6280. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6281. /* CTRL */
  6282. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6284. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6285. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6288. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6289. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6290. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6291. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6292. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6295. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6296. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6297. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6298. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6300. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6302. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6303. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6304. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6305. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6306. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6307. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6308. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6309. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6310. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6311. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6312. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6313. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6314. /* DATA */
  6315. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6316. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6317. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6318. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6320. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6321. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6322. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6323. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6324. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6325. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(httsym, value); \
  6328. (word) |= (value) << httsym##_S; \
  6329. } while (0)
  6330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6331. (((word) & httsym##_M) >> httsym##_S)
  6332. #define htt_rx_ring_pkt_enable_subtype_set( \
  6333. word, flag, mode, type, subtype, val) \
  6334. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6335. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6336. #define htt_rx_ring_pkt_enable_subtype_get( \
  6337. word, flag, mode, type, subtype) \
  6338. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6339. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6340. /* Definition to filter in TLVs */
  6341. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6342. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6343. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6344. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6345. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6346. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6347. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6348. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6349. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6350. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6351. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6352. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6353. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6354. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6355. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6356. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6357. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6358. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6359. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6360. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6361. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6362. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6363. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6364. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6365. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6366. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6367. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6368. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6369. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6370. do { \
  6371. HTT_CHECK_SET_VAL(httsym, enable); \
  6372. (word) |= (enable) << httsym##_S; \
  6373. } while (0)
  6374. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6375. (((word) & httsym##_M) >> httsym##_S)
  6376. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6377. HTT_RX_RING_TLV_ENABLE_SET( \
  6378. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6379. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6380. HTT_RX_RING_TLV_ENABLE_GET( \
  6381. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6382. /**
  6383. * @brief host -> target TX monitor config message
  6384. *
  6385. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6386. *
  6387. * @details
  6388. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6389. * configure RXDMA rings.
  6390. * The configuration is per ring based and includes both packet types
  6391. * and PPDU/MPDU TLVs.
  6392. *
  6393. * The message would appear as follows:
  6394. *
  6395. * |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|
  6396. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6397. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6398. * |-----------+--------+--------+-----+------------------------------------|
  6399. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6400. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6401. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6402. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6403. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6404. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6405. * |------------------------------------------------------------------------|
  6406. * | tlv_filter_mask_in0 |
  6407. * |------------------------------------------------------------------------|
  6408. * | tlv_filter_mask_in1 |
  6409. * |------------------------------------------------------------------------|
  6410. * | tlv_filter_mask_in2 |
  6411. * |------------------------------------------------------------------------|
  6412. * | tlv_filter_mask_in3 |
  6413. * |-----------------+-----------------+---------------------+--------------|
  6414. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6415. * |------------------------------------------------------------------------|
  6416. * | pcu_ppdu_setup_word_mask |
  6417. * |--------------------+--+--+--+-----+---------------------+--------------|
  6418. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6419. * |------------------------------------------------------------------------|
  6420. *
  6421. * Where:
  6422. * PS = pkt_swap
  6423. * SS = status_swap
  6424. * The message is interpreted as follows:
  6425. * dword0 - b'0:7 - msg_type: This will be set to
  6426. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6427. * b'8:15 - pdev_id:
  6428. * 0 (for rings at SOC level),
  6429. * 1/2/3 mac id (for rings at LMAC level)
  6430. * b'16:23 - ring_id : Identify the ring to configure.
  6431. * More details can be got from enum htt_srng_ring_id
  6432. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6433. * BUF_RING_CFG_0 defs within HW .h files,
  6434. * e.g. wmac_top_reg_seq_hwioreg.h
  6435. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6436. * BUF_RING_CFG_0 defs within HW .h files,
  6437. * e.g. wmac_top_reg_seq_hwioreg.h
  6438. * b'26 - tx_mon_global_en: Enable/Disable global register
  6439. * configuration in Tx monitor module.
  6440. * b'27:31 - rsvd1: reserved for future use
  6441. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6442. * in byte units.
  6443. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6444. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6445. * 64, 128, 256.
  6446. * If all 3 bits are set config length is > 256.
  6447. * if val is '0', then ignore this field.
  6448. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6449. * 64, 128, 256.
  6450. * If all 3 bits are set config length is > 256.
  6451. * if val is '0', then ignore this field.
  6452. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6453. * 64, 128, 256.
  6454. * If all 3 bits are set config length is > 256.
  6455. * If val is '0', then ignore this field.
  6456. * - b'25:31 - rsvd2: Reserved for future use
  6457. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6458. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6459. * If packet_type_enable_flags is '1' for MGMT type,
  6460. * monitor will ignore this bit and allow this TLV.
  6461. * If packet_type_enable_flags is '0' for MGMT type,
  6462. * monitor will use this bit to enable/disable logging
  6463. * of this TLV.
  6464. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6465. * If packet_type_enable_flags is '1' for CTRL type,
  6466. * monitor will ignore this bit and allow this TLV.
  6467. * If packet_type_enable_flags is '0' for CTRL type,
  6468. * monitor will use this bit to enable/disable logging
  6469. * of this TLV.
  6470. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6471. * If packet_type_enable_flags is '1' for DATA type,
  6472. * monitor will ignore this bit and allow this TLV.
  6473. * If packet_type_enable_flags is '0' for DATA type,
  6474. * monitor will use this bit to enable/disable logging
  6475. * of this TLV.
  6476. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6477. * If packet_type_enable_flags is '1' for MGMT type,
  6478. * monitor will ignore this bit and allow this TLV.
  6479. * If packet_type_enable_flags is '0' for MGMT type,
  6480. * monitor will use this bit to enable/disable logging
  6481. * of this TLV.
  6482. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6483. * If packet_type_enable_flags is '1' for CTRL type,
  6484. * monitor will ignore this bit and allow this TLV.
  6485. * If packet_type_enable_flags is '0' for CTRL type,
  6486. * monitor will use this bit to enable/disable logging
  6487. * of this TLV.
  6488. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6489. * If packet_type_enable_flags is '1' for DATA type,
  6490. * monitor will ignore this bit and allow this TLV.
  6491. * If packet_type_enable_flags is '0' for DATA type,
  6492. * monitor will use this bit to enable/disable logging
  6493. * of this TLV.
  6494. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6495. * If packet_type_enable_flags is '1' for MGMT type,
  6496. * monitor will ignore this bit and allow this TLV.
  6497. * If packet_type_enable_flags is '0' for MGMT type,
  6498. * monitor will use this bit to enable/disable logging
  6499. * of this TLV.
  6500. * If filter_in_TX_MPDU_START = 1 it is recommended
  6501. * to set this bit.
  6502. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6503. * If packet_type_enable_flags is '1' for CTRL type,
  6504. * monitor will ignore this bit and allow this TLV.
  6505. * If packet_type_enable_flags is '0' for CTRL type,
  6506. * monitor will use this bit to enable/disable logging
  6507. * of this TLV.
  6508. * If filter_in_TX_MPDU_START = 1 it is recommended
  6509. * to set this bit.
  6510. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6511. * If packet_type_enable_flags is '1' for DATA type,
  6512. * monitor will ignore this bit and allow this TLV.
  6513. * If packet_type_enable_flags is '0' for DATA type,
  6514. * monitor will use this bit to enable/disable logging
  6515. * of this TLV.
  6516. * If filter_in_TX_MPDU_START = 1 it is recommended
  6517. * to set this bit.
  6518. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6519. * If packet_type_enable_flags is '1' for MGMT type,
  6520. * monitor will ignore this bit and allow this TLV.
  6521. * If packet_type_enable_flags is '0' for MGMT type,
  6522. * monitor will use this bit to enable/disable logging
  6523. * of this TLV.
  6524. * If filter_in_TX_MSDU_START = 1 it is recommended
  6525. * to set this bit.
  6526. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6527. * If packet_type_enable_flags is '1' for CTRL type,
  6528. * monitor will ignore this bit and allow this TLV.
  6529. * If packet_type_enable_flags is '0' for CTRL type,
  6530. * monitor will use this bit to enable/disable logging
  6531. * of this TLV.
  6532. * If filter_in_TX_MSDU_START = 1 it is recommended
  6533. * to set this bit.
  6534. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6535. * If packet_type_enable_flags is '1' for DATA type,
  6536. * monitor will ignore this bit and allow this TLV.
  6537. * If packet_type_enable_flags is '0' for DATA type,
  6538. * monitor will use this bit to enable/disable logging
  6539. * of this TLV.
  6540. * If filter_in_TX_MSDU_START = 1 it is recommended
  6541. * to set this bit.
  6542. * b'15:31 - rsvd3: Reserved for future use
  6543. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6544. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6545. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6546. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6547. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6548. * - b'8:15 - tx_peer_entry_word_mask:
  6549. * - b'16:23 - tx_queue_ext_word_mask:
  6550. * - b'24:31 - tx_msdu_start_word_mask:
  6551. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6552. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6553. * - b'8:15 - rxpcu_user_setup_word_mask:
  6554. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6555. * MGMT, CTRL, DATA
  6556. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6557. * 0 -> MSDU level logging is enabled
  6558. * (valid only if bit is set in
  6559. * pkt_type_enable_msdu_or_mpdu_logging)
  6560. * 1 -> MPDU level logging is enabled
  6561. * (valid only if bit is set in
  6562. * pkt_type_enable_msdu_or_mpdu_logging)
  6563. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6564. * 0 -> MSDU level logging is enabled
  6565. * (valid only if bit is set in
  6566. * pkt_type_enable_msdu_or_mpdu_logging)
  6567. * 1 -> MPDU level logging is enabled
  6568. * (valid only if bit is set in
  6569. * pkt_type_enable_msdu_or_mpdu_logging)
  6570. * - b'21 - dma_mpdu_data(D) : For DATA
  6571. * 0 -> MSDU level logging is enabled
  6572. * (valid only if bit is set in
  6573. * pkt_type_enable_msdu_or_mpdu_logging)
  6574. * 1 -> MPDU level logging is enabled
  6575. * (valid only if bit is set in
  6576. * pkt_type_enable_msdu_or_mpdu_logging)
  6577. * - b'22:31 - rsvd4 for future use
  6578. */
  6579. PREPACK struct htt_tx_monitor_cfg_t {
  6580. A_UINT32 msg_type: 8,
  6581. pdev_id: 8,
  6582. ring_id: 8,
  6583. status_swap: 1,
  6584. pkt_swap: 1,
  6585. tx_mon_global_en: 1,
  6586. rsvd1: 5;
  6587. A_UINT32 ring_buffer_size: 16,
  6588. config_length_mgmt: 3,
  6589. config_length_ctrl: 3,
  6590. config_length_data: 3,
  6591. rsvd2: 7;
  6592. A_UINT32 pkt_type_enable_flags: 3,
  6593. filter_in_tx_mpdu_start_mgmt: 1,
  6594. filter_in_tx_mpdu_start_ctrl: 1,
  6595. filter_in_tx_mpdu_start_data: 1,
  6596. filter_in_tx_msdu_start_mgmt: 1,
  6597. filter_in_tx_msdu_start_ctrl: 1,
  6598. filter_in_tx_msdu_start_data: 1,
  6599. filter_in_tx_mpdu_end_mgmt: 1,
  6600. filter_in_tx_mpdu_end_ctrl: 1,
  6601. filter_in_tx_mpdu_end_data: 1,
  6602. filter_in_tx_msdu_end_mgmt: 1,
  6603. filter_in_tx_msdu_end_ctrl: 1,
  6604. filter_in_tx_msdu_end_data: 1,
  6605. word_mask_compaction_enable: 1,
  6606. rsvd3: 16;
  6607. A_UINT32 tlv_filter_mask_in0;
  6608. A_UINT32 tlv_filter_mask_in1;
  6609. A_UINT32 tlv_filter_mask_in2;
  6610. A_UINT32 tlv_filter_mask_in3;
  6611. A_UINT32 tx_fes_setup_word_mask: 8,
  6612. tx_peer_entry_word_mask: 8,
  6613. tx_queue_ext_word_mask: 8,
  6614. tx_msdu_start_word_mask: 8;
  6615. A_UINT32 pcu_ppdu_setup_word_mask;
  6616. A_UINT32 tx_mpdu_start_word_mask: 8,
  6617. rxpcu_user_setup_word_mask: 8,
  6618. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6619. dma_mpdu_mgmt: 1,
  6620. dma_mpdu_ctrl: 1,
  6621. dma_mpdu_data: 1,
  6622. rsvd4: 10;
  6623. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6624. tx_peer_entry_v2_word_mask: 12,
  6625. rsvd5: 8;
  6626. A_UINT32 fes_status_end_word_mask: 16,
  6627. response_end_status_word_mask: 16;
  6628. A_UINT32 fes_status_prot_word_mask: 11,
  6629. rsvd6: 21;
  6630. } POSTPACK;
  6631. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6632. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6633. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6634. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6635. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6636. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6637. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6638. do { \
  6639. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6640. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6641. } while (0)
  6642. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6643. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6644. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6645. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6646. HTT_TX_MONITOR_CFG_RING_ID_S)
  6647. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6648. do { \
  6649. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6650. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6651. } while (0)
  6652. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6653. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6654. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6655. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6656. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6657. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6658. do { \
  6659. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6660. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6661. } while (0)
  6662. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6663. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6664. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6665. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6666. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6667. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6668. do { \
  6669. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6670. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6671. } while (0)
  6672. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6673. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6674. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6675. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6676. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6677. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6678. do { \
  6679. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6680. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6681. } while (0)
  6682. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6683. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6684. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6685. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6686. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6687. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6688. do { \
  6689. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6690. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6691. } while (0)
  6692. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6693. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6694. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6695. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6696. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6697. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6698. do { \
  6699. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6700. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6701. } while (0)
  6702. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6703. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6704. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6705. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6706. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6707. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6708. do { \
  6709. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6710. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6711. } while (0)
  6712. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6713. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6714. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6715. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6716. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6717. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6718. do { \
  6719. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6720. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6721. } while (0)
  6722. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6723. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6724. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6725. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6726. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6727. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6728. do { \
  6729. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6730. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6731. } while (0)
  6732. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6733. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6734. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6735. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6736. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6737. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6738. do { \
  6739. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6740. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6741. } while (0)
  6742. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6743. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6744. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6745. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6746. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6747. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6748. do { \
  6749. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6750. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6751. } while (0)
  6752. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6753. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6754. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6755. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6756. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6757. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6758. do { \
  6759. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6760. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6761. } while (0)
  6762. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6763. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6764. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6765. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6766. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6767. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6768. do { \
  6769. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6770. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6771. } while (0)
  6772. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6773. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6774. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6775. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6776. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6777. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6778. do { \
  6779. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6780. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6781. } while (0)
  6782. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6783. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6784. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6785. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6786. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6787. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6788. do { \
  6789. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6790. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6791. } while (0)
  6792. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6793. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6794. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6795. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6796. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6797. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6800. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6801. } while (0)
  6802. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6803. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6804. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6805. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6806. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6807. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6808. do { \
  6809. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6810. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6811. } while (0)
  6812. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6813. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6814. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6815. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6816. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6817. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6818. do { \
  6819. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6820. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6821. } while (0)
  6822. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6823. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6824. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6825. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6826. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6827. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6828. do { \
  6829. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6830. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6831. } while (0)
  6832. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6833. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6834. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6835. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6836. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6837. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6838. do { \
  6839. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6840. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6841. } while (0)
  6842. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6843. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6844. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6845. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6846. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6847. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6848. do { \
  6849. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6850. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6851. } while (0)
  6852. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6853. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6854. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6855. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6856. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6857. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6858. do { \
  6859. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6860. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6861. } while (0)
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6865. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6866. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6868. do { \
  6869. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6870. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6871. } while (0)
  6872. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6873. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6874. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6875. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6876. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6877. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6878. do { \
  6879. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6880. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6881. } while (0)
  6882. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6883. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6884. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6885. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6886. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6887. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6888. do { \
  6889. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6890. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6891. } while (0)
  6892. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6893. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6894. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6895. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6896. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6897. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6898. do { \
  6899. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6900. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6901. } while (0)
  6902. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6903. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6904. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6905. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6906. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6907. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6908. do { \
  6909. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6910. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6911. } while (0)
  6912. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6913. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6914. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6915. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6916. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6917. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6918. do { \
  6919. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6920. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6921. } while (0)
  6922. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6923. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6924. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6925. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6926. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6927. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6928. do { \
  6929. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6930. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6931. } while (0)
  6932. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6933. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6934. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6935. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6936. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6937. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6938. do { \
  6939. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6940. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6941. } while (0)
  6942. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6943. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6944. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6945. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6946. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6947. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6948. do { \
  6949. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6950. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6951. } while (0)
  6952. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6953. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6954. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6955. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6956. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6957. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6958. do { \
  6959. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6960. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6961. } while (0)
  6962. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6963. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6964. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6965. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6966. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6967. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6968. do { \
  6969. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6970. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6971. } while (0)
  6972. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6973. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6974. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6975. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6976. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6977. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6978. do { \
  6979. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6980. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6981. } while (0)
  6982. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6983. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6984. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6985. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6986. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6987. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6988. do { \
  6989. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6990. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6991. } while (0)
  6992. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6993. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6994. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6995. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6996. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6997. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6998. do { \
  6999. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  7000. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  7001. } while (0)
  7002. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  7003. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  7004. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  7005. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  7006. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  7007. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  7008. do { \
  7009. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  7010. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  7011. } while (0)
  7012. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  7013. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  7014. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  7015. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  7016. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  7017. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  7018. do { \
  7019. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  7020. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  7021. } while (0)
  7022. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  7023. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  7024. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  7025. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  7026. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  7027. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  7028. do { \
  7029. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  7030. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  7031. } while (0)
  7032. /*
  7033. * pkt_type_enable_flags
  7034. */
  7035. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  7036. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  7037. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  7038. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  7039. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  7040. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  7041. /*
  7042. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  7043. */
  7044. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  7045. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  7046. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  7047. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  7048. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  7049. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  7050. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  7051. do { \
  7052. HTT_CHECK_SET_VAL(httsym, value); \
  7053. (word) |= (value) << httsym##_S; \
  7054. } while (0)
  7055. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  7056. (((word) & httsym##_M) >> httsym##_S)
  7057. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  7058. * type -> MGMT, CTRL, DATA*/
  7059. #define htt_tx_ring_pkt_type_set( \
  7060. word, mode, type, val) \
  7061. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  7062. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  7063. #define htt_tx_ring_pkt_type_get( \
  7064. word, mode, type) \
  7065. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  7066. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  7067. /* Definition to filter in TLVs */
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  7132. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  7133. do { \
  7134. HTT_CHECK_SET_VAL(httsym, enable); \
  7135. (word) |= (enable) << httsym##_S; \
  7136. } while (0)
  7137. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7138. (((word) & httsym##_M) >> httsym##_S)
  7139. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7140. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7141. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7142. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7143. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7144. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7209. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7210. do { \
  7211. HTT_CHECK_SET_VAL(httsym, enable); \
  7212. (word) |= (enable) << httsym##_S; \
  7213. } while (0)
  7214. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7215. (((word) & httsym##_M) >> httsym##_S)
  7216. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7217. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7218. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7219. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7220. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7221. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7226. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7227. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7228. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7229. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7230. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7231. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7232. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7233. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7234. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7235. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7236. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7237. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7238. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7239. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7240. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7241. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7242. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7243. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7244. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7245. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7246. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7247. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7248. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7249. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7250. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7251. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7252. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7253. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7254. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7255. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7256. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7257. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7258. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7259. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7260. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7261. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7262. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7263. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7264. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7265. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7266. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7267. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7268. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7269. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7270. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7271. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7272. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7273. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7274. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7275. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7276. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7277. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7278. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7279. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7280. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7281. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7282. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7283. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7284. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7285. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7286. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7287. do { \
  7288. HTT_CHECK_SET_VAL(httsym, enable); \
  7289. (word) |= (enable) << httsym##_S; \
  7290. } while (0)
  7291. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7292. (((word) & httsym##_M) >> httsym##_S)
  7293. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7294. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7295. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7296. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7297. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7298. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7299. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7300. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7301. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7302. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7303. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7304. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7305. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7306. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7307. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7308. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7309. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7310. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7311. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7312. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7313. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7314. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7315. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7316. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7317. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7318. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7319. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7320. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7321. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7322. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7323. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7324. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7325. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7326. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7327. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7328. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7329. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7330. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7331. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7332. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7333. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7334. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7335. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7336. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7337. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7338. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7339. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7340. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7341. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7342. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7343. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(httsym, enable); \
  7346. (word) |= (enable) << httsym##_S; \
  7347. } while (0)
  7348. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7349. (((word) & httsym##_M) >> httsym##_S)
  7350. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7351. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7352. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7353. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7354. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7355. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7356. /**
  7357. * @brief host --> target Receive Flow Steering configuration message definition
  7358. *
  7359. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7360. *
  7361. * host --> target Receive Flow Steering configuration message definition.
  7362. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7363. * The reason for this is we want RFS to be configured and ready before MAC
  7364. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7365. *
  7366. * |31 24|23 16|15 9|8|7 0|
  7367. * |----------------+----------------+----------------+----------------|
  7368. * | reserved |E| msg type |
  7369. * |-------------------------------------------------------------------|
  7370. * Where E = RFS enable flag
  7371. *
  7372. * The RFS_CONFIG message consists of a single 4-byte word.
  7373. *
  7374. * Header fields:
  7375. * - MSG_TYPE
  7376. * Bits 7:0
  7377. * Purpose: identifies this as a RFS config msg
  7378. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7379. * - RFS_CONFIG
  7380. * Bit 8
  7381. * Purpose: Tells target whether to enable (1) or disable (0)
  7382. * flow steering feature when sending rx indication messages to host
  7383. */
  7384. #define HTT_H2T_RFS_CONFIG_M 0x100
  7385. #define HTT_H2T_RFS_CONFIG_S 8
  7386. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7387. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7388. HTT_H2T_RFS_CONFIG_S)
  7389. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7390. do { \
  7391. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7392. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7393. } while (0)
  7394. #define HTT_RFS_CFG_REQ_BYTES 4
  7395. /**
  7396. * @brief host -> target FW extended statistics request
  7397. *
  7398. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7399. *
  7400. * @details
  7401. * The following field definitions describe the format of the HTT host
  7402. * to target FW extended stats retrieve message.
  7403. * The message specifies the type of stats the host wants to retrieve.
  7404. *
  7405. * |31 24|23 16|15 8|7 0|
  7406. * |-----------------------------------------------------------|
  7407. * | reserved | stats type | pdev_mask | msg type |
  7408. * |-----------------------------------------------------------|
  7409. * | config param [0] |
  7410. * |-----------------------------------------------------------|
  7411. * | config param [1] |
  7412. * |-----------------------------------------------------------|
  7413. * | config param [2] |
  7414. * |-----------------------------------------------------------|
  7415. * | config param [3] |
  7416. * |-----------------------------------------------------------|
  7417. * | reserved |
  7418. * |-----------------------------------------------------------|
  7419. * | cookie LSBs |
  7420. * |-----------------------------------------------------------|
  7421. * | cookie MSBs |
  7422. * |-----------------------------------------------------------|
  7423. * Header fields:
  7424. * - MSG_TYPE
  7425. * Bits 7:0
  7426. * Purpose: identifies this is a extended stats upload request message
  7427. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7428. * - PDEV_MASK
  7429. * Bits 8:15
  7430. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7431. * Value: This is a overloaded field, refer to usage and interpretation of
  7432. * PDEV in interface document.
  7433. * Bit 8 : Reserved for SOC stats
  7434. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7435. * Indicates MACID_MASK in DBS
  7436. * - STATS_TYPE
  7437. * Bits 23:16
  7438. * Purpose: identifies which FW statistics to upload
  7439. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7440. * - Reserved
  7441. * Bits 31:24
  7442. * - CONFIG_PARAM [0]
  7443. * Bits 31:0
  7444. * Purpose: give an opaque configuration value to the specified stats type
  7445. * Value: stats-type specific configuration value
  7446. * Refer to htt_stats.h for interpretation for each stats sub_type
  7447. * - CONFIG_PARAM [1]
  7448. * Bits 31:0
  7449. * Purpose: give an opaque configuration value to the specified stats type
  7450. * Value: stats-type specific configuration value
  7451. * Refer to htt_stats.h for interpretation for each stats sub_type
  7452. * - CONFIG_PARAM [2]
  7453. * Bits 31:0
  7454. * Purpose: give an opaque configuration value to the specified stats type
  7455. * Value: stats-type specific configuration value
  7456. * Refer to htt_stats.h for interpretation for each stats sub_type
  7457. * - CONFIG_PARAM [3]
  7458. * Bits 31:0
  7459. * Purpose: give an opaque configuration value to the specified stats type
  7460. * Value: stats-type specific configuration value
  7461. * Refer to htt_stats.h for interpretation for each stats sub_type
  7462. * - Reserved [31:0] for future use.
  7463. * - COOKIE_LSBS
  7464. * Bits 31:0
  7465. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7466. * message with its preceding host->target stats request message.
  7467. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7468. * - COOKIE_MSBS
  7469. * Bits 31:0
  7470. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7471. * message with its preceding host->target stats request message.
  7472. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7473. */
  7474. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7475. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7476. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7477. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7478. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7479. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7480. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7481. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7482. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7483. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7484. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7485. do { \
  7486. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7487. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7488. } while (0)
  7489. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7490. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7491. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7492. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7493. do { \
  7494. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7495. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7496. } while (0)
  7497. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7498. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7499. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7500. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7501. do { \
  7502. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7503. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7504. } while (0)
  7505. /**
  7506. * @brief host -> target FW streaming statistics request
  7507. *
  7508. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7509. *
  7510. * @details
  7511. * The following field definitions describe the format of the HTT host
  7512. * to target message that requests the target to start or stop producing
  7513. * ongoing stats of the specified type.
  7514. *
  7515. * |31|30 |23 16|15 8|7 0|
  7516. * |-----------------------------------------------------------|
  7517. * |EN| reserved | stats type | reserved | msg type |
  7518. * |-----------------------------------------------------------|
  7519. * | config param [0] |
  7520. * |-----------------------------------------------------------|
  7521. * | config param [1] |
  7522. * |-----------------------------------------------------------|
  7523. * | config param [2] |
  7524. * |-----------------------------------------------------------|
  7525. * | config param [3] |
  7526. * |-----------------------------------------------------------|
  7527. * Where:
  7528. * - EN is an enable/disable flag
  7529. * Header fields:
  7530. * - MSG_TYPE
  7531. * Bits 7:0
  7532. * Purpose: identifies this is a streaming stats upload request message
  7533. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7534. * - STATS_TYPE
  7535. * Bits 23:16
  7536. * Purpose: identifies which FW statistics to upload
  7537. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7538. * Only the htt_dbg_ext_stats_type values identified as streaming
  7539. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7540. * - ENABLE
  7541. * Bit 31
  7542. * Purpose: enable/disable the target's ongoing stats of the specified type
  7543. * Value:
  7544. * 0 - disable ongoing production of the specified stats type
  7545. * 1 - enable ongoing production of the specified stats type
  7546. * - CONFIG_PARAM [0]
  7547. * Bits 31:0
  7548. * Purpose: give an opaque configuration value to the specified stats type
  7549. * Value: stats-type specific configuration value
  7550. * Refer to htt_stats.h for interpretation for each stats sub_type
  7551. * - CONFIG_PARAM [1]
  7552. * Bits 31:0
  7553. * Purpose: give an opaque configuration value to the specified stats type
  7554. * Value: stats-type specific configuration value
  7555. * Refer to htt_stats.h for interpretation for each stats sub_type
  7556. * - CONFIG_PARAM [2]
  7557. * Bits 31:0
  7558. * Purpose: give an opaque configuration value to the specified stats type
  7559. * Value: stats-type specific configuration value
  7560. * Refer to htt_stats.h for interpretation for each stats sub_type
  7561. * - CONFIG_PARAM [3]
  7562. * Bits 31:0
  7563. * Purpose: give an opaque configuration value to the specified stats type
  7564. * Value: stats-type specific configuration value
  7565. * Refer to htt_stats.h for interpretation for each stats sub_type
  7566. */
  7567. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7568. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7569. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7570. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7571. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7572. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7573. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7574. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7575. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7578. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7579. } while (0)
  7580. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7581. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7582. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7583. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7586. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7587. } while (0)
  7588. /**
  7589. * @brief host -> target FW PPDU_STATS request message
  7590. *
  7591. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7592. *
  7593. * @details
  7594. * The following field definitions describe the format of the HTT host
  7595. * to target FW for PPDU_STATS_CFG msg.
  7596. * The message allows the host to configure the PPDU_STATS_IND messages
  7597. * produced by the target.
  7598. *
  7599. * |31 24|23 16|15 8|7 0|
  7600. * |-----------------------------------------------------------|
  7601. * | REQ bit mask | pdev_mask | msg type |
  7602. * |-----------------------------------------------------------|
  7603. * Header fields:
  7604. * - MSG_TYPE
  7605. * Bits 7:0
  7606. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7607. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7608. * - PDEV_MASK
  7609. * Bits 8:15
  7610. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7611. * Value: This is a overloaded field, refer to usage and interpretation of
  7612. * PDEV in interface document.
  7613. * Bit 8 : Reserved for SOC stats
  7614. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7615. * Indicates MACID_MASK in DBS
  7616. * - REQ_TLV_BIT_MASK
  7617. * Bits 16:31
  7618. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7619. * needs to be included in the target's PPDU_STATS_IND messages.
  7620. * Value: refer htt_ppdu_stats_tlv_tag_t
  7621. *
  7622. */
  7623. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7624. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7625. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7626. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7627. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7628. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7629. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7630. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7631. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7632. do { \
  7633. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7634. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7635. } while (0)
  7636. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7637. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7638. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7639. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7640. do { \
  7641. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7642. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7643. } while (0)
  7644. /**
  7645. * @brief Host-->target HTT RX FSE setup message
  7646. *
  7647. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7648. *
  7649. * @details
  7650. * Through this message, the host will provide details of the flow tables
  7651. * in host DDR along with hash keys.
  7652. * This message can be sent per SOC or per PDEV, which is differentiated
  7653. * by pdev id values.
  7654. * The host will allocate flow search table and sends table size,
  7655. * physical DMA address of flow table, and hash keys to firmware to
  7656. * program into the RXOLE FSE HW block.
  7657. *
  7658. * The following field definitions describe the format of the RX FSE setup
  7659. * message sent from the host to target
  7660. *
  7661. * Header fields:
  7662. * dword0 - b'7:0 - msg_type: This will be set to
  7663. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7664. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7665. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7666. * pdev's LMAC ring.
  7667. * b'31:16 - reserved : Reserved for future use
  7668. * dword1 - b'19:0 - number of records: This field indicates the number of
  7669. * entries in the flow table. For example: 8k number of
  7670. * records is equivalent to
  7671. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7672. * b'27:20 - max search: This field specifies the skid length to FSE
  7673. * parser HW module whenever match is not found at the
  7674. * exact index pointed by hash.
  7675. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7676. * Refer htt_ip_da_sa_prefix below for more details.
  7677. * b'31:30 - reserved: Reserved for future use
  7678. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7679. * table allocated by host in DDR
  7680. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7681. * table allocated by host in DDR
  7682. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7683. * entry hashing
  7684. *
  7685. *
  7686. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7687. * |---------------------------------------------------------------|
  7688. * | reserved | pdev_id | MSG_TYPE |
  7689. * |---------------------------------------------------------------|
  7690. * |resvd|IPDSA| max_search | Number of records |
  7691. * |---------------------------------------------------------------|
  7692. * | base address lo |
  7693. * |---------------------------------------------------------------|
  7694. * | base address high |
  7695. * |---------------------------------------------------------------|
  7696. * | toeplitz key 31_0 |
  7697. * |---------------------------------------------------------------|
  7698. * | toeplitz key 63_32 |
  7699. * |---------------------------------------------------------------|
  7700. * | toeplitz key 95_64 |
  7701. * |---------------------------------------------------------------|
  7702. * | toeplitz key 127_96 |
  7703. * |---------------------------------------------------------------|
  7704. * | toeplitz key 159_128 |
  7705. * |---------------------------------------------------------------|
  7706. * | toeplitz key 191_160 |
  7707. * |---------------------------------------------------------------|
  7708. * | toeplitz key 223_192 |
  7709. * |---------------------------------------------------------------|
  7710. * | toeplitz key 255_224 |
  7711. * |---------------------------------------------------------------|
  7712. * | toeplitz key 287_256 |
  7713. * |---------------------------------------------------------------|
  7714. * | reserved | toeplitz key 314_288(26:0 bits) |
  7715. * |---------------------------------------------------------------|
  7716. * where:
  7717. * IPDSA = ip_da_sa
  7718. */
  7719. /**
  7720. * @brief: htt_ip_da_sa_prefix
  7721. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7722. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7723. * documentation per RFC3849
  7724. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7725. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7726. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7727. */
  7728. enum htt_ip_da_sa_prefix {
  7729. HTT_RX_IPV6_20010db8,
  7730. HTT_RX_IPV4_MAPPED_IPV6,
  7731. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7732. HTT_RX_IPV6_64FF9B,
  7733. };
  7734. /**
  7735. * @brief Host-->target HTT RX FISA configure and enable
  7736. *
  7737. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7738. *
  7739. * @details
  7740. * The host will send this command down to configure and enable the FISA
  7741. * operational params.
  7742. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7743. * register.
  7744. * Should configure both the MACs.
  7745. *
  7746. * dword0 - b'7:0 - msg_type:
  7747. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7748. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7749. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7750. * pdev's LMAC ring.
  7751. * b'31:16 - reserved : Reserved for future use
  7752. *
  7753. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7754. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7755. * packets. 1 flow search will be skipped
  7756. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7757. * tcp,udp packets
  7758. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7759. * calculation
  7760. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7761. * calculation
  7762. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7763. * calculation
  7764. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7765. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7766. * length
  7767. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7768. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7769. * length
  7770. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7771. * num jump
  7772. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7773. * num jump
  7774. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7775. * data type switch has happened for MPDU Sequence num jump
  7776. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7777. * for MPDU Sequence num jump
  7778. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7779. * for decrypt errors
  7780. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7781. * while aggregating a msdu
  7782. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7783. * The aggregation is done until (number of MSDUs aggregated
  7784. * < LIMIT + 1)
  7785. * b'31:18 - Reserved
  7786. *
  7787. * fisa_control_value - 32bit value FW can write to register
  7788. *
  7789. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7790. * Threshold value for FISA timeout (units are microseconds).
  7791. * When the global timestamp exceeds this threshold, FISA
  7792. * aggregation will be restarted.
  7793. * A value of 0 means timeout is disabled.
  7794. * Compare the threshold register with timestamp field in
  7795. * flow entry to generate timeout for the flow.
  7796. *
  7797. * |31 18 |17 16|15 8|7 0|
  7798. * |-------------------------------------------------------------|
  7799. * | reserved | pdev_mask | msg type |
  7800. * |-------------------------------------------------------------|
  7801. * | reserved | FISA_CTRL |
  7802. * |-------------------------------------------------------------|
  7803. * | FISA_TIMEOUT_THRESH |
  7804. * |-------------------------------------------------------------|
  7805. */
  7806. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7807. A_UINT32 msg_type:8,
  7808. pdev_id:8,
  7809. reserved0:16;
  7810. /**
  7811. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7812. * [17:0]
  7813. */
  7814. union {
  7815. /*
  7816. * fisa_control_bits structure is deprecated.
  7817. * Please use fisa_control_bits_v2 going forward.
  7818. */
  7819. struct {
  7820. A_UINT32 fisa_enable: 1,
  7821. ipsec_skip_search: 1,
  7822. nontcp_skip_search: 1,
  7823. add_ipv4_fixed_hdr_len: 1,
  7824. add_ipv6_fixed_hdr_len: 1,
  7825. add_tcp_fixed_hdr_len: 1,
  7826. add_udp_hdr_len: 1,
  7827. chksum_cum_ip_len_en: 1,
  7828. disable_tid_check: 1,
  7829. disable_ta_check: 1,
  7830. disable_qos_check: 1,
  7831. disable_raw_check: 1,
  7832. disable_decrypt_err_check: 1,
  7833. disable_msdu_drop_check: 1,
  7834. fisa_aggr_limit: 4,
  7835. reserved: 14;
  7836. } fisa_control_bits;
  7837. struct {
  7838. A_UINT32 fisa_enable: 1,
  7839. fisa_aggr_limit: 6,
  7840. reserved: 25;
  7841. } fisa_control_bits_v2;
  7842. A_UINT32 fisa_control_value;
  7843. } u_fisa_control;
  7844. /**
  7845. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7846. * timeout threshold for aggregation. Unit in usec.
  7847. * [31:0]
  7848. */
  7849. A_UINT32 fisa_timeout_threshold;
  7850. } POSTPACK;
  7851. /* DWord 0: pdev-ID */
  7852. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7853. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7854. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7855. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7856. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7857. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7858. do { \
  7859. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7860. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7861. } while (0)
  7862. /* Dword 1: fisa_control_value fisa config */
  7863. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7864. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7865. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7866. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7867. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7868. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7869. do { \
  7870. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7871. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7872. } while (0)
  7873. /* Dword 1: fisa_control_value ipsec_skip_search */
  7874. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7875. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7876. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7877. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7878. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7879. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7880. do { \
  7881. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7882. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7883. } while (0)
  7884. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7885. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7886. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7887. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7888. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7889. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7890. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7893. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7894. } while (0)
  7895. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7896. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7897. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7898. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7899. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7900. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7901. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7902. do { \
  7903. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7904. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7905. } while (0)
  7906. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7907. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7908. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7909. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7910. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7911. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7912. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7913. do { \
  7914. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7915. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7916. } while (0)
  7917. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7918. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7919. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7920. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7921. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7922. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7923. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7924. do { \
  7925. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7926. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7927. } while (0)
  7928. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7929. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7930. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7931. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7932. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7933. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7934. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7935. do { \
  7936. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7937. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7938. } while (0)
  7939. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7940. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7941. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7942. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7943. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7944. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7945. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7946. do { \
  7947. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7948. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7949. } while (0)
  7950. /* Dword 1: fisa_control_value disable_tid_check */
  7951. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7952. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7953. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7954. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7955. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7956. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7959. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7960. } while (0)
  7961. /* Dword 1: fisa_control_value disable_ta_check */
  7962. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7963. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7964. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7965. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7966. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7967. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7970. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7971. } while (0)
  7972. /* Dword 1: fisa_control_value disable_qos_check */
  7973. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7974. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7975. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7976. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7977. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7978. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7981. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7982. } while (0)
  7983. /* Dword 1: fisa_control_value disable_raw_check */
  7984. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7985. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7986. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7987. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7988. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7989. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7990. do { \
  7991. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7992. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7993. } while (0)
  7994. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7995. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7996. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7997. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7998. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7999. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  8000. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  8003. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  8004. } while (0)
  8005. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  8006. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  8007. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  8008. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  8009. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  8010. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  8011. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  8012. do { \
  8013. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  8014. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  8015. } while (0)
  8016. /* Dword 1: fisa_control_value fisa_aggr_limit */
  8017. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  8018. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  8019. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  8020. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  8021. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  8022. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  8023. do { \
  8024. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  8025. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  8026. } while (0)
  8027. /* Dword 1: fisa_control_value fisa config */
  8028. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  8029. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  8030. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  8031. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  8032. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  8033. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  8034. do { \
  8035. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  8036. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  8037. } while (0)
  8038. /* Dword 1: fisa_control_value fisa_aggr_limit */
  8039. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000007e
  8040. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  8041. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  8042. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  8043. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  8044. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  8045. do { \
  8046. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  8047. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  8048. } while (0)
  8049. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  8050. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  8051. pdev_id:8,
  8052. reserved0:16;
  8053. A_UINT32 num_records:20,
  8054. max_search:8,
  8055. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  8056. reserved1:2;
  8057. A_UINT32 base_addr_lo;
  8058. A_UINT32 base_addr_hi;
  8059. A_UINT32 toeplitz31_0;
  8060. A_UINT32 toeplitz63_32;
  8061. A_UINT32 toeplitz95_64;
  8062. A_UINT32 toeplitz127_96;
  8063. A_UINT32 toeplitz159_128;
  8064. A_UINT32 toeplitz191_160;
  8065. A_UINT32 toeplitz223_192;
  8066. A_UINT32 toeplitz255_224;
  8067. A_UINT32 toeplitz287_256;
  8068. A_UINT32 toeplitz314_288:27,
  8069. reserved2:5;
  8070. } POSTPACK;
  8071. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  8072. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  8073. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  8074. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  8075. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  8076. /* DWORD 0: Pdev ID */
  8077. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  8078. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  8079. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  8080. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  8081. HTT_RX_FSE_SETUP_PDEV_ID_S)
  8082. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  8085. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  8086. } while (0)
  8087. /* DWORD 1:num of records */
  8088. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  8089. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  8090. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  8091. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  8092. HTT_RX_FSE_SETUP_NUM_REC_S)
  8093. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  8094. do { \
  8095. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  8096. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  8097. } while (0)
  8098. /* DWORD 1:max_search */
  8099. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  8100. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  8101. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  8102. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  8103. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  8104. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  8105. do { \
  8106. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  8107. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  8108. } while (0)
  8109. /* DWORD 1:ip_da_sa prefix */
  8110. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  8111. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  8112. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  8113. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  8114. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  8115. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  8116. do { \
  8117. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  8118. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  8119. } while (0)
  8120. /* DWORD 2: Base Address LO */
  8121. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  8122. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  8123. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  8124. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  8125. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  8126. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  8127. do { \
  8128. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  8129. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  8130. } while (0)
  8131. /* DWORD 3: Base Address High */
  8132. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  8133. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  8134. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  8135. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  8136. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8137. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8138. do { \
  8139. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8140. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8141. } while (0)
  8142. /* DWORD 4-12: Hash Value */
  8143. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8144. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8145. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8146. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8147. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8148. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8149. do { \
  8150. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8151. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8152. } while (0)
  8153. /* DWORD 13: Hash Value 314:288 bits */
  8154. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8155. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8156. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8157. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8158. do { \
  8159. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8160. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8161. } while (0)
  8162. /**
  8163. * @brief Host-->target HTT RX FSE operation message
  8164. *
  8165. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8166. *
  8167. * @details
  8168. * The host will send this Flow Search Engine (FSE) operation message for
  8169. * every flow add/delete operation.
  8170. * The FSE operation includes FSE full cache invalidation or individual entry
  8171. * invalidation.
  8172. * This message can be sent per SOC or per PDEV which is differentiated
  8173. * by pdev id values.
  8174. *
  8175. * |31 16|15 8|7 1|0|
  8176. * |-------------------------------------------------------------|
  8177. * | reserved | pdev_id | MSG_TYPE |
  8178. * |-------------------------------------------------------------|
  8179. * | reserved | operation |I|
  8180. * |-------------------------------------------------------------|
  8181. * | ip_src_addr_31_0 |
  8182. * |-------------------------------------------------------------|
  8183. * | ip_src_addr_63_32 |
  8184. * |-------------------------------------------------------------|
  8185. * | ip_src_addr_95_64 |
  8186. * |-------------------------------------------------------------|
  8187. * | ip_src_addr_127_96 |
  8188. * |-------------------------------------------------------------|
  8189. * | ip_dst_addr_31_0 |
  8190. * |-------------------------------------------------------------|
  8191. * | ip_dst_addr_63_32 |
  8192. * |-------------------------------------------------------------|
  8193. * | ip_dst_addr_95_64 |
  8194. * |-------------------------------------------------------------|
  8195. * | ip_dst_addr_127_96 |
  8196. * |-------------------------------------------------------------|
  8197. * | l4_dst_port | l4_src_port |
  8198. * | (32-bit SPI incase of IPsec) |
  8199. * |-------------------------------------------------------------|
  8200. * | reserved | l4_proto |
  8201. * |-------------------------------------------------------------|
  8202. *
  8203. * where I is 1-bit ipsec_valid.
  8204. *
  8205. * The following field definitions describe the format of the RX FSE operation
  8206. * message sent from the host to target for every add/delete flow entry to flow
  8207. * table.
  8208. *
  8209. * Header fields:
  8210. * dword0 - b'7:0 - msg_type: This will be set to
  8211. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8212. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8213. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8214. * specified pdev's LMAC ring.
  8215. * b'31:16 - reserved : Reserved for future use
  8216. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8217. * (Internet Protocol Security).
  8218. * IPsec describes the framework for providing security at
  8219. * IP layer. IPsec is defined for both versions of IP:
  8220. * IPV4 and IPV6.
  8221. * Please refer to htt_rx_flow_proto enumeration below for
  8222. * more info.
  8223. * ipsec_valid = 1 for IPSEC packets
  8224. * ipsec_valid = 0 for IP Packets
  8225. * b'7:1 - operation: This indicates types of FSE operation.
  8226. * Refer to htt_rx_fse_operation enumeration:
  8227. * 0 - No Cache Invalidation required
  8228. * 1 - Cache invalidate only one entry given by IP
  8229. * src/dest address at DWORD[2:9]
  8230. * 2 - Complete FSE Cache Invalidation
  8231. * 3 - FSE Disable
  8232. * 4 - FSE Enable
  8233. * b'31:8 - reserved: Reserved for future use
  8234. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8235. * for per flow addition/deletion
  8236. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8237. * and the subsequent 3 A_UINT32 will be padding bytes.
  8238. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8239. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8240. * from 0 to 65535 but only 0 to 1023 are designated as
  8241. * well-known ports. Refer to [RFC1700] for more details.
  8242. * This field is valid only if
  8243. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8244. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8245. * range from 0 to 65535 but only 0 to 1023 are designated
  8246. * as well-known ports. Refer to [RFC1700] for more details.
  8247. * This field is valid only if
  8248. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8249. * - SPI (31:0): Security Parameters Index is an
  8250. * identification tag added to the header while using IPsec
  8251. * for tunneling the IP traffici.
  8252. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8253. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8254. * Assigned Internet Protocol Numbers.
  8255. * l4_proto numbers for standard protocol like UDP/TCP
  8256. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8257. * l4_proto = 17 for UDP etc.
  8258. * b'31:8 - reserved: Reserved for future use.
  8259. *
  8260. */
  8261. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8262. A_UINT32 msg_type:8,
  8263. pdev_id:8,
  8264. reserved0:16;
  8265. A_UINT32 ipsec_valid:1,
  8266. operation:7,
  8267. reserved1:24;
  8268. A_UINT32 ip_src_addr_31_0;
  8269. A_UINT32 ip_src_addr_63_32;
  8270. A_UINT32 ip_src_addr_95_64;
  8271. A_UINT32 ip_src_addr_127_96;
  8272. A_UINT32 ip_dest_addr_31_0;
  8273. A_UINT32 ip_dest_addr_63_32;
  8274. A_UINT32 ip_dest_addr_95_64;
  8275. A_UINT32 ip_dest_addr_127_96;
  8276. union {
  8277. A_UINT32 spi;
  8278. struct {
  8279. A_UINT32 l4_src_port:16,
  8280. l4_dest_port:16;
  8281. } ip;
  8282. } u;
  8283. A_UINT32 l4_proto:8,
  8284. reserved:24;
  8285. } POSTPACK;
  8286. /**
  8287. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8288. *
  8289. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8290. *
  8291. * @details
  8292. * The host will send this Full monitor mode register configuration message.
  8293. * This message can be sent per SOC or per PDEV which is differentiated
  8294. * by pdev id values.
  8295. *
  8296. * |31 16|15 11|10 8|7 3|2|1|0|
  8297. * |-------------------------------------------------------------|
  8298. * | reserved | pdev_id | MSG_TYPE |
  8299. * |-------------------------------------------------------------|
  8300. * | reserved |Release Ring |N|Z|E|
  8301. * |-------------------------------------------------------------|
  8302. *
  8303. * where E is 1-bit full monitor mode enable/disable.
  8304. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8305. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8306. *
  8307. * The following field definitions describe the format of the full monitor
  8308. * mode configuration message sent from the host to target for each pdev.
  8309. *
  8310. * Header fields:
  8311. * dword0 - b'7:0 - msg_type: This will be set to
  8312. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8313. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8314. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8315. * specified pdev's LMAC ring.
  8316. * b'31:16 - reserved : Reserved for future use.
  8317. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8318. * monitor mode rxdma register is to be enabled or disabled.
  8319. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8320. * additional descriptors at ppdu end for zero mpdus
  8321. * enabled or disabled.
  8322. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8323. * additional descriptors at ppdu end for non zero mpdus
  8324. * enabled or disabled.
  8325. * b'10:3 - release_ring: This indicates the destination ring
  8326. * selection for the descriptor at the end of PPDU
  8327. * 0 - REO ring select
  8328. * 1 - FW ring select
  8329. * 2 - SW ring select
  8330. * 3 - Release ring select
  8331. * Refer to htt_rx_full_mon_release_ring.
  8332. * b'31:11 - reserved for future use
  8333. */
  8334. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8335. A_UINT32 msg_type:8,
  8336. pdev_id:8,
  8337. reserved0:16;
  8338. A_UINT32 full_monitor_mode_enable:1,
  8339. addnl_descs_zero_mpdus_end:1,
  8340. addnl_descs_non_zero_mpdus_end:1,
  8341. release_ring:8,
  8342. reserved1:21;
  8343. } POSTPACK;
  8344. /**
  8345. * Enumeration for full monitor mode destination ring select
  8346. * 0 - REO destination ring select
  8347. * 1 - FW destination ring select
  8348. * 2 - SW destination ring select
  8349. * 3 - Release destination ring select
  8350. */
  8351. enum htt_rx_full_mon_release_ring {
  8352. HTT_RX_MON_RING_REO,
  8353. HTT_RX_MON_RING_FW,
  8354. HTT_RX_MON_RING_SW,
  8355. HTT_RX_MON_RING_RELEASE,
  8356. };
  8357. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8358. /* DWORD 0: Pdev ID */
  8359. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8360. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8361. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8362. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8363. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8364. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8367. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8368. } while (0)
  8369. /* DWORD 1:ENABLE */
  8370. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8371. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8372. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8375. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8376. } while (0)
  8377. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8378. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8379. /* DWORD 1:ZERO_MPDU */
  8380. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8381. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8382. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8383. do { \
  8384. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8385. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8386. } while (0)
  8387. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8388. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8389. /* DWORD 1:NON_ZERO_MPDU */
  8390. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8391. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8392. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8395. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8396. } while (0)
  8397. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8398. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8399. /* DWORD 1:RELEASE_RINGS */
  8400. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8401. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8402. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8403. do { \
  8404. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8405. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8406. } while (0)
  8407. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8408. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8409. /**
  8410. * Enumeration for IP Protocol or IPSEC Protocol
  8411. * IPsec describes the framework for providing security at IP layer.
  8412. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8413. */
  8414. enum htt_rx_flow_proto {
  8415. HTT_RX_FLOW_IP_PROTO,
  8416. HTT_RX_FLOW_IPSEC_PROTO,
  8417. };
  8418. /**
  8419. * Enumeration for FSE Cache Invalidation
  8420. * 0 - No Cache Invalidation required
  8421. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8422. * 2 - Complete FSE Cache Invalidation
  8423. * 3 - FSE Disable
  8424. * 4 - FSE Enable
  8425. */
  8426. enum htt_rx_fse_operation {
  8427. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8428. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8429. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8430. HTT_RX_FSE_DISABLE,
  8431. HTT_RX_FSE_ENABLE,
  8432. };
  8433. /* DWORD 0: Pdev ID */
  8434. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8435. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8436. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8437. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8438. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8439. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8442. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8443. } while (0)
  8444. /* DWORD 1:IP PROTO or IPSEC */
  8445. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8446. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8447. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8448. do { \
  8449. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8450. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8451. } while (0)
  8452. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8453. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8454. /* DWORD 1:FSE Operation */
  8455. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8456. #define HTT_RX_FSE_OPERATION_S 1
  8457. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8458. do { \
  8459. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8460. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8461. } while (0)
  8462. #define HTT_RX_FSE_OPERATION_GET(word) \
  8463. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8464. /* DWORD 2-9:IP Address */
  8465. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8466. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8467. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8468. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8469. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8470. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8471. do { \
  8472. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8473. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8474. } while (0)
  8475. /* DWORD 10:Source Port Number */
  8476. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8477. #define HTT_RX_FSE_SOURCEPORT_S 0
  8478. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8481. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8482. } while (0)
  8483. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8484. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8485. /* DWORD 11:Destination Port Number */
  8486. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8487. #define HTT_RX_FSE_DESTPORT_S 16
  8488. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8491. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8492. } while (0)
  8493. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8494. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8495. /* DWORD 10-11:SPI (In case of IPSEC) */
  8496. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8497. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8498. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8499. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8500. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8501. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8504. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8505. } while (0)
  8506. /* DWORD 12:L4 PROTO */
  8507. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8508. #define HTT_RX_FSE_L4_PROTO_S 0
  8509. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8510. do { \
  8511. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8512. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8513. } while (0)
  8514. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8515. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8516. /**
  8517. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8518. *
  8519. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8520. *
  8521. * |31 24|23 |15 8|7 2|1|0|
  8522. * |----------------+----------------+----------------+----------------|
  8523. * | reserved | pdev_id | msg_type |
  8524. * |---------------------------------+----------------+----------------|
  8525. * | reserved |E|F|
  8526. * |---------------------------------+----------------+----------------|
  8527. * Where E = Configure the target to provide the 3-tuple hash value in
  8528. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8529. * F = Configure the target to provide the 3-tuple hash value in
  8530. * flow_id_toeplitz field of rx_msdu_start tlv
  8531. *
  8532. * The following field definitions describe the format of the 3 tuple hash value
  8533. * message sent from the host to target as part of initialization sequence.
  8534. *
  8535. * Header fields:
  8536. * dword0 - b'7:0 - msg_type: This will be set to
  8537. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8538. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8539. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8540. * specified pdev's LMAC ring.
  8541. * b'31:16 - reserved : Reserved for future use
  8542. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8543. * b'1 - toeplitz_hash_2_or_4_field_enable
  8544. * b'31:2 - reserved : Reserved for future use
  8545. * ---------+------+----------------------------------------------------------
  8546. * bit1 | bit0 | Functionality
  8547. * ---------+------+----------------------------------------------------------
  8548. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8549. * | | in flow_id_toeplitz field
  8550. * ---------+------+----------------------------------------------------------
  8551. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8552. * | | in toeplitz_hash_2_or_4 field
  8553. * ---------+------+----------------------------------------------------------
  8554. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8555. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8556. * ---------+------+----------------------------------------------------------
  8557. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8558. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8559. * | | toeplitz_hash_2_or_4 field
  8560. *----------------------------------------------------------------------------
  8561. */
  8562. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8563. A_UINT32 msg_type :8,
  8564. pdev_id :8,
  8565. reserved0 :16;
  8566. A_UINT32 flow_id_toeplitz_field_enable :1,
  8567. toeplitz_hash_2_or_4_field_enable :1,
  8568. reserved1 :30;
  8569. } POSTPACK;
  8570. /* DWORD0 : pdev_id configuration Macros */
  8571. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8572. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8573. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8574. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8575. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8576. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8577. do { \
  8578. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8579. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8580. } while (0)
  8581. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8582. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8583. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8584. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8585. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8586. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8587. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8588. do { \
  8589. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8590. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8591. } while (0)
  8592. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8593. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8594. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8595. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8596. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8597. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8598. do { \
  8599. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8600. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8601. } while (0)
  8602. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8603. /**
  8604. * @brief host --> target Host PA Address Size
  8605. *
  8606. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8607. *
  8608. * @details
  8609. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8610. * provide the physical start address and size of each of the memory
  8611. * areas within host DDR that the target FW may need to access.
  8612. *
  8613. * For example, the host can use this message to allow the target FW
  8614. * to set up access to the host's pools of TQM link descriptors.
  8615. * The message would appear as follows:
  8616. *
  8617. * |31 24|23 16|15 8|7 0|
  8618. * |----------------+----------------+----------------+----------------|
  8619. * | reserved | num_entries | msg_type |
  8620. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8621. * | mem area 0 size |
  8622. * |----------------+----------------+----------------+----------------|
  8623. * | mem area 0 physical_address_lo |
  8624. * |----------------+----------------+----------------+----------------|
  8625. * | mem area 0 physical_address_hi |
  8626. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8627. * | mem area 1 size |
  8628. * |----------------+----------------+----------------+----------------|
  8629. * | mem area 1 physical_address_lo |
  8630. * |----------------+----------------+----------------+----------------|
  8631. * | mem area 1 physical_address_hi |
  8632. * |----------------+----------------+----------------+----------------|
  8633. * ...
  8634. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8635. * | mem area N size |
  8636. * |----------------+----------------+----------------+----------------|
  8637. * | mem area N physical_address_lo |
  8638. * |----------------+----------------+----------------+----------------|
  8639. * | mem area N physical_address_hi |
  8640. * |----------------+----------------+----------------+----------------|
  8641. *
  8642. * The message is interpreted as follows:
  8643. * dword0 - b'0:7 - msg_type: This will be set to
  8644. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8645. * b'8:15 - number_entries: Indicated the number of host memory
  8646. * areas specified within the remainder of the message
  8647. * b'16:31 - reserved.
  8648. * dword1 - b'0:31 - memory area 0 size in bytes
  8649. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8650. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8651. * and similar for memory area 1 through memory area N.
  8652. */
  8653. PREPACK struct htt_h2t_host_paddr_size {
  8654. A_UINT32 msg_type: 8,
  8655. num_entries: 8,
  8656. reserved: 16;
  8657. } POSTPACK;
  8658. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8659. A_UINT32 size;
  8660. A_UINT32 physical_address_lo;
  8661. A_UINT32 physical_address_hi;
  8662. } POSTPACK;
  8663. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8664. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8665. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8666. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8667. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8668. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8669. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8670. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8671. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8672. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8673. do { \
  8674. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8675. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8676. } while (0)
  8677. /**
  8678. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8679. *
  8680. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8681. *
  8682. * @details
  8683. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8684. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8685. *
  8686. * The message would appear as follows:
  8687. *
  8688. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8689. * |---------------------------------+---+---+----------+-+-----------|
  8690. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8691. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8692. *
  8693. *
  8694. * The message is interpreted as follows:
  8695. * dword0 - b'0:7 - msg_type: This will be set to
  8696. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8697. * b'8 - override bit to drive MSDUs to PPE ring
  8698. * b'9:13 - REO destination ring indication
  8699. * b'14 - Multi buffer msdu override enable bit
  8700. * b'15 - Intra BSS override
  8701. * b'16 - Decap raw override
  8702. * b'17 - Decap Native wifi override
  8703. * b'18 - IP frag override
  8704. * b'19:31 - reserved
  8705. */
  8706. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8707. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8708. override: 1,
  8709. reo_destination_indication: 5,
  8710. multi_buffer_msdu_override_en: 1,
  8711. intra_bss_override: 1,
  8712. decap_raw_override: 1,
  8713. decap_nwifi_override: 1,
  8714. ip_frag_override: 1,
  8715. reserved: 13;
  8716. } POSTPACK;
  8717. /* DWORD 0: Override */
  8718. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8719. #define HTT_PPE_CFG_OVERRIDE_S 8
  8720. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8721. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8722. HTT_PPE_CFG_OVERRIDE_S)
  8723. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8726. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8727. } while (0)
  8728. /* DWORD 0: REO Destination Indication*/
  8729. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8730. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8731. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8732. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8733. HTT_PPE_CFG_REO_DEST_IND_S)
  8734. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8735. do { \
  8736. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8737. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8738. } while (0)
  8739. /* DWORD 0: Multi buffer MSDU override */
  8740. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8741. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8742. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8743. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8744. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8745. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8746. do { \
  8747. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8748. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8749. } while (0)
  8750. /* DWORD 0: Intra BSS override */
  8751. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8752. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8753. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8754. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8755. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8756. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8757. do { \
  8758. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8759. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8760. } while (0)
  8761. /* DWORD 0: Decap RAW override */
  8762. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8763. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8764. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8765. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8766. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8767. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8768. do { \
  8769. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8770. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8771. } while (0)
  8772. /* DWORD 0: Decap NWIFI override */
  8773. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8774. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8775. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8776. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8777. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8778. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8779. do { \
  8780. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8781. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8782. } while (0)
  8783. /* DWORD 0: IP frag override */
  8784. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8785. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8786. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8787. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8788. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8789. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8790. do { \
  8791. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8792. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8793. } while (0)
  8794. /*
  8795. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8796. *
  8797. * @details
  8798. * The following field definitions describe the format of the HTT host
  8799. * to target FW VDEV TX RX stats retrieve message.
  8800. * The message specifies the type of stats the host wants to retrieve.
  8801. *
  8802. * |31 27|26 25|24 17|16|15 8|7 0|
  8803. * |-----------------------------------------------------------|
  8804. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8805. * |-----------------------------------------------------------|
  8806. * | vdev_id lower bitmask |
  8807. * |-----------------------------------------------------------|
  8808. * | vdev_id upper bitmask |
  8809. * |-----------------------------------------------------------|
  8810. * Header fields:
  8811. * Where:
  8812. * dword0 - b'7:0 - msg_type: This will be set to
  8813. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8814. * b'15:8 - pdev id
  8815. * b'16(E) - Enable/Disable the vdev HW stats
  8816. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8817. * b'25:26(R) - Reset stats bits
  8818. * 0: don't reset stats
  8819. * 1: reset stats once
  8820. * 2: reset stats at the start of each periodic interval
  8821. * b'27:31 - reserved for future use
  8822. * dword1 - b'0:31 - vdev_id lower bitmask
  8823. * dword2 - b'0:31 - vdev_id upper bitmask
  8824. */
  8825. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8826. A_UINT32 msg_type :8,
  8827. pdev_id :8,
  8828. enable :1,
  8829. periodic_interval :8,
  8830. reset_stats_bits :2,
  8831. reserved0 :5;
  8832. A_UINT32 vdev_id_lower_bitmask;
  8833. A_UINT32 vdev_id_upper_bitmask;
  8834. } POSTPACK;
  8835. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8836. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8837. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8838. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8839. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8840. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8843. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8844. } while (0)
  8845. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8846. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8847. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8848. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8849. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8850. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8851. do { \
  8852. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8853. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8854. } while (0)
  8855. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8856. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8857. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8858. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8859. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8860. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8861. do { \
  8862. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8863. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8864. } while (0)
  8865. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8866. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8867. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8868. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8869. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8870. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8871. do { \
  8872. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8873. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8874. } while (0)
  8875. /*
  8876. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8877. *
  8878. * @details
  8879. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8880. * the default MSDU queues for one of the TIDs within the specified peer
  8881. * to the specified service class.
  8882. * The TID is indirectly specified - each service class is associated
  8883. * with a TID. All default MSDU queues for this peer-TID will be
  8884. * linked to the service class in question.
  8885. *
  8886. * |31 16|15 8|7 0|
  8887. * |------------------------------+--------------+--------------|
  8888. * | peer ID | svc class ID | msg type |
  8889. * |------------------------------------------------------------|
  8890. * Header fields:
  8891. * dword0 - b'7:0 - msg_type: This will be set to
  8892. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8893. * b'15:8 - service class ID
  8894. * b'31:16 - peer ID
  8895. */
  8896. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8897. A_UINT32 msg_type :8,
  8898. svc_class_id :8,
  8899. peer_id :16;
  8900. } POSTPACK;
  8901. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8902. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8903. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8904. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8905. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8906. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8907. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8908. do { \
  8909. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8910. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8911. } while (0)
  8912. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8913. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8914. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8915. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8916. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8917. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8918. do { \
  8919. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8920. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8921. } while (0)
  8922. /*
  8923. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8924. *
  8925. * @details
  8926. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8927. * remove the linkage of the specified peer-TID's MSDU queues to
  8928. * service classes.
  8929. *
  8930. * |31 16|15 8|7 0|
  8931. * |------------------------------+--------------+--------------|
  8932. * | peer ID | svc class ID | msg type |
  8933. * |------------------------------------------------------------|
  8934. * Header fields:
  8935. * dword0 - b'7:0 - msg_type: This will be set to
  8936. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8937. * b'15:8 - service class ID
  8938. * b'31:16 - peer ID
  8939. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8940. * value for peer ID indicates that the target should
  8941. * apply the UNMAP_REQ to all peers.
  8942. */
  8943. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8944. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8945. A_UINT32 msg_type :8,
  8946. svc_class_id :8,
  8947. peer_id :16;
  8948. } POSTPACK;
  8949. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8950. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8951. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8952. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8953. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8954. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8955. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8956. do { \
  8957. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8958. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8959. } while (0)
  8960. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8961. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8962. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8963. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8964. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8965. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8966. do { \
  8967. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8968. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8969. } while (0)
  8970. /*
  8971. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8972. *
  8973. * @details
  8974. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8975. * request the target to report what service class the default MSDU queues
  8976. * of the specified TIDs within the peer are linked to.
  8977. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8978. * to report what service class (if any) the default MSDU queues for
  8979. * each of the specified TIDs are linked to.
  8980. *
  8981. * |31 16|15 8|7 1| 0|
  8982. * |------------------------------+--------------+--------------|
  8983. * | peer ID | TID mask | msg type |
  8984. * |------------------------------------------------------------|
  8985. * | reserved |ETO|
  8986. * |------------------------------------------------------------|
  8987. * Header fields:
  8988. * dword0 - b'7:0 - msg_type: This will be set to
  8989. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8990. * b'15:8 - TID mask
  8991. * b'31:16 - peer ID
  8992. * dword1 - b'0 - "Existing Tids Only" flag
  8993. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8994. * message generated by this REQ will only show the
  8995. * mapping for TIDs that actually exist in the target's
  8996. * peer object.
  8997. * Any TIDs that are covered by a MAP_REQ but which
  8998. * do not actually exist will be shown as being
  8999. * unmapped (i.e. svc class ID 0xff).
  9000. * If this flag is cleared, the MAP_REPORT_CONF message
  9001. * will consider not only the mapping of TIDs currently
  9002. * existing in the peer, but also the mapping that will
  9003. * be applied for any TID objects created within this
  9004. * peer in the future.
  9005. * b'31:1 - reserved for future use
  9006. */
  9007. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  9008. A_UINT32 msg_type :8,
  9009. tid_mask :8,
  9010. peer_id :16;
  9011. A_UINT32 existing_tids_only:1,
  9012. reserved :31;
  9013. } POSTPACK;
  9014. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  9015. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  9016. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  9017. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  9018. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  9019. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  9020. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  9023. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  9024. } while (0)
  9025. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  9026. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  9027. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  9028. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  9029. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  9030. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  9031. do { \
  9032. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  9033. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  9034. } while (0)
  9035. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  9036. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  9037. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  9038. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  9039. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  9040. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  9041. do { \
  9042. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  9043. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  9044. } while (0)
  9045. /**
  9046. * @brief Format of shared memory between Host and Target
  9047. * for UMAC recovery feature messaging.
  9048. * @details
  9049. * This is shared memory between Host and Target allocated
  9050. * and used in chips where UMAC recovery feature is supported.
  9051. * This shared memory is allocated per SOC level by Host since each
  9052. * SOC's target Q6FW needs to communicate independently to the Host
  9053. * through its own shared memory.
  9054. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  9055. * then host interprets it as a new message from target.
  9056. * Host clears that particular read bit in t2h_msg after each read
  9057. * operation. It is vice versa for h2t_msg. At any given point
  9058. * of time there is expected to be only one bit set
  9059. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  9060. *
  9061. * The message is interpreted as follows:
  9062. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  9063. * added for debuggability purpose.
  9064. * dword1 - b'0 - do_pre_reset
  9065. * b'1 - do_post_reset_start
  9066. * b'2 - do_post_reset_complete
  9067. * b'3 - initiate_umac_recovery
  9068. * b'4 - initiate_target_recovery_sync_using_umac
  9069. * b'5:31 - rsvd_t2h
  9070. * dword2 - b'0 - pre_reset_done
  9071. * b'1 - post_reset_start_done
  9072. * b'2 - post_reset_complete_done
  9073. * b'3 - start_pre_reset (deprecated)
  9074. * b'4:31 - rsvd_h2t
  9075. */
  9076. PREPACK typedef struct {
  9077. /** Magic number added for debuggability. */
  9078. A_UINT32 magic_num;
  9079. union {
  9080. /*
  9081. * BIT [0] :- T2H msg to do pre-reset
  9082. * BIT [1] :- T2H msg to do post-reset start
  9083. * BIT [2] :- T2H msg to do post-reset complete
  9084. * BIT [3] :- T2H msg to indicate to Host that
  9085. * a trigger request for MLO UMAC Recovery
  9086. * is received for UMAC hang.
  9087. * BIT [4] :- T2H msg to indicate to Host that
  9088. * a trigger request for MLO UMAC Recovery
  9089. * is received for Mode-1 Target Recovery.
  9090. * BIT [31 : 5] :- reserved
  9091. */
  9092. A_UINT32 t2h_msg;
  9093. struct {
  9094. A_UINT32
  9095. do_pre_reset: 1, /* BIT [0] */
  9096. do_post_reset_start: 1, /* BIT [1] */
  9097. do_post_reset_complete: 1, /* BIT [2] */
  9098. initiate_umac_recovery: 1, /* BIT [3] */
  9099. initiate_target_recovery_sync_using_umac: 1, /* BIT [4] */
  9100. rsvd_t2h: 27; /* BIT [31:5] */
  9101. };
  9102. };
  9103. union {
  9104. /*
  9105. * BIT [0] :- H2T msg to send pre-reset done
  9106. * BIT [1] :- H2T msg to send post-reset start done
  9107. * BIT [2] :- H2T msg to send post-reset complete done
  9108. * BIT [3] :- H2T msg to start pre-reset. This is deprecated.
  9109. * BIT [31 : 4] :- reserved
  9110. */
  9111. A_UINT32 h2t_msg;
  9112. struct {
  9113. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  9114. post_reset_start_done : 1, /* BIT [1] */
  9115. post_reset_complete_done : 1, /* BIT [2] */
  9116. start_pre_reset : 1, /* BIT [3] */
  9117. rsvd_h2t : 28; /* BIT [31 : 4] */
  9118. };
  9119. };
  9120. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  9121. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  9122. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  9123. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  9124. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  9125. /* dword1 - b'0 - do_pre_reset */
  9126. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  9127. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  9128. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  9129. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  9130. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  9131. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  9132. do { \
  9133. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  9134. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  9135. } while (0)
  9136. /* dword1 - b'1 - do_post_reset_start */
  9137. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  9138. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  9139. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9140. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9141. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9142. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9143. do { \
  9144. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9145. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9146. } while (0)
  9147. /* dword1 - b'2 - do_post_reset_complete */
  9148. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9149. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9150. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9151. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9152. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9153. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9154. do { \
  9155. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9156. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9157. } while (0)
  9158. /* dword1 - b'3 - initiate_umac_recovery */
  9159. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9160. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9161. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9162. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9163. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9164. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9167. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9168. } while (0)
  9169. /* dword1 - b'4 - initiate_target_recovery_sync_using_umac */
  9170. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M 0x00000010
  9171. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S 4
  9172. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_GET(word1) \
  9173. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M) >> \
  9174. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S)
  9175. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_SET(word1, _val) \
  9176. do { \
  9177. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC, _val); \
  9178. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S));\
  9179. } while (0)
  9180. /* dword2 - b'0 - pre_reset_done */
  9181. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9182. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9183. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9184. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9185. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9186. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9187. do { \
  9188. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9189. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9190. } while (0)
  9191. /* dword2 - b'1 - post_reset_start_done */
  9192. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9193. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9194. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9195. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9196. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9197. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9198. do { \
  9199. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9200. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9201. } while (0)
  9202. /* dword2 - b'2 - post_reset_complete_done */
  9203. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9204. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9205. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9206. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9207. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9208. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9211. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9212. } while (0)
  9213. /* dword2 - b'3 - start_pre_reset */
  9214. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9215. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9216. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9217. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9218. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9219. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9220. do { \
  9221. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9222. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9223. } while (0)
  9224. /**
  9225. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9226. *
  9227. * @details
  9228. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9229. * by the host to provide prerequisite info to target for the UMAC hang
  9230. * recovery feature.
  9231. * The info sent in this H2T message are T2H message method, H2T message
  9232. * method, T2H MSI interrupt number and physical start address, size of
  9233. * the shared memory (refers to the shared memory dedicated for messaging
  9234. * between host and target when the DUT is in UMAC hang recovery mode).
  9235. * This H2T message is expected to be only sent if the WMI service bit
  9236. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9237. *
  9238. * |31 16|15 12|11 8|7 0|
  9239. * |-------------------------------+--------------+--------------+------------|
  9240. * | reserved |h2t msg method|t2h msg method| msg_type |
  9241. * |--------------------------------------------------------------------------|
  9242. * | t2h msi interrupt number |
  9243. * |--------------------------------------------------------------------------|
  9244. * | shared memory area size |
  9245. * |--------------------------------------------------------------------------|
  9246. * | shared memory area physical address low |
  9247. * |--------------------------------------------------------------------------|
  9248. * | shared memory area physical address high |
  9249. * |--------------------------------------------------------------------------|
  9250. *
  9251. * The message is interpreted as follows:
  9252. * dword0 - b'0:7 - msg_type
  9253. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9254. * b'8:11 - t2h_msg_method: indicates method to be used for
  9255. * T2H communication in UMAC hang recovery mode.
  9256. * Value zero indicates MSI interrupt (default method).
  9257. * Refer to htt_umac_hang_recovery_msg_method enum.
  9258. * b'12:15 - h2t_msg_method: indicates method to be used for
  9259. * H2T communication in UMAC hang recovery mode.
  9260. * Value zero indicates polling by target for this h2t msg
  9261. * during UMAC hang recovery mode.
  9262. * Refer to htt_umac_hang_recovery_msg_method enum.
  9263. * b'16:31 - reserved.
  9264. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9265. * T2H communication in UMAC hang recovery mode.
  9266. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9267. * only when in UMAC hang recovery mode.
  9268. * This refers to size in bytes.
  9269. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9270. * of the shared memory dedicated for messaging only when
  9271. * in UMAC hang recovery mode.
  9272. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9273. * of the shared memory dedicated for messaging only when
  9274. * in UMAC hang recovery mode.
  9275. */
  9276. /* t2h_msg_method and h2t_msg_method */
  9277. enum htt_umac_hang_recovery_msg_method {
  9278. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9279. };
  9280. PREPACK typedef struct {
  9281. A_UINT32 msg_type : 8,
  9282. t2h_msg_method : 4,
  9283. h2t_msg_method : 4,
  9284. reserved : 16;
  9285. A_UINT32 t2h_msi_data;
  9286. /* size bytes and physical address of shared memory. */
  9287. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9288. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9289. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9290. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9291. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9292. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9293. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9294. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9295. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9296. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9297. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9298. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9299. do { \
  9300. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9301. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9302. } while (0)
  9303. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9304. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9305. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9306. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9307. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9308. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9309. do { \
  9310. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9311. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9312. } while (0)
  9313. /**
  9314. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9315. *
  9316. * @details
  9317. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9318. * HTT message sent by the host to indicate that the target needs to start the
  9319. * UMAC hang recovery feature from the point of pre-reset routine.
  9320. * The purpose of this H2T message is to have host synchronize and trigger
  9321. * UMAC recovery across all targets.
  9322. * The info sent in this H2T message is the flag to indicate whether the
  9323. * target needs to execute UMAC-recovery in context of the Initiator or
  9324. * Non-Initiator.
  9325. * This H2T message is expected to be sent as response to the
  9326. * initiate_umac_recovery indication from the Initiator target attached to
  9327. * this same host.
  9328. * This H2T message is expected to be only sent if the WMI service bit
  9329. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9330. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9331. * beforehand.
  9332. *
  9333. * |31 10|9|8|7 0|
  9334. * |-----------------------------------------------------------|
  9335. * | reserved |U|I| msg_type |
  9336. * |-----------------------------------------------------------|
  9337. * Where:
  9338. * I = is_initiator
  9339. * U = is_umac_hang
  9340. *
  9341. * The message is interpreted as follows:
  9342. * dword0 - b'0:7 - msg_type
  9343. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9344. * b'8 - is_initiator: indicates whether the target needs to
  9345. * execute the UMAC-recovery in context of the Initiator or
  9346. * Non-Initiator.
  9347. * The value zero indicates this target is Non-Initiator.
  9348. * b'9 - is_umac_hang: indicates whether MLO UMAC recovery
  9349. * executed in context of UMAC hang or Target recovery.
  9350. * b'10:31 - reserved.
  9351. */
  9352. PREPACK typedef struct {
  9353. A_UINT32 msg_type : 8,
  9354. is_initiator : 1,
  9355. is_umac_hang : 1,
  9356. reserved : 22;
  9357. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9358. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9359. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9360. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9361. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9362. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9363. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9364. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9365. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9366. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9367. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9368. do { \
  9369. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9370. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9371. } while (0)
  9372. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M 0x00000200
  9373. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S 9
  9374. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_GET(word0) \
  9375. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M) >> \
  9376. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S)
  9377. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_SET(word0, _val) \
  9378. do { \
  9379. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG, _val); \
  9380. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S));\
  9381. } while (0)
  9382. /*
  9383. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9384. *
  9385. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9386. *
  9387. * @details
  9388. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9389. * install or uninstall rx cce super rules to match certain kind of packets
  9390. * with specific parameters. Target sets up HW registers based on setup message
  9391. * and always confirms back to Host.
  9392. *
  9393. * The message would appear as follows:
  9394. * |31 24|23 16|15 8|7 0|
  9395. * |-----------------+-----------------+-----------------+-----------------|
  9396. * | reserved | operation | pdev_id | msg_type |
  9397. * |-----------------------------------------------------------------------|
  9398. * | cce_super_rule_param[0] |
  9399. * |-----------------------------------------------------------------------|
  9400. * | cce_super_rule_param[1] |
  9401. * |-----------------------------------------------------------------------|
  9402. *
  9403. * The message is interpreted as follows:
  9404. * dword0 - b'0:7 - msg_type: This will be set to
  9405. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9406. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is for
  9407. * b'16:23 - operation: Identify operation to be taken,
  9408. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9409. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9410. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9411. * b'24:31 - reserved
  9412. * dword1~10 - cce_super_rule_param[0]:
  9413. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9414. * dword11~20 - cce_super_rule_param[1]:
  9415. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9416. *
  9417. * Each cce_super_rule_param structure would appear as follows:
  9418. * |31 24|23 16|15 8|7 0|
  9419. * |-----------------+-----------------+-----------------+-----------------|
  9420. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9421. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9422. * |-----------------------------------------------------------------------|
  9423. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9424. * |-----------------------------------------------------------------------|
  9425. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9426. * |-----------------------------------------------------------------------|
  9427. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9428. * |-----------------------------------------------------------------------|
  9429. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9430. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9431. * |-----------------------------------------------------------------------|
  9432. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9433. * |-----------------------------------------------------------------------|
  9434. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9435. * |-----------------------------------------------------------------------|
  9436. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9437. * |-----------------------------------------------------------------------|
  9438. * | is_valid | l4_type | l3_type |
  9439. * |-----------------------------------------------------------------------|
  9440. * | l4_dst_port | l4_src_port |
  9441. * |-----------------------------------------------------------------------|
  9442. *
  9443. * The cce_super_rule_param[0] structure is interpreted as follows:
  9444. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9445. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9446. * in case of ipv4)
  9447. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9448. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9449. * in case of ipv4)
  9450. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9451. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9452. * in case of ipv4)
  9453. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9454. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9455. * in case of ipv4)
  9456. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9457. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9458. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9459. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9460. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9461. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9462. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9463. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9464. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9465. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9466. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9467. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9468. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9469. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9470. * ipv4 address, in case of ipv4)
  9471. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9472. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9473. * ipv4 address, in case of ipv4)
  9474. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9475. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9476. * ipv4 address, in case of ipv4)
  9477. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9478. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9479. * ipv4 address, in case of ipv4)
  9480. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9481. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9482. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9483. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9484. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9485. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9486. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9487. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9488. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9489. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9490. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9491. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9492. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9493. * 0x0008: ipv4
  9494. * 0xdd86: ipv6
  9495. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9496. * 6: TCP
  9497. * 17: UDP
  9498. * b'24:31 - is_valid: indicate whether this parameter is valid
  9499. * 0: invalid
  9500. * 1: valid
  9501. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9502. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9503. *
  9504. * The cce_super_rule_param[1] structure is similar.
  9505. */
  9506. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9507. enum htt_rx_cce_super_rule_setup_operation {
  9508. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9509. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9510. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9511. /* All operation should be before this */
  9512. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9513. };
  9514. typedef struct {
  9515. union {
  9516. A_UINT8 src_ipv4_addr[4];
  9517. A_UINT8 src_ipv6_addr[16];
  9518. };
  9519. union {
  9520. A_UINT8 dst_ipv4_addr[4];
  9521. A_UINT8 dst_ipv6_addr[16];
  9522. };
  9523. A_UINT32 l3_type: 16,
  9524. l4_type: 8,
  9525. is_valid: 8;
  9526. A_UINT32 l4_src_port: 16,
  9527. l4_dst_port: 16;
  9528. } htt_rx_cce_super_rule_param_t;
  9529. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9530. A_UINT32 msg_type: 8,
  9531. pdev_id: 8,
  9532. operation: 8,
  9533. reserved: 8;
  9534. htt_rx_cce_super_rule_param_t
  9535. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9536. } POSTPACK;
  9537. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9538. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9539. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M 0x0000ff00
  9540. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S 8
  9541. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_GET(_var) \
  9542. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M) >> \
  9543. HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)
  9544. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_SET(_var, _val) \
  9545. do { \
  9546. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID, _val); \
  9547. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)); \
  9548. } while (0)
  9549. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9550. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9551. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9552. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9553. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9554. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9555. do { \
  9556. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9557. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9558. } while (0)
  9559. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9560. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9561. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9562. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9563. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9564. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9565. do { \
  9566. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9567. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9568. } while (0)
  9569. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9570. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9571. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9572. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9573. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9574. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9575. do { \
  9576. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9577. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9578. } while (0)
  9579. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9580. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9581. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9582. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9583. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9584. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9585. do { \
  9586. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9587. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9588. } while (0)
  9589. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9590. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9591. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9592. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9593. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9594. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9597. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9598. } while (0)
  9599. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9600. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9601. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9602. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9603. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9604. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9605. do { \
  9606. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9607. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9608. } while (0)
  9609. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9610. do { \
  9611. A_MEMCPY(_array, _ptr, 4); \
  9612. } while (0)
  9613. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9614. do { \
  9615. A_MEMCPY(_ptr, _array, 4); \
  9616. } while (0)
  9617. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9618. do { \
  9619. A_MEMCPY(_array, _ptr, 16); \
  9620. } while (0)
  9621. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9622. do { \
  9623. A_MEMCPY(_ptr, _array, 16); \
  9624. } while (0)
  9625. /**
  9626. * htt_h2t_primary_link_peer_status_type -
  9627. * Unique number for each status or reasons
  9628. * The status reasons can go up to 255 max
  9629. */
  9630. enum htt_h2t_primary_link_peer_status_type {
  9631. /* Host Primary Link Peer migration Success */
  9632. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_OK = 0,
  9633. /* keep this last */
  9634. /* Host Primary Link Peer migration Fail */
  9635. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_FAIL = 254,
  9636. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_NUM_STATUS = 255
  9637. };
  9638. /**
  9639. * @brief host -> Primary peer migration completion message from host
  9640. *
  9641. * MSG_TYPE => HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP
  9642. *
  9643. * @details
  9644. * HTT_H2T_MSG_TYPE_PRIMARY_PEER_MIGRATE_RESP message is sent by host to
  9645. * target Confirming that primary link peer migration has completed,
  9646. * in response to a HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  9647. * message from the target.
  9648. *
  9649. * The message would appear as follows:
  9650. *
  9651. * |31 25|24|23 16|15 12|11 8|7 0|
  9652. * |----------------------------+----------+---------+--------------|
  9653. * | vdev ID | pdev ID | chip ID | msg type |
  9654. * |----------------------------+----------+---------+--------------|
  9655. * | ML peer ID | SW peer ID |
  9656. * |------------+--+------------+--------------------+--------------|
  9657. * | reserved |SV| src_info | status |
  9658. * |------------+--+---------------------------------+--------------|
  9659. * Where:
  9660. * SV = src_info_valid flag
  9661. *
  9662. * The message is interpreted as follows:
  9663. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  9664. * (HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP)
  9665. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  9666. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  9667. * as primary
  9668. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  9669. * as primary
  9670. *
  9671. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  9672. * chosen as primary
  9673. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  9674. * primary peer belongs.
  9675. * dword2 - b'0:7 - status: Indicates the status of Rx/TCL migration
  9676. * b'8:23 - src_info: Indicates New Virtual port number through
  9677. * which Rx Pipe connects to the correct PPE.
  9678. * b'24 - src_info_valid: Indicates src_info is valid.
  9679. */
  9680. typedef struct {
  9681. A_UINT32 msg_type: 8, /* bits 7:0 */
  9682. chip_id: 4, /* bits 11:8 */
  9683. pdev_id: 4, /* bits 15:12 */
  9684. vdev_id: 16; /* bits 31:16 */
  9685. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  9686. ml_peer_id: 16; /* bits 31:16 */
  9687. A_UINT32 status: 8, /* bits 7:0 */
  9688. src_info: 16, /* bits 23:8 */
  9689. src_info_valid: 1, /* bit 24 */
  9690. reserved: 7; /* bits 31:25 */
  9691. } htt_h2t_primary_link_peer_migrate_resp_t;
  9692. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  9693. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  9694. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  9695. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  9696. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  9697. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  9698. do { \
  9699. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  9700. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  9701. } while (0)
  9702. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  9703. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  9704. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  9705. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  9706. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  9707. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  9708. do { \
  9709. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  9710. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  9711. } while (0)
  9712. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  9713. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  9714. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  9715. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  9716. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  9717. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  9718. do { \
  9719. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  9720. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  9721. } while (0)
  9722. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  9723. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  9724. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  9725. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  9726. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  9727. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  9728. do { \
  9729. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  9730. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  9731. } while (0)
  9732. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  9733. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  9734. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  9735. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  9736. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  9737. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  9738. do { \
  9739. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  9740. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  9741. } while (0)
  9742. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M 0x000000FF
  9743. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S 0
  9744. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_GET(_var) \
  9745. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M) >> \
  9746. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S)
  9747. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_SET(_var, _val) \
  9748. do { \
  9749. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS, _val); \
  9750. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S));\
  9751. } while (0)
  9752. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M 0x00FFFF00
  9753. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S 8
  9754. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_GET(_var) \
  9755. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M) >> \
  9756. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S)
  9757. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_SET(_var, _val) \
  9758. do { \
  9759. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO, _val); \
  9760. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S));\
  9761. } while (0)
  9762. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M 0x01000000
  9763. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S 24
  9764. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_GET(_var) \
  9765. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M) >> \
  9766. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S)
  9767. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_SET(_var, _val) \
  9768. do { \
  9769. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID, _val); \
  9770. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S));\
  9771. } while (0)
  9772. /**
  9773. * @brief host -> tgt msg to configure params for PPDU tx latency stats report
  9774. *
  9775. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_LATENCY_STATS_CFG
  9776. *
  9777. * @details
  9778. * HTT_H2T_MSG_TYPE_TX_LATENCY_STATS_CFG message is sent by the host to
  9779. * configure the parameters needed for FW to report PPDU tx latency stats
  9780. * for latency prediction in user space.
  9781. *
  9782. * The message would appear as follows:
  9783. * |31 28|27 12|11|10 8|7 0|
  9784. * |-----------+-------------------+--+-------+--------------|
  9785. * |granularity| periodic interval | E|vdev ID| msg type |
  9786. * |-----------+-------------------+--+-------+--------------|
  9787. * Where: E = enable
  9788. *
  9789. * The message is interpreted as follows:
  9790. * dword0 - b'0:7 - msg_type: This will be set to 0x25
  9791. * (HTT_H2T_MSG_TYPE_TX_LATENCY_STATS_CFG)
  9792. * b'8:10 - vdev_id: Indicate which vdev is configuration is for
  9793. * b'11 - enable: Indicate this message is to enable/disable
  9794. * PPDU latency report from FW
  9795. * b'12:27 - periodic_interval: Indicate the report interval in MS
  9796. * b'28:31 - granularity: Indicate the granularity of the latency
  9797. * stats report, in ms
  9798. */
  9799. /* HTT_H2T_MSG_TYPE_TX_LATENCY_STATS_CFG */
  9800. PREPACK struct htt_h2t_tx_latency_stats_cfg {
  9801. A_UINT32 msg_type :8,
  9802. vdev_id :3,
  9803. enable :1,
  9804. periodic_interval :16,
  9805. granularity :4;
  9806. } POSTPACK;
  9807. #define HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_M 0x00000700
  9808. #define HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_S 8
  9809. #define HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_GET(_var) \
  9810. (((_var) & HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_M) >> \
  9811. HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_S)
  9812. #define HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_SET(_var, _val) \
  9813. do { \
  9814. HTT_CHECK_SET_VAL(HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID, _val); \
  9815. ((_var) |= ((_val) << HTT_H2T_TX_LATENCY_STATS_CFG_VDEV_ID_S)); \
  9816. } while (0)
  9817. #define HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_M 0x00000800
  9818. #define HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_S 11
  9819. #define HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_GET(_var) \
  9820. (((_var) & HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_M) >> \
  9821. HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_S)
  9822. #define HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_SET(_var, _val) \
  9823. do { \
  9824. HTT_CHECK_SET_VAL(HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE, _val); \
  9825. ((_var) |= ((_val) << HTT_H2T_TX_LATENCY_STATS_CFG_ENABLE_S)); \
  9826. } while (0)
  9827. #define HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_M 0x0FFFF000
  9828. #define HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_S 12
  9829. #define HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_GET(_var) \
  9830. (((_var) & HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_M) >> \
  9831. HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_S)
  9832. #define HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_SET(_var, _val) \
  9833. do { \
  9834. HTT_CHECK_SET_VAL(HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL, _val); \
  9835. ((_var) |= ((_val) << HTT_H2T_TX_LATENCY_STATS_CFG_PERIODIC_INTERVAL_S)); \
  9836. } while (0)
  9837. #define HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_M 0xF0000000
  9838. #define HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_S 28
  9839. #define HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_GET(_var) \
  9840. (((_var) & HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_M) >> \
  9841. HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_S)
  9842. #define HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_SET(_var, _val) \
  9843. do { \
  9844. HTT_CHECK_SET_VAL(HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY, _val); \
  9845. ((_var) |= ((_val) << HTT_H2T_TX_LATENCY_STATS_CFG_GRANULARITY_S)); \
  9846. } while (0)
  9847. /*=== target -> host messages ===============================================*/
  9848. enum htt_t2h_msg_type {
  9849. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9850. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9851. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9852. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9853. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9854. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9855. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9856. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9857. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9858. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9859. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9860. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9861. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9862. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9863. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9864. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9865. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9866. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9867. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9868. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9869. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9870. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9871. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9872. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9873. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9874. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9875. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9876. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9877. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9878. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9879. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9880. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9881. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9882. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9883. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9884. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9885. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9886. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9887. /* TX_OFFLOAD_DELIVER_IND:
  9888. * Forward the target's locally-generated packets to the host,
  9889. * to provide to the monitor mode interface.
  9890. */
  9891. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9892. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9893. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9894. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9895. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9896. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9897. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9898. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9899. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9900. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9901. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9902. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9903. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9904. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9905. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9906. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9907. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9908. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34, /* DEPRECATED */
  9909. HTT_T2H_MSG_TYPE_RX_DATA_IND = 0x35,
  9910. HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND = 0x36,
  9911. HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND = 0x37,
  9912. HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND = 0x38,
  9913. HTT_T2H_MSG_TYPE_PEER_EXTENDED_EVENT = 0x39,
  9914. HTT_T2H_MSG_TYPE_TX_LATENCY_STATS_PERIODIC_IND = 0x3a,
  9915. HTT_T2H_MSG_TYPE_TEST,
  9916. /* keep this last */
  9917. HTT_T2H_NUM_MSGS
  9918. };
  9919. /*
  9920. * HTT target to host message type -
  9921. * stored in bits 7:0 of the first word of the message
  9922. */
  9923. #define HTT_T2H_MSG_TYPE_M 0xff
  9924. #define HTT_T2H_MSG_TYPE_S 0
  9925. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9926. do { \
  9927. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9928. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9929. } while (0)
  9930. #define HTT_T2H_MSG_TYPE_GET(word) \
  9931. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9932. /**
  9933. * @brief target -> host version number confirmation message definition
  9934. *
  9935. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9936. *
  9937. * |31 24|23 16|15 8|7 0|
  9938. * |----------------+----------------+----------------+----------------|
  9939. * | reserved | major number | minor number | msg type |
  9940. * |-------------------------------------------------------------------|
  9941. * : option request TLV (optional) |
  9942. * :...................................................................:
  9943. *
  9944. * The VER_CONF message may consist of a single 4-byte word, or may be
  9945. * extended with TLVs that specify HTT options selected by the target.
  9946. * The following option TLVs may be appended to the VER_CONF message:
  9947. * - LL_BUS_ADDR_SIZE
  9948. * - HL_SUPPRESS_TX_COMPL_IND
  9949. * - MAX_TX_QUEUE_GROUPS
  9950. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9951. * may be appended to the VER_CONF message (but only one TLV of each type).
  9952. *
  9953. * Header fields:
  9954. * - MSG_TYPE
  9955. * Bits 7:0
  9956. * Purpose: identifies this as a version number confirmation message
  9957. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9958. * - VER_MINOR
  9959. * Bits 15:8
  9960. * Purpose: Specify the minor number of the HTT message library version
  9961. * in use by the target firmware.
  9962. * The minor number specifies the specific revision within a range
  9963. * of fundamentally compatible HTT message definition revisions.
  9964. * Compatible revisions involve adding new messages or perhaps
  9965. * adding new fields to existing messages, in a backwards-compatible
  9966. * manner.
  9967. * Incompatible revisions involve changing the message type values,
  9968. * or redefining existing messages.
  9969. * Value: minor number
  9970. * - VER_MAJOR
  9971. * Bits 15:8
  9972. * Purpose: Specify the major number of the HTT message library version
  9973. * in use by the target firmware.
  9974. * The major number specifies the family of minor revisions that are
  9975. * fundamentally compatible with each other, but not with prior or
  9976. * later families.
  9977. * Value: major number
  9978. */
  9979. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9980. #define HTT_VER_CONF_MINOR_S 8
  9981. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9982. #define HTT_VER_CONF_MAJOR_S 16
  9983. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9984. do { \
  9985. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9986. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9987. } while (0)
  9988. #define HTT_VER_CONF_MINOR_GET(word) \
  9989. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9990. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9993. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9994. } while (0)
  9995. #define HTT_VER_CONF_MAJOR_GET(word) \
  9996. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9997. #define HTT_VER_CONF_BYTES 4
  9998. /**
  9999. * @brief - target -> host HTT Rx In order indication message
  10000. *
  10001. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  10002. *
  10003. * @details
  10004. *
  10005. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  10006. * |----------------+-------------------+---------------------+---------------|
  10007. * | peer ID | P| F| O| ext TID | msg type |
  10008. * |--------------------------------------------------------------------------|
  10009. * | MSDU count | Reserved | vdev id |
  10010. * |--------------------------------------------------------------------------|
  10011. * | MSDU 0 bus address (bits 31:0) |
  10012. #if HTT_PADDR64
  10013. * | MSDU 0 bus address (bits 63:32) |
  10014. #endif
  10015. * |--------------------------------------------------------------------------|
  10016. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  10017. * |--------------------------------------------------------------------------|
  10018. * | MSDU 1 bus address (bits 31:0) |
  10019. #if HTT_PADDR64
  10020. * | MSDU 1 bus address (bits 63:32) |
  10021. #endif
  10022. * |--------------------------------------------------------------------------|
  10023. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  10024. * |--------------------------------------------------------------------------|
  10025. */
  10026. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  10027. *
  10028. * @details
  10029. * bits
  10030. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  10031. * |-----+----+-------+--------+--------+---------+---------+-----------|
  10032. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  10033. * | | frag | | | | fail |chksum fail|
  10034. * |-----+----+-------+--------+--------+---------+---------+-----------|
  10035. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  10036. */
  10037. struct htt_rx_in_ord_paddr_ind_hdr_t
  10038. {
  10039. A_UINT32 /* word 0 */
  10040. msg_type: 8,
  10041. ext_tid: 5,
  10042. offload: 1,
  10043. frag: 1,
  10044. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  10045. peer_id: 16;
  10046. A_UINT32 /* word 1 */
  10047. vap_id: 8,
  10048. /* NOTE:
  10049. * This reserved_1 field is not truly reserved - certain targets use
  10050. * this field internally to store debug information, and do not zero
  10051. * out the contents of the field before uploading the message to the
  10052. * host. Thus, any host-target communication supported by this field
  10053. * is limited to using values that are never used by the debug
  10054. * information stored by certain targets in the reserved_1 field.
  10055. * In particular, the targets in question don't use the value 0x3
  10056. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  10057. * so this previously-unused value within these bits is available to
  10058. * use as the host / target PKT_CAPTURE_MODE flag.
  10059. */
  10060. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  10061. /* if pkt_capture_mode == 0x3, host should
  10062. * send rx frames to monitor mode interface
  10063. */
  10064. msdu_cnt: 16;
  10065. };
  10066. struct htt_rx_in_ord_paddr_ind_msdu32_t
  10067. {
  10068. A_UINT32 dma_addr;
  10069. A_UINT32
  10070. length: 16,
  10071. fw_desc: 8,
  10072. msdu_info:8;
  10073. };
  10074. struct htt_rx_in_ord_paddr_ind_msdu64_t
  10075. {
  10076. A_UINT32 dma_addr_lo;
  10077. A_UINT32 dma_addr_hi;
  10078. A_UINT32
  10079. length: 16,
  10080. fw_desc: 8,
  10081. msdu_info:8;
  10082. };
  10083. #if HTT_PADDR64
  10084. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  10085. #else
  10086. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  10087. #endif
  10088. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  10089. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  10090. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  10091. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  10092. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  10093. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  10094. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  10095. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  10096. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  10097. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  10098. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  10099. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  10100. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  10101. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  10102. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  10103. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  10104. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  10105. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  10106. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  10107. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  10108. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  10109. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  10110. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  10111. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  10112. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  10113. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  10114. /* for systems using 64-bit format for bus addresses */
  10115. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  10116. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  10117. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  10118. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  10119. /* for systems using 32-bit format for bus addresses */
  10120. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  10121. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  10122. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  10123. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  10124. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  10125. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  10126. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  10127. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  10128. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  10129. do { \
  10130. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  10131. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  10132. } while (0)
  10133. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  10134. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  10135. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  10136. do { \
  10137. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  10138. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  10139. } while (0)
  10140. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  10141. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  10142. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  10143. do { \
  10144. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  10145. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  10146. } while (0)
  10147. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  10148. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  10149. /*
  10150. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  10151. * deliver the rx frames to the monitor mode interface.
  10152. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  10153. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  10154. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  10155. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  10156. */
  10157. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  10158. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  10159. do { \
  10160. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  10161. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  10162. } while (0)
  10163. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  10164. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  10165. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  10166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  10167. do { \
  10168. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  10169. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  10170. } while (0)
  10171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  10172. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  10173. /* for systems using 64-bit format for bus addresses */
  10174. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  10175. do { \
  10176. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  10177. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  10178. } while (0)
  10179. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  10180. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  10181. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  10182. do { \
  10183. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  10184. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  10185. } while (0)
  10186. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  10187. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  10188. /* for systems using 32-bit format for bus addresses */
  10189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  10192. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  10193. } while (0)
  10194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  10195. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  10196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  10199. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  10200. } while (0)
  10201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  10202. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  10203. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  10204. do { \
  10205. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  10206. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  10207. } while (0)
  10208. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  10209. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  10210. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  10213. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  10214. } while (0)
  10215. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  10216. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  10217. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  10218. do { \
  10219. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  10220. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  10221. } while (0)
  10222. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  10223. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  10224. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  10227. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  10228. } while (0)
  10229. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  10230. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  10231. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  10232. do { \
  10233. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  10234. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  10235. } while (0)
  10236. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  10237. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  10238. /* definitions used within target -> host rx indication message */
  10239. PREPACK struct htt_rx_ind_hdr_prefix_t
  10240. {
  10241. A_UINT32 /* word 0 */
  10242. msg_type: 8,
  10243. ext_tid: 5,
  10244. release_valid: 1,
  10245. flush_valid: 1,
  10246. reserved0: 1,
  10247. peer_id: 16;
  10248. A_UINT32 /* word 1 */
  10249. flush_start_seq_num: 6,
  10250. flush_end_seq_num: 6,
  10251. release_start_seq_num: 6,
  10252. release_end_seq_num: 6,
  10253. num_mpdu_ranges: 8;
  10254. } POSTPACK;
  10255. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  10256. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  10257. #define HTT_TGT_RSSI_INVALID 0x80
  10258. PREPACK struct htt_rx_ppdu_desc_t
  10259. {
  10260. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  10261. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  10262. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  10263. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  10264. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  10265. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  10266. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  10267. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  10268. A_UINT32 /* word 0 */
  10269. rssi_cmb: 8,
  10270. timestamp_submicrosec: 8,
  10271. phy_err_code: 8,
  10272. phy_err: 1,
  10273. legacy_rate: 4,
  10274. legacy_rate_sel: 1,
  10275. end_valid: 1,
  10276. start_valid: 1;
  10277. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  10278. union {
  10279. A_UINT32 /* word 1 */
  10280. rssi0_pri20: 8,
  10281. rssi0_ext20: 8,
  10282. rssi0_ext40: 8,
  10283. rssi0_ext80: 8;
  10284. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  10285. } u0;
  10286. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  10287. union {
  10288. A_UINT32 /* word 2 */
  10289. rssi1_pri20: 8,
  10290. rssi1_ext20: 8,
  10291. rssi1_ext40: 8,
  10292. rssi1_ext80: 8;
  10293. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  10294. } u1;
  10295. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  10296. union {
  10297. A_UINT32 /* word 3 */
  10298. rssi2_pri20: 8,
  10299. rssi2_ext20: 8,
  10300. rssi2_ext40: 8,
  10301. rssi2_ext80: 8;
  10302. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  10303. } u2;
  10304. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  10305. union {
  10306. A_UINT32 /* word 4 */
  10307. rssi3_pri20: 8,
  10308. rssi3_ext20: 8,
  10309. rssi3_ext40: 8,
  10310. rssi3_ext80: 8;
  10311. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  10312. } u3;
  10313. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  10314. A_UINT32 tsf32; /* word 5 */
  10315. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  10316. A_UINT32 timestamp_microsec; /* word 6 */
  10317. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  10318. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  10319. A_UINT32 /* word 7 */
  10320. vht_sig_a1: 24,
  10321. preamble_type: 8;
  10322. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  10323. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  10324. A_UINT32 /* word 8 */
  10325. vht_sig_a2: 24,
  10326. /* sa_ant_matrix
  10327. * For cases where a single rx chain has options to be connected to
  10328. * different rx antennas, show which rx antennas were in use during
  10329. * receipt of a given PPDU.
  10330. * This sa_ant_matrix provides a bitmask of the antennas used while
  10331. * receiving this frame.
  10332. */
  10333. sa_ant_matrix: 8;
  10334. } POSTPACK;
  10335. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  10336. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  10337. PREPACK struct htt_rx_ind_hdr_suffix_t
  10338. {
  10339. A_UINT32 /* word 0 */
  10340. fw_rx_desc_bytes: 16,
  10341. reserved0: 16;
  10342. } POSTPACK;
  10343. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  10344. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  10345. PREPACK struct htt_rx_ind_hdr_t
  10346. {
  10347. struct htt_rx_ind_hdr_prefix_t prefix;
  10348. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  10349. struct htt_rx_ind_hdr_suffix_t suffix;
  10350. } POSTPACK;
  10351. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  10352. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  10353. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  10354. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  10355. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  10356. /*
  10357. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  10358. * the offset into the HTT rx indication message at which the
  10359. * FW rx PPDU descriptor resides
  10360. */
  10361. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  10362. /*
  10363. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  10364. * the offset into the HTT rx indication message at which the
  10365. * header suffix (FW rx MSDU byte count) resides
  10366. */
  10367. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  10368. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  10369. /*
  10370. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  10371. * the offset into the HTT rx indication message at which the per-MSDU
  10372. * information starts
  10373. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  10374. * per-MSDU information portion of the message. The per-MSDU info itself
  10375. * starts at byte 12.
  10376. */
  10377. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  10378. /**
  10379. * @brief target -> host rx indication message definition
  10380. *
  10381. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  10382. *
  10383. * @details
  10384. * The following field definitions describe the format of the rx indication
  10385. * message sent from the target to the host.
  10386. * The message consists of three major sections:
  10387. * 1. a fixed-length header
  10388. * 2. a variable-length list of firmware rx MSDU descriptors
  10389. * 3. one or more 4-octet MPDU range information elements
  10390. * The fixed length header itself has two sub-sections
  10391. * 1. the message meta-information, including identification of the
  10392. * sender and type of the received data, and a 4-octet flush/release IE
  10393. * 2. the firmware rx PPDU descriptor
  10394. *
  10395. * The format of the message is depicted below.
  10396. * in this depiction, the following abbreviations are used for information
  10397. * elements within the message:
  10398. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10399. * elements associated with the PPDU start are valid.
  10400. * Specifically, the following fields are valid only if SV is set:
  10401. * RSSI (all variants), L, legacy rate, preamble type, service,
  10402. * VHT-SIG-A
  10403. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10404. * elements associated with the PPDU end are valid.
  10405. * Specifically, the following fields are valid only if EV is set:
  10406. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10407. * - L - Legacy rate selector - if legacy rates are used, this flag
  10408. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10409. * (L == 0) PHY.
  10410. * - P - PHY error flag - boolean indication of whether the rx frame had
  10411. * a PHY error
  10412. *
  10413. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10414. * |----------------+-------------------+---------------------+---------------|
  10415. * | peer ID | |RV|FV| ext TID | msg type |
  10416. * |--------------------------------------------------------------------------|
  10417. * | num | release | release | flush | flush |
  10418. * | MPDU | end | start | end | start |
  10419. * | ranges | seq num | seq num | seq num | seq num |
  10420. * |==========================================================================|
  10421. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10422. * |V|V| | rate | | | timestamp | RSSI |
  10423. * |--------------------------------------------------------------------------|
  10424. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10425. * |--------------------------------------------------------------------------|
  10426. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10427. * |--------------------------------------------------------------------------|
  10428. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10429. * |--------------------------------------------------------------------------|
  10430. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10431. * |--------------------------------------------------------------------------|
  10432. * | TSF LSBs |
  10433. * |--------------------------------------------------------------------------|
  10434. * | microsec timestamp |
  10435. * |--------------------------------------------------------------------------|
  10436. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10437. * |--------------------------------------------------------------------------|
  10438. * | service | HT-SIG / VHT-SIG-A2 |
  10439. * |==========================================================================|
  10440. * | reserved | FW rx desc bytes |
  10441. * |--------------------------------------------------------------------------|
  10442. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10443. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10444. * |--------------------------------------------------------------------------|
  10445. * : : :
  10446. * |--------------------------------------------------------------------------|
  10447. * | alignment | MSDU Rx |
  10448. * | padding | desc Bn |
  10449. * |--------------------------------------------------------------------------|
  10450. * | reserved | MPDU range status | MPDU count |
  10451. * |--------------------------------------------------------------------------|
  10452. * : reserved : MPDU range status : MPDU count :
  10453. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10454. *
  10455. * Header fields:
  10456. * - MSG_TYPE
  10457. * Bits 7:0
  10458. * Purpose: identifies this as an rx indication message
  10459. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10460. * - EXT_TID
  10461. * Bits 12:8
  10462. * Purpose: identify the traffic ID of the rx data, including
  10463. * special "extended" TID values for multicast, broadcast, and
  10464. * non-QoS data frames
  10465. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10466. * - FLUSH_VALID (FV)
  10467. * Bit 13
  10468. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10469. * is valid
  10470. * Value:
  10471. * 1 -> flush IE is valid and needs to be processed
  10472. * 0 -> flush IE is not valid and should be ignored
  10473. * - REL_VALID (RV)
  10474. * Bit 13
  10475. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10476. * is valid
  10477. * Value:
  10478. * 1 -> release IE is valid and needs to be processed
  10479. * 0 -> release IE is not valid and should be ignored
  10480. * - PEER_ID
  10481. * Bits 31:16
  10482. * Purpose: Identify, by ID, which peer sent the rx data
  10483. * Value: ID of the peer who sent the rx data
  10484. * - FLUSH_SEQ_NUM_START
  10485. * Bits 5:0
  10486. * Purpose: Indicate the start of a series of MPDUs to flush
  10487. * Not all MPDUs within this series are necessarily valid - the host
  10488. * must check each sequence number within this range to see if the
  10489. * corresponding MPDU is actually present.
  10490. * This field is only valid if the FV bit is set.
  10491. * Value:
  10492. * The sequence number for the first MPDUs to check to flush.
  10493. * The sequence number is masked by 0x3f.
  10494. * - FLUSH_SEQ_NUM_END
  10495. * Bits 11:6
  10496. * Purpose: Indicate the end of a series of MPDUs to flush
  10497. * Value:
  10498. * The sequence number one larger than the sequence number of the
  10499. * last MPDU to check to flush.
  10500. * The sequence number is masked by 0x3f.
  10501. * Not all MPDUs within this series are necessarily valid - the host
  10502. * must check each sequence number within this range to see if the
  10503. * corresponding MPDU is actually present.
  10504. * This field is only valid if the FV bit is set.
  10505. * - REL_SEQ_NUM_START
  10506. * Bits 17:12
  10507. * Purpose: Indicate the start of a series of MPDUs to release.
  10508. * All MPDUs within this series are present and valid - the host
  10509. * need not check each sequence number within this range to see if
  10510. * the corresponding MPDU is actually present.
  10511. * This field is only valid if the RV bit is set.
  10512. * Value:
  10513. * The sequence number for the first MPDUs to check to release.
  10514. * The sequence number is masked by 0x3f.
  10515. * - REL_SEQ_NUM_END
  10516. * Bits 23:18
  10517. * Purpose: Indicate the end of a series of MPDUs to release.
  10518. * Value:
  10519. * The sequence number one larger than the sequence number of the
  10520. * last MPDU to check to release.
  10521. * The sequence number is masked by 0x3f.
  10522. * All MPDUs within this series are present and valid - the host
  10523. * need not check each sequence number within this range to see if
  10524. * the corresponding MPDU is actually present.
  10525. * This field is only valid if the RV bit is set.
  10526. * - NUM_MPDU_RANGES
  10527. * Bits 31:24
  10528. * Purpose: Indicate how many ranges of MPDUs are present.
  10529. * Each MPDU range consists of a series of contiguous MPDUs within the
  10530. * rx frame sequence which all have the same MPDU status.
  10531. * Value: 1-63 (typically a small number, like 1-3)
  10532. *
  10533. * Rx PPDU descriptor fields:
  10534. * - RSSI_CMB
  10535. * Bits 7:0
  10536. * Purpose: Combined RSSI from all active rx chains, across the active
  10537. * bandwidth.
  10538. * Value: RSSI dB units w.r.t. noise floor
  10539. * - TIMESTAMP_SUBMICROSEC
  10540. * Bits 15:8
  10541. * Purpose: high-resolution timestamp
  10542. * Value:
  10543. * Sub-microsecond time of PPDU reception.
  10544. * This timestamp ranges from [0,MAC clock MHz).
  10545. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10546. * to form a high-resolution, large range rx timestamp.
  10547. * - PHY_ERR_CODE
  10548. * Bits 23:16
  10549. * Purpose:
  10550. * If the rx frame processing resulted in a PHY error, indicate what
  10551. * type of rx PHY error occurred.
  10552. * Value:
  10553. * This field is valid if the "P" (PHY_ERR) flag is set.
  10554. * TBD: document/specify the values for this field
  10555. * - PHY_ERR
  10556. * Bit 24
  10557. * Purpose: indicate whether the rx PPDU had a PHY error
  10558. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10559. * - LEGACY_RATE
  10560. * Bits 28:25
  10561. * Purpose:
  10562. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10563. * specify which rate was used.
  10564. * Value:
  10565. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10566. * flag.
  10567. * If LEGACY_RATE_SEL is 0:
  10568. * 0x8: OFDM 48 Mbps
  10569. * 0x9: OFDM 24 Mbps
  10570. * 0xA: OFDM 12 Mbps
  10571. * 0xB: OFDM 6 Mbps
  10572. * 0xC: OFDM 54 Mbps
  10573. * 0xD: OFDM 36 Mbps
  10574. * 0xE: OFDM 18 Mbps
  10575. * 0xF: OFDM 9 Mbps
  10576. * If LEGACY_RATE_SEL is 1:
  10577. * 0x8: CCK 11 Mbps long preamble
  10578. * 0x9: CCK 5.5 Mbps long preamble
  10579. * 0xA: CCK 2 Mbps long preamble
  10580. * 0xB: CCK 1 Mbps long preamble
  10581. * 0xC: CCK 11 Mbps short preamble
  10582. * 0xD: CCK 5.5 Mbps short preamble
  10583. * 0xE: CCK 2 Mbps short preamble
  10584. * - LEGACY_RATE_SEL
  10585. * Bit 29
  10586. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10587. * Value:
  10588. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10589. * used a legacy rate.
  10590. * 0 -> OFDM, 1 -> CCK
  10591. * - END_VALID
  10592. * Bit 30
  10593. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10594. * the start of the PPDU are valid. Specifically, the following
  10595. * fields are only valid if END_VALID is set:
  10596. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10597. * TIMESTAMP_SUBMICROSEC
  10598. * Value:
  10599. * 0 -> rx PPDU desc end fields are not valid
  10600. * 1 -> rx PPDU desc end fields are valid
  10601. * - START_VALID
  10602. * Bit 31
  10603. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10604. * the end of the PPDU are valid. Specifically, the following
  10605. * fields are only valid if START_VALID is set:
  10606. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10607. * VHT-SIG-A
  10608. * Value:
  10609. * 0 -> rx PPDU desc start fields are not valid
  10610. * 1 -> rx PPDU desc start fields are valid
  10611. * - RSSI0_PRI20
  10612. * Bits 7:0
  10613. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10614. * Value: RSSI dB units w.r.t. noise floor
  10615. *
  10616. * - RSSI0_EXT20
  10617. * Bits 7:0
  10618. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10619. * (if the rx bandwidth was >= 40 MHz)
  10620. * Value: RSSI dB units w.r.t. noise floor
  10621. * - RSSI0_EXT40
  10622. * Bits 7:0
  10623. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10624. * (if the rx bandwidth was >= 80 MHz)
  10625. * Value: RSSI dB units w.r.t. noise floor
  10626. * - RSSI0_EXT80
  10627. * Bits 7:0
  10628. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10629. * (if the rx bandwidth was >= 160 MHz)
  10630. * Value: RSSI dB units w.r.t. noise floor
  10631. *
  10632. * - RSSI1_PRI20
  10633. * Bits 7:0
  10634. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10635. * Value: RSSI dB units w.r.t. noise floor
  10636. * - RSSI1_EXT20
  10637. * Bits 7:0
  10638. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10639. * (if the rx bandwidth was >= 40 MHz)
  10640. * Value: RSSI dB units w.r.t. noise floor
  10641. * - RSSI1_EXT40
  10642. * Bits 7:0
  10643. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10644. * (if the rx bandwidth was >= 80 MHz)
  10645. * Value: RSSI dB units w.r.t. noise floor
  10646. * - RSSI1_EXT80
  10647. * Bits 7:0
  10648. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10649. * (if the rx bandwidth was >= 160 MHz)
  10650. * Value: RSSI dB units w.r.t. noise floor
  10651. *
  10652. * - RSSI2_PRI20
  10653. * Bits 7:0
  10654. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10655. * Value: RSSI dB units w.r.t. noise floor
  10656. * - RSSI2_EXT20
  10657. * Bits 7:0
  10658. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10659. * (if the rx bandwidth was >= 40 MHz)
  10660. * Value: RSSI dB units w.r.t. noise floor
  10661. * - RSSI2_EXT40
  10662. * Bits 7:0
  10663. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10664. * (if the rx bandwidth was >= 80 MHz)
  10665. * Value: RSSI dB units w.r.t. noise floor
  10666. * - RSSI2_EXT80
  10667. * Bits 7:0
  10668. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10669. * (if the rx bandwidth was >= 160 MHz)
  10670. * Value: RSSI dB units w.r.t. noise floor
  10671. *
  10672. * - RSSI3_PRI20
  10673. * Bits 7:0
  10674. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10675. * Value: RSSI dB units w.r.t. noise floor
  10676. * - RSSI3_EXT20
  10677. * Bits 7:0
  10678. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10679. * (if the rx bandwidth was >= 40 MHz)
  10680. * Value: RSSI dB units w.r.t. noise floor
  10681. * - RSSI3_EXT40
  10682. * Bits 7:0
  10683. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10684. * (if the rx bandwidth was >= 80 MHz)
  10685. * Value: RSSI dB units w.r.t. noise floor
  10686. * - RSSI3_EXT80
  10687. * Bits 7:0
  10688. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10689. * (if the rx bandwidth was >= 160 MHz)
  10690. * Value: RSSI dB units w.r.t. noise floor
  10691. *
  10692. * - TSF32
  10693. * Bits 31:0
  10694. * Purpose: specify the time the rx PPDU was received, in TSF units
  10695. * Value: 32 LSBs of the TSF
  10696. * - TIMESTAMP_MICROSEC
  10697. * Bits 31:0
  10698. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10699. * Value: PPDU rx time, in microseconds
  10700. * - VHT_SIG_A1
  10701. * Bits 23:0
  10702. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10703. * from the rx PPDU
  10704. * Value:
  10705. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10706. * VHT-SIG-A1 data.
  10707. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10708. * first 24 bits of the HT-SIG data.
  10709. * Otherwise, this field is invalid.
  10710. * Refer to the the 802.11 protocol for the definition of the
  10711. * HT-SIG and VHT-SIG-A1 fields
  10712. * - VHT_SIG_A2
  10713. * Bits 23:0
  10714. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10715. * from the rx PPDU
  10716. * Value:
  10717. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10718. * VHT-SIG-A2 data.
  10719. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10720. * last 24 bits of the HT-SIG data.
  10721. * Otherwise, this field is invalid.
  10722. * Refer to the the 802.11 protocol for the definition of the
  10723. * HT-SIG and VHT-SIG-A2 fields
  10724. * - PREAMBLE_TYPE
  10725. * Bits 31:24
  10726. * Purpose: indicate the PHY format of the received burst
  10727. * Value:
  10728. * 0x4: Legacy (OFDM/CCK)
  10729. * 0x8: HT
  10730. * 0x9: HT with TxBF
  10731. * 0xC: VHT
  10732. * 0xD: VHT with TxBF
  10733. * - SERVICE
  10734. * Bits 31:24
  10735. * Purpose: TBD
  10736. * Value: TBD
  10737. *
  10738. * Rx MSDU descriptor fields:
  10739. * - FW_RX_DESC_BYTES
  10740. * Bits 15:0
  10741. * Purpose: Indicate how many bytes in the Rx indication are used for
  10742. * FW Rx descriptors
  10743. *
  10744. * Payload fields:
  10745. * - MPDU_COUNT
  10746. * Bits 7:0
  10747. * Purpose: Indicate how many sequential MPDUs share the same status.
  10748. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10749. * - MPDU_STATUS
  10750. * Bits 15:8
  10751. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10752. * received successfully.
  10753. * Value:
  10754. * 0x1: success
  10755. * 0x2: FCS error
  10756. * 0x3: duplicate error
  10757. * 0x4: replay error
  10758. * 0x5: invalid peer
  10759. */
  10760. /* header fields */
  10761. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10762. #define HTT_RX_IND_EXT_TID_S 8
  10763. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10764. #define HTT_RX_IND_FLUSH_VALID_S 13
  10765. #define HTT_RX_IND_REL_VALID_M 0x4000
  10766. #define HTT_RX_IND_REL_VALID_S 14
  10767. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10768. #define HTT_RX_IND_PEER_ID_S 16
  10769. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10770. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10771. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10772. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10773. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10774. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10775. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10776. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10777. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10778. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10779. /* rx PPDU descriptor fields */
  10780. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10781. #define HTT_RX_IND_RSSI_CMB_S 0
  10782. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10783. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10784. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10785. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10786. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10787. #define HTT_RX_IND_PHY_ERR_S 24
  10788. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10789. #define HTT_RX_IND_LEGACY_RATE_S 25
  10790. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10791. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10792. #define HTT_RX_IND_END_VALID_M 0x40000000
  10793. #define HTT_RX_IND_END_VALID_S 30
  10794. #define HTT_RX_IND_START_VALID_M 0x80000000
  10795. #define HTT_RX_IND_START_VALID_S 31
  10796. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10797. #define HTT_RX_IND_RSSI_PRI20_S 0
  10798. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10799. #define HTT_RX_IND_RSSI_EXT20_S 8
  10800. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10801. #define HTT_RX_IND_RSSI_EXT40_S 16
  10802. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10803. #define HTT_RX_IND_RSSI_EXT80_S 24
  10804. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10805. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10806. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10807. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10808. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10809. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10810. #define HTT_RX_IND_SERVICE_M 0xff000000
  10811. #define HTT_RX_IND_SERVICE_S 24
  10812. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10813. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10814. /* rx MSDU descriptor fields */
  10815. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10816. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10817. /* payload fields */
  10818. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10819. #define HTT_RX_IND_MPDU_COUNT_S 0
  10820. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10821. #define HTT_RX_IND_MPDU_STATUS_S 8
  10822. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10823. do { \
  10824. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10825. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10826. } while (0)
  10827. #define HTT_RX_IND_EXT_TID_GET(word) \
  10828. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10829. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10830. do { \
  10831. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10832. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10833. } while (0)
  10834. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10835. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10836. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10837. do { \
  10838. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10839. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10840. } while (0)
  10841. #define HTT_RX_IND_REL_VALID_GET(word) \
  10842. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10843. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10844. do { \
  10845. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10846. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10847. } while (0)
  10848. #define HTT_RX_IND_PEER_ID_GET(word) \
  10849. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10850. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10851. do { \
  10852. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10853. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10854. } while (0)
  10855. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10856. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10857. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10858. do { \
  10859. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10860. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10861. } while (0)
  10862. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10863. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10864. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10865. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10866. do { \
  10867. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10868. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10869. } while (0)
  10870. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10871. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10872. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10873. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10874. do { \
  10875. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10876. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10877. } while (0)
  10878. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10879. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10880. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10881. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10882. do { \
  10883. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10884. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10885. } while (0)
  10886. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10887. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10888. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10889. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10890. do { \
  10891. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10892. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10893. } while (0)
  10894. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10895. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10896. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10897. /* FW rx PPDU descriptor fields */
  10898. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10899. do { \
  10900. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10901. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10902. } while (0)
  10903. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10904. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10905. HTT_RX_IND_RSSI_CMB_S)
  10906. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10907. do { \
  10908. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10909. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10910. } while (0)
  10911. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10912. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10913. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10914. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10915. do { \
  10916. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10917. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10918. } while (0)
  10919. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10920. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10921. HTT_RX_IND_PHY_ERR_CODE_S)
  10922. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10923. do { \
  10924. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10925. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10926. } while (0)
  10927. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10928. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10929. HTT_RX_IND_PHY_ERR_S)
  10930. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10931. do { \
  10932. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10933. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10934. } while (0)
  10935. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10936. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10937. HTT_RX_IND_LEGACY_RATE_S)
  10938. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10939. do { \
  10940. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10941. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10942. } while (0)
  10943. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10944. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10945. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10946. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10947. do { \
  10948. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10949. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10950. } while (0)
  10951. #define HTT_RX_IND_END_VALID_GET(word) \
  10952. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10953. HTT_RX_IND_END_VALID_S)
  10954. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10955. do { \
  10956. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10957. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10958. } while (0)
  10959. #define HTT_RX_IND_START_VALID_GET(word) \
  10960. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10961. HTT_RX_IND_START_VALID_S)
  10962. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10963. do { \
  10964. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10965. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10966. } while (0)
  10967. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10968. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10969. HTT_RX_IND_RSSI_PRI20_S)
  10970. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10971. do { \
  10972. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10973. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10974. } while (0)
  10975. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10976. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10977. HTT_RX_IND_RSSI_EXT20_S)
  10978. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10979. do { \
  10980. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10981. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10982. } while (0)
  10983. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10984. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10985. HTT_RX_IND_RSSI_EXT40_S)
  10986. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10987. do { \
  10988. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10989. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10990. } while (0)
  10991. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10992. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10993. HTT_RX_IND_RSSI_EXT80_S)
  10994. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10997. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10998. } while (0)
  10999. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  11000. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  11001. HTT_RX_IND_VHT_SIG_A1_S)
  11002. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  11003. do { \
  11004. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  11005. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  11006. } while (0)
  11007. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  11008. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  11009. HTT_RX_IND_VHT_SIG_A2_S)
  11010. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  11013. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  11014. } while (0)
  11015. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  11016. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  11017. HTT_RX_IND_PREAMBLE_TYPE_S)
  11018. #define HTT_RX_IND_SERVICE_SET(word, value) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  11021. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  11022. } while (0)
  11023. #define HTT_RX_IND_SERVICE_GET(word) \
  11024. (((word) & HTT_RX_IND_SERVICE_M) >> \
  11025. HTT_RX_IND_SERVICE_S)
  11026. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  11027. do { \
  11028. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  11029. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  11030. } while (0)
  11031. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  11032. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  11033. HTT_RX_IND_SA_ANT_MATRIX_S)
  11034. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  11037. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  11038. } while (0)
  11039. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  11040. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  11041. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  11042. do { \
  11043. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  11044. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  11045. } while (0)
  11046. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  11047. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  11048. #define HTT_RX_IND_HL_BYTES \
  11049. (HTT_RX_IND_HDR_BYTES + \
  11050. 4 /* single FW rx MSDU descriptor */ + \
  11051. 4 /* single MPDU range information element */)
  11052. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  11053. /* Could we use one macro entry? */
  11054. #define HTT_WORD_SET(word, field, value) \
  11055. do { \
  11056. HTT_CHECK_SET_VAL(field, value); \
  11057. (word) |= ((value) << field ## _S); \
  11058. } while (0)
  11059. #define HTT_WORD_GET(word, field) \
  11060. (((word) & field ## _M) >> field ## _S)
  11061. PREPACK struct hl_htt_rx_ind_base {
  11062. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  11063. } POSTPACK;
  11064. /*
  11065. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  11066. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  11067. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  11068. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  11069. * htt_rx_ind_hl_rx_desc_t.
  11070. */
  11071. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  11072. struct htt_rx_ind_hl_rx_desc_t {
  11073. A_UINT8 ver;
  11074. A_UINT8 len;
  11075. struct {
  11076. A_UINT8
  11077. first_msdu: 1,
  11078. last_msdu: 1,
  11079. c3_failed: 1,
  11080. c4_failed: 1,
  11081. ipv6: 1,
  11082. tcp: 1,
  11083. udp: 1,
  11084. reserved: 1;
  11085. } flags;
  11086. /* NOTE: no reserved space - don't append any new fields here */
  11087. };
  11088. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  11089. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  11090. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  11091. #define HTT_RX_IND_HL_RX_DESC_VER 0
  11092. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  11093. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  11094. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  11095. #define HTT_RX_IND_HL_FLAG_OFFSET \
  11096. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  11097. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  11098. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  11099. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  11100. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  11101. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  11102. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  11103. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  11104. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  11105. /* This structure is used in HL, the basic descriptor information
  11106. * used by host. the structure is translated by FW from HW desc
  11107. * or generated by FW. But in HL monitor mode, the host would use
  11108. * the same structure with LL.
  11109. */
  11110. PREPACK struct hl_htt_rx_desc_base {
  11111. A_UINT32
  11112. seq_num:12,
  11113. encrypted:1,
  11114. chan_info_present:1,
  11115. resv0:2,
  11116. mcast_bcast:1,
  11117. fragment:1,
  11118. key_id_oct:8,
  11119. resv1:6;
  11120. A_UINT32
  11121. pn_31_0;
  11122. union {
  11123. struct {
  11124. A_UINT16 pn_47_32;
  11125. A_UINT16 pn_63_48;
  11126. } pn16;
  11127. A_UINT32 pn_63_32;
  11128. } u0;
  11129. A_UINT32
  11130. pn_95_64;
  11131. A_UINT32
  11132. pn_127_96;
  11133. } POSTPACK;
  11134. /*
  11135. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  11136. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  11137. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  11138. * Please see htt_chan_change_t for description of the fields.
  11139. */
  11140. PREPACK struct htt_chan_info_t
  11141. {
  11142. A_UINT32 primary_chan_center_freq_mhz: 16,
  11143. contig_chan1_center_freq_mhz: 16;
  11144. A_UINT32 contig_chan2_center_freq_mhz: 16,
  11145. phy_mode: 8,
  11146. reserved: 8;
  11147. } POSTPACK;
  11148. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  11149. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  11150. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  11151. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  11152. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  11153. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  11154. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  11155. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  11156. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  11157. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  11158. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  11159. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  11160. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  11161. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  11162. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  11163. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  11164. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  11165. /* Channel information */
  11166. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  11167. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  11168. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  11169. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  11170. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  11171. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  11172. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  11173. #define HTT_CHAN_INFO_PHY_MODE_S 16
  11174. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  11175. do { \
  11176. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  11177. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  11178. } while (0)
  11179. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  11180. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  11181. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  11184. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  11185. } while (0)
  11186. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  11187. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  11188. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  11191. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  11192. } while (0)
  11193. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  11194. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  11195. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  11198. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  11199. } while (0)
  11200. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  11201. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  11202. /*
  11203. * @brief target -> host message definition for FW offloaded pkts
  11204. *
  11205. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  11206. *
  11207. * @details
  11208. * The following field definitions describe the format of the firmware
  11209. * offload deliver message sent from the target to the host.
  11210. *
  11211. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  11212. *
  11213. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  11214. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  11215. * | reserved_1 | msg type |
  11216. * |--------------------------------------------------------------------------|
  11217. * | phy_timestamp_l32 |
  11218. * |--------------------------------------------------------------------------|
  11219. * | WORD2 (see below) |
  11220. * |--------------------------------------------------------------------------|
  11221. * | seqno | framectrl |
  11222. * |--------------------------------------------------------------------------|
  11223. * | reserved_3 | vdev_id | tid_num|
  11224. * |--------------------------------------------------------------------------|
  11225. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  11226. * |--------------------------------------------------------------------------|
  11227. *
  11228. * where:
  11229. * STAT = status
  11230. * F = format (802.3 vs. 802.11)
  11231. *
  11232. * definition for word 2
  11233. *
  11234. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  11235. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  11236. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  11237. * |--------------------------------------------------------------------------|
  11238. *
  11239. * where:
  11240. * PR = preamble
  11241. * BF = beamformed
  11242. */
  11243. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  11244. {
  11245. A_UINT32 /* word 0 */
  11246. msg_type:8, /* [ 7: 0] */
  11247. reserved_1:24; /* [31: 8] */
  11248. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  11249. A_UINT32 /* word 2 */
  11250. /* preamble:
  11251. * 0-OFDM,
  11252. * 1-CCk,
  11253. * 2-HT,
  11254. * 3-VHT
  11255. */
  11256. preamble: 2, /* [1:0] */
  11257. /* mcs:
  11258. * In case of HT preamble interpret
  11259. * MCS along with NSS.
  11260. * Valid values for HT are 0 to 7.
  11261. * HT mcs 0 with NSS 2 is mcs 8.
  11262. * Valid values for VHT are 0 to 9.
  11263. */
  11264. mcs: 4, /* [5:2] */
  11265. /* rate:
  11266. * This is applicable only for
  11267. * CCK and OFDM preamble type
  11268. * rate 0: OFDM 48 Mbps,
  11269. * 1: OFDM 24 Mbps,
  11270. * 2: OFDM 12 Mbps
  11271. * 3: OFDM 6 Mbps
  11272. * 4: OFDM 54 Mbps
  11273. * 5: OFDM 36 Mbps
  11274. * 6: OFDM 18 Mbps
  11275. * 7: OFDM 9 Mbps
  11276. * rate 0: CCK 11 Mbps Long
  11277. * 1: CCK 5.5 Mbps Long
  11278. * 2: CCK 2 Mbps Long
  11279. * 3: CCK 1 Mbps Long
  11280. * 4: CCK 11 Mbps Short
  11281. * 5: CCK 5.5 Mbps Short
  11282. * 6: CCK 2 Mbps Short
  11283. */
  11284. rate : 3, /* [ 8: 6] */
  11285. rssi : 8, /* [16: 9] units=dBm */
  11286. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11287. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11288. stbc : 1, /* [22] */
  11289. sgi : 1, /* [23] */
  11290. ldpc : 1, /* [24] */
  11291. beamformed: 1, /* [25] */
  11292. reserved_2: 6; /* [31:26] */
  11293. A_UINT32 /* word 3 */
  11294. framectrl:16, /* [15: 0] */
  11295. seqno:16; /* [31:16] */
  11296. A_UINT32 /* word 4 */
  11297. tid_num:5, /* [ 4: 0] actual TID number */
  11298. vdev_id:8, /* [12: 5] */
  11299. reserved_3:19; /* [31:13] */
  11300. A_UINT32 /* word 5 */
  11301. /* status:
  11302. * 0: tx_ok
  11303. * 1: retry
  11304. * 2: drop
  11305. * 3: filtered
  11306. * 4: abort
  11307. * 5: tid delete
  11308. * 6: sw abort
  11309. * 7: dropped by peer migration
  11310. */
  11311. status:3, /* [2:0] */
  11312. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  11313. tx_mpdu_bytes:16, /* [19:4] */
  11314. /* Indicates retry count of offloaded/local generated Data tx frames */
  11315. tx_retry_cnt:6, /* [25:20] */
  11316. reserved_4:6; /* [31:26] */
  11317. } POSTPACK;
  11318. /* FW offload deliver ind message header fields */
  11319. /* DWORD one */
  11320. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  11321. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  11322. /* DWORD two */
  11323. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  11324. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  11325. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  11326. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  11327. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  11328. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  11329. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  11330. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  11331. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  11332. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  11333. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  11334. #define HTT_FW_OFFLOAD_IND_BW_S 19
  11335. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  11336. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  11337. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  11338. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  11339. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  11340. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  11341. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  11342. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  11343. /* DWORD three*/
  11344. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  11345. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  11346. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  11347. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  11348. /* DWORD four */
  11349. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  11350. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  11351. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  11352. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  11353. /* DWORD five */
  11354. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  11355. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  11356. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  11357. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  11358. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  11359. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  11360. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  11361. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  11362. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  11363. do { \
  11364. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  11365. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  11366. } while (0)
  11367. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  11368. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  11369. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  11370. do { \
  11371. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  11372. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  11373. } while (0)
  11374. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  11375. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  11376. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  11377. do { \
  11378. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  11379. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  11380. } while (0)
  11381. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  11382. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  11383. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  11384. do { \
  11385. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  11386. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  11387. } while (0)
  11388. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  11389. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  11390. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  11391. do { \
  11392. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11393. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11394. } while (0)
  11395. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11396. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11397. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11398. do { \
  11399. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11400. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11401. } while (0)
  11402. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11403. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11404. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11405. do { \
  11406. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11407. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11408. } while (0)
  11409. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11410. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11411. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11414. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11415. } while (0)
  11416. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11417. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11418. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11419. do { \
  11420. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11421. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11422. } while (0)
  11423. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11424. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11425. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11426. do { \
  11427. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11428. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11429. } while (0)
  11430. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11431. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11432. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11433. do { \
  11434. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11435. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11436. } while (0)
  11437. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11438. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11439. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11440. do { \
  11441. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11442. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11443. } while (0)
  11444. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11445. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11446. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11447. do { \
  11448. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11449. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11450. } while (0)
  11451. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11452. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11453. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11454. do { \
  11455. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11456. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11457. } while (0)
  11458. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11459. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11460. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11461. do { \
  11462. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11463. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11464. } while (0)
  11465. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11466. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11467. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11468. do { \
  11469. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11470. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11471. } while (0)
  11472. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11473. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11474. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11475. do { \
  11476. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11477. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11478. } while (0)
  11479. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11480. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11481. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11482. do { \
  11483. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11484. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11485. } while (0)
  11486. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11487. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11488. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11489. do { \
  11490. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11491. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11492. } while (0)
  11493. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11494. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11495. /*
  11496. * @brief target -> host rx reorder flush message definition
  11497. *
  11498. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11499. *
  11500. * @details
  11501. * The following field definitions describe the format of the rx flush
  11502. * message sent from the target to the host.
  11503. * The message consists of a 4-octet header, followed by one or more
  11504. * 4-octet payload information elements.
  11505. *
  11506. * |31 24|23 8|7 0|
  11507. * |--------------------------------------------------------------|
  11508. * | TID | peer ID | msg type |
  11509. * |--------------------------------------------------------------|
  11510. * | seq num end | seq num start | MPDU status | reserved |
  11511. * |--------------------------------------------------------------|
  11512. * First DWORD:
  11513. * - MSG_TYPE
  11514. * Bits 7:0
  11515. * Purpose: identifies this as an rx flush message
  11516. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11517. * - PEER_ID
  11518. * Bits 23:8 (only bits 18:8 actually used)
  11519. * Purpose: identify which peer's rx data is being flushed
  11520. * Value: (rx) peer ID
  11521. * - TID
  11522. * Bits 31:24 (only bits 27:24 actually used)
  11523. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11524. * Value: traffic identifier
  11525. * Second DWORD:
  11526. * - MPDU_STATUS
  11527. * Bits 15:8
  11528. * Purpose:
  11529. * Indicate whether the flushed MPDUs should be discarded or processed.
  11530. * Value:
  11531. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11532. * stages of rx processing
  11533. * other: discard the MPDUs
  11534. * It is anticipated that flush messages will always have
  11535. * MPDU status == 1, but the status flag is included for
  11536. * flexibility.
  11537. * - SEQ_NUM_START
  11538. * Bits 23:16
  11539. * Purpose:
  11540. * Indicate the start of a series of consecutive MPDUs being flushed.
  11541. * Not all MPDUs within this range are necessarily valid - the host
  11542. * must check each sequence number within this range to see if the
  11543. * corresponding MPDU is actually present.
  11544. * Value:
  11545. * The sequence number for the first MPDU in the sequence.
  11546. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11547. * - SEQ_NUM_END
  11548. * Bits 30:24
  11549. * Purpose:
  11550. * Indicate the end of a series of consecutive MPDUs being flushed.
  11551. * Value:
  11552. * The sequence number one larger than the sequence number of the
  11553. * last MPDU being flushed.
  11554. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11555. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11556. * are to be released for further rx processing.
  11557. * Not all MPDUs within this range are necessarily valid - the host
  11558. * must check each sequence number within this range to see if the
  11559. * corresponding MPDU is actually present.
  11560. */
  11561. /* first DWORD */
  11562. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11563. #define HTT_RX_FLUSH_PEER_ID_S 8
  11564. #define HTT_RX_FLUSH_TID_M 0xff000000
  11565. #define HTT_RX_FLUSH_TID_S 24
  11566. /* second DWORD */
  11567. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11568. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11569. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11570. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11571. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11572. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11573. #define HTT_RX_FLUSH_BYTES 8
  11574. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11575. do { \
  11576. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11577. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11578. } while (0)
  11579. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11580. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11581. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11582. do { \
  11583. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11584. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11585. } while (0)
  11586. #define HTT_RX_FLUSH_TID_GET(word) \
  11587. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11588. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11589. do { \
  11590. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11591. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11592. } while (0)
  11593. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11594. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11595. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11596. do { \
  11597. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11598. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11599. } while (0)
  11600. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11601. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11602. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11603. do { \
  11604. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11605. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11606. } while (0)
  11607. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11608. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11609. /*
  11610. * @brief target -> host rx pn check indication message
  11611. *
  11612. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11613. *
  11614. * @details
  11615. * The following field definitions describe the format of the Rx PN check
  11616. * indication message sent from the target to the host.
  11617. * The message consists of a 4-octet header, followed by the start and
  11618. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11619. * IE is one octet containing the sequence number that failed the PN
  11620. * check.
  11621. *
  11622. * |31 24|23 8|7 0|
  11623. * |--------------------------------------------------------------|
  11624. * | TID | peer ID | msg type |
  11625. * |--------------------------------------------------------------|
  11626. * | Reserved | PN IE count | seq num end | seq num start|
  11627. * |--------------------------------------------------------------|
  11628. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11629. * |--------------------------------------------------------------|
  11630. * First DWORD:
  11631. * - MSG_TYPE
  11632. * Bits 7:0
  11633. * Purpose: Identifies this as an rx pn check indication message
  11634. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11635. * - PEER_ID
  11636. * Bits 23:8 (only bits 18:8 actually used)
  11637. * Purpose: identify which peer
  11638. * Value: (rx) peer ID
  11639. * - TID
  11640. * Bits 31:24 (only bits 27:24 actually used)
  11641. * Purpose: identify traffic identifier
  11642. * Value: traffic identifier
  11643. * Second DWORD:
  11644. * - SEQ_NUM_START
  11645. * Bits 7:0
  11646. * Purpose:
  11647. * Indicates the starting sequence number of the MPDU in this
  11648. * series of MPDUs that went though PN check.
  11649. * Value:
  11650. * The sequence number for the first MPDU in the sequence.
  11651. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11652. * - SEQ_NUM_END
  11653. * Bits 15:8
  11654. * Purpose:
  11655. * Indicates the ending sequence number of the MPDU in this
  11656. * series of MPDUs that went though PN check.
  11657. * Value:
  11658. * The sequence number one larger then the sequence number of the last
  11659. * MPDU being flushed.
  11660. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11661. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11662. * for invalid PN numbers and are ready to be released for further processing.
  11663. * Not all MPDUs within this range are necessarily valid - the host
  11664. * must check each sequence number within this range to see if the
  11665. * corresponding MPDU is actually present.
  11666. * - PN_IE_COUNT
  11667. * Bits 23:16
  11668. * Purpose:
  11669. * Used to determine the variable number of PN information elements in this
  11670. * message
  11671. *
  11672. * PN information elements:
  11673. * - PN_IE_x-
  11674. * Purpose:
  11675. * Each PN information element contains the sequence number of the MPDU that
  11676. * has failed the target PN check.
  11677. * Value:
  11678. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11679. * that failed the PN check.
  11680. */
  11681. /* first DWORD */
  11682. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11683. #define HTT_RX_PN_IND_PEER_ID_S 8
  11684. #define HTT_RX_PN_IND_TID_M 0xff000000
  11685. #define HTT_RX_PN_IND_TID_S 24
  11686. /* second DWORD */
  11687. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11688. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11689. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11690. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11691. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11692. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11693. #define HTT_RX_PN_IND_BYTES 8
  11694. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11695. do { \
  11696. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11697. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11698. } while (0)
  11699. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11700. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11701. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11702. do { \
  11703. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11704. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11705. } while (0)
  11706. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11707. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11708. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11709. do { \
  11710. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11711. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11712. } while (0)
  11713. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11714. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11715. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11716. do { \
  11717. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11718. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11719. } while (0)
  11720. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11721. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11722. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11723. do { \
  11724. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11725. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11726. } while (0)
  11727. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11728. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11729. /*
  11730. * @brief target -> host rx offload deliver message for LL system
  11731. *
  11732. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11733. *
  11734. * @details
  11735. * In a low latency system this message is sent whenever the offload
  11736. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11737. * The DMA of the actual packets into host memory is done before sending out
  11738. * this message. This message indicates only how many MSDUs to reap. The
  11739. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11740. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11741. * DMA'd by the MAC directly into host memory these packets do not contain
  11742. * the MAC descriptors in the header portion of the packet. Instead they contain
  11743. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11744. * message, the packets are delivered directly to the NW stack without going
  11745. * through the regular reorder buffering and PN checking path since it has
  11746. * already been done in target.
  11747. *
  11748. * |31 24|23 16|15 8|7 0|
  11749. * |-----------------------------------------------------------------------|
  11750. * | Total MSDU count | reserved | msg type |
  11751. * |-----------------------------------------------------------------------|
  11752. *
  11753. * @brief target -> host rx offload deliver message for HL system
  11754. *
  11755. * @details
  11756. * In a high latency system this message is sent whenever the offload manager
  11757. * flushes out the packets it has coalesced in its coalescing buffer. The
  11758. * actual packets are also carried along with this message. When the host
  11759. * receives this message, it is expected to deliver these packets to the NW
  11760. * stack directly instead of routing them through the reorder buffering and
  11761. * PN checking path since it has already been done in target.
  11762. *
  11763. * |31 24|23 16|15 8|7 0|
  11764. * |-----------------------------------------------------------------------|
  11765. * | Total MSDU count | reserved | msg type |
  11766. * |-----------------------------------------------------------------------|
  11767. * | peer ID | MSDU length |
  11768. * |-----------------------------------------------------------------------|
  11769. * | MSDU payload | FW Desc | tid | vdev ID |
  11770. * |-----------------------------------------------------------------------|
  11771. * | MSDU payload contd. |
  11772. * |-----------------------------------------------------------------------|
  11773. * | peer ID | MSDU length |
  11774. * |-----------------------------------------------------------------------|
  11775. * | MSDU payload | FW Desc | tid | vdev ID |
  11776. * |-----------------------------------------------------------------------|
  11777. * | MSDU payload contd. |
  11778. * |-----------------------------------------------------------------------|
  11779. *
  11780. */
  11781. /* first DWORD */
  11782. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11783. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11784. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11785. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11786. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11787. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11788. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11789. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11790. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11792. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11797. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11799. do { \
  11800. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11801. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11802. } while (0)
  11803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11804. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11805. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11806. do { \
  11807. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11808. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11809. } while (0)
  11810. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11811. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11812. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11813. do { \
  11814. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11815. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11816. } while (0)
  11817. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11818. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11819. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11820. do { \
  11821. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11822. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11823. } while (0)
  11824. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11825. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11826. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11827. do { \
  11828. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11829. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11830. } while (0)
  11831. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11832. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11833. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11834. do { \
  11835. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11836. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11837. } while (0)
  11838. /**
  11839. * @brief target -> host rx peer map/unmap message definition
  11840. *
  11841. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11842. *
  11843. * @details
  11844. * The following diagram shows the format of the rx peer map message sent
  11845. * from the target to the host. This layout assumes the target operates
  11846. * as little-endian.
  11847. *
  11848. * This message always contains a SW peer ID. The main purpose of the
  11849. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11850. * with, so that the host can use that peer ID to determine which peer
  11851. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11852. * other purposes, such as identifying during tx completions which peer
  11853. * the tx frames in question were transmitted to.
  11854. *
  11855. * In certain generations of chips, the peer map message also contains
  11856. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11857. * to identify which peer the frame needs to be forwarded to (i.e. the
  11858. * peer associated with the Destination MAC Address within the packet),
  11859. * and particularly which vdev needs to transmit the frame (for cases
  11860. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11861. * meaning as AST_INDEX_0.
  11862. * This DA-based peer ID that is provided for certain rx frames
  11863. * (the rx frames that need to be re-transmitted as tx frames)
  11864. * is the ID that the HW uses for referring to the peer in question,
  11865. * rather than the peer ID that the SW+FW use to refer to the peer.
  11866. *
  11867. *
  11868. * |31 24|23 16|15 8|7 0|
  11869. * |-----------------------------------------------------------------------|
  11870. * | SW peer ID | VDEV ID | msg type |
  11871. * |-----------------------------------------------------------------------|
  11872. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11873. * |-----------------------------------------------------------------------|
  11874. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11875. * |-----------------------------------------------------------------------|
  11876. *
  11877. *
  11878. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11879. *
  11880. * The following diagram shows the format of the rx peer unmap message sent
  11881. * from the target to the host.
  11882. *
  11883. * |31 24|23 16|15 8|7 0|
  11884. * |-----------------------------------------------------------------------|
  11885. * | SW peer ID | VDEV ID | msg type |
  11886. * |-----------------------------------------------------------------------|
  11887. *
  11888. * The following field definitions describe the format of the rx peer map
  11889. * and peer unmap messages sent from the target to the host.
  11890. * - MSG_TYPE
  11891. * Bits 7:0
  11892. * Purpose: identifies this as an rx peer map or peer unmap message
  11893. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11894. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11895. * - VDEV_ID
  11896. * Bits 15:8
  11897. * Purpose: Indicates which virtual device the peer is associated
  11898. * with.
  11899. * Value: vdev ID (used in the host to look up the vdev object)
  11900. * - PEER_ID (a.k.a. SW_PEER_ID)
  11901. * Bits 31:16
  11902. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11903. * freeing (unmap)
  11904. * Value: (rx) peer ID
  11905. * - MAC_ADDR_L32 (peer map only)
  11906. * Bits 31:0
  11907. * Purpose: Identifies which peer node the peer ID is for.
  11908. * Value: lower 4 bytes of peer node's MAC address
  11909. * - MAC_ADDR_U16 (peer map only)
  11910. * Bits 15:0
  11911. * Purpose: Identifies which peer node the peer ID is for.
  11912. * Value: upper 2 bytes of peer node's MAC address
  11913. * - HW_PEER_ID
  11914. * Bits 31:16
  11915. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11916. * address, so for rx frames marked for rx --> tx forwarding, the
  11917. * host can determine from the HW peer ID provided as meta-data with
  11918. * the rx frame which peer the frame is supposed to be forwarded to.
  11919. * Value: ID used by the MAC HW to identify the peer
  11920. */
  11921. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11922. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11923. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11924. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11925. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11926. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11927. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11928. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11929. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11930. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11931. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11932. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11933. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11934. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11935. do { \
  11936. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11937. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11938. } while (0)
  11939. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11940. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11941. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11942. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11943. do { \
  11944. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11945. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11946. } while (0)
  11947. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11948. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11949. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11950. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11951. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11954. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11955. } while (0)
  11956. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11957. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11958. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11959. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11960. #define HTT_RX_PEER_MAP_BYTES 12
  11961. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11962. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11963. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11964. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11965. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11966. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11967. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11968. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11969. #define HTT_RX_PEER_UNMAP_BYTES 4
  11970. /**
  11971. * @brief target -> host rx peer map V2 message definition
  11972. *
  11973. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11974. *
  11975. * @details
  11976. * The following diagram shows the format of the rx peer map v2 message sent
  11977. * from the target to the host. This layout assumes the target operates
  11978. * as little-endian.
  11979. *
  11980. * This message always contains a SW peer ID. The main purpose of the
  11981. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11982. * with, so that the host can use that peer ID to determine which peer
  11983. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11984. * other purposes, such as identifying during tx completions which peer
  11985. * the tx frames in question were transmitted to.
  11986. *
  11987. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11988. * is used during rx --> tx frame forwarding to identify which peer the
  11989. * frame needs to be forwarded to (i.e. the peer associated with the
  11990. * Destination MAC Address within the packet), and particularly which vdev
  11991. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11992. * This DA-based peer ID that is provided for certain rx frames
  11993. * (the rx frames that need to be re-transmitted as tx frames)
  11994. * is the ID that the HW uses for referring to the peer in question,
  11995. * rather than the peer ID that the SW+FW use to refer to the peer.
  11996. *
  11997. * The HW peer id here is the same meaning as AST_INDEX_0.
  11998. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11999. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  12000. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  12001. * AST is valid.
  12002. *
  12003. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  12004. * |-------------------------------------------------------------------------|
  12005. * | SW peer ID | VDEV ID | msg type |
  12006. * |-------------------------------------------------------------------------|
  12007. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12008. * |-------------------------------------------------------------------------|
  12009. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  12010. * |-------------------------------------------------------------------------|
  12011. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  12012. * |-------------------------------------------------------------------------|
  12013. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  12014. * |-------------------------------------------------------------------------|
  12015. * |TID valid low pri| TID valid hi pri | AST index 2 |
  12016. * |-------------------------------------------------------------------------|
  12017. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  12018. * |-------------------------------------------------------------------------|
  12019. * | Reserved_2 |
  12020. * |-------------------------------------------------------------------------|
  12021. * Where:
  12022. * NH = Next Hop
  12023. * ASTVM = AST valid mask
  12024. * OA = on-chip AST valid bit
  12025. * ASTFM = AST flow mask
  12026. *
  12027. * The following field definitions describe the format of the rx peer map v2
  12028. * messages sent from the target to the host.
  12029. * - MSG_TYPE
  12030. * Bits 7:0
  12031. * Purpose: identifies this as an rx peer map v2 message
  12032. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  12033. * - VDEV_ID
  12034. * Bits 15:8
  12035. * Purpose: Indicates which virtual device the peer is associated with.
  12036. * Value: vdev ID (used in the host to look up the vdev object)
  12037. * - SW_PEER_ID
  12038. * Bits 31:16
  12039. * Purpose: The peer ID (index) that WAL is allocating
  12040. * Value: (rx) peer ID
  12041. * - MAC_ADDR_L32
  12042. * Bits 31:0
  12043. * Purpose: Identifies which peer node the peer ID is for.
  12044. * Value: lower 4 bytes of peer node's MAC address
  12045. * - MAC_ADDR_U16
  12046. * Bits 15:0
  12047. * Purpose: Identifies which peer node the peer ID is for.
  12048. * Value: upper 2 bytes of peer node's MAC address
  12049. * - HW_PEER_ID / AST_INDEX_0
  12050. * Bits 31:16
  12051. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  12052. * address, so for rx frames marked for rx --> tx forwarding, the
  12053. * host can determine from the HW peer ID provided as meta-data with
  12054. * the rx frame which peer the frame is supposed to be forwarded to.
  12055. * Value: ID used by the MAC HW to identify the peer
  12056. * - AST_HASH_VALUE
  12057. * Bits 15:0
  12058. * Purpose: Indicates AST Hash value is required for the TCL AST index
  12059. * override feature.
  12060. * - NEXT_HOP
  12061. * Bit 16
  12062. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  12063. * (Wireless Distribution System).
  12064. * - AST_VALID_MASK
  12065. * Bits 19:17
  12066. * Purpose: Indicate if the AST 1 through AST 3 are valid
  12067. * - ONCHIP_AST_VALID_FLAG
  12068. * Bit 20
  12069. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  12070. * is valid.
  12071. * - AST_INDEX_1
  12072. * Bits 15:0
  12073. * Purpose: indicate the second AST index for this peer
  12074. * - AST_0_FLOW_MASK
  12075. * Bits 19:16
  12076. * Purpose: identify the which flow the AST 0 entry corresponds to.
  12077. * - AST_1_FLOW_MASK
  12078. * Bits 23:20
  12079. * Purpose: identify the which flow the AST 1 entry corresponds to.
  12080. * - AST_2_FLOW_MASK
  12081. * Bits 27:24
  12082. * Purpose: identify the which flow the AST 2 entry corresponds to.
  12083. * - AST_3_FLOW_MASK
  12084. * Bits 31:28
  12085. * Purpose: identify the which flow the AST 3 entry corresponds to.
  12086. * - AST_INDEX_2
  12087. * Bits 15:0
  12088. * Purpose: indicate the third AST index for this peer
  12089. * - TID_VALID_HI_PRI
  12090. * Bits 23:16
  12091. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  12092. * - TID_VALID_LOW_PRI
  12093. * Bits 31:24
  12094. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  12095. * - AST_INDEX_3
  12096. * Bits 15:0
  12097. * Purpose: indicate the fourth AST index for this peer
  12098. * - ONCHIP_AST_IDX / RESERVED
  12099. * Bits 31:16
  12100. * Purpose: This field is valid only when split AST feature is enabled.
  12101. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  12102. * If valid, identifies the HW peer ID corresponding to the peer MAC
  12103. * address, this ast_idx is used for LMAC modules for RXPCU.
  12104. * Value: ID used by the LMAC HW to identify the peer
  12105. */
  12106. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  12107. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  12108. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  12109. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  12110. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  12111. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  12112. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  12113. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  12114. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  12115. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  12116. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  12117. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  12118. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  12119. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  12120. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  12121. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  12122. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  12123. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  12124. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  12125. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  12126. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  12127. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  12128. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  12129. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  12130. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  12131. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  12132. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  12133. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  12134. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  12135. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  12136. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  12137. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  12138. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  12139. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  12140. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  12141. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  12142. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  12143. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  12144. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  12145. do { \
  12146. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  12147. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  12148. } while (0)
  12149. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  12150. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  12151. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  12152. do { \
  12153. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  12154. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  12155. } while (0)
  12156. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  12157. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  12158. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  12159. do { \
  12160. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  12161. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  12162. } while (0)
  12163. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  12164. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  12165. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  12166. do { \
  12167. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  12168. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  12169. } while (0)
  12170. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  12171. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  12172. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  12173. do { \
  12174. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  12175. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  12176. } while (0)
  12177. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  12178. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  12179. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  12180. do { \
  12181. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  12182. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  12183. } while (0)
  12184. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  12185. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  12186. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  12187. do { \
  12188. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  12189. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  12190. } while (0)
  12191. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  12192. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  12193. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12194. do { \
  12195. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  12196. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  12197. } while (0)
  12198. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  12199. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  12200. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  12201. do { \
  12202. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  12203. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  12204. } while (0)
  12205. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  12206. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  12207. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  12208. do { \
  12209. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  12210. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  12211. } while (0)
  12212. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  12213. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  12214. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  12215. do { \
  12216. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  12217. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  12218. } while (0)
  12219. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  12220. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  12221. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  12222. do { \
  12223. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  12224. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  12225. } while (0)
  12226. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  12227. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  12228. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  12229. do { \
  12230. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  12231. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  12232. } while (0)
  12233. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  12234. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  12235. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  12236. do { \
  12237. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  12238. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  12239. } while (0)
  12240. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  12241. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  12242. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  12243. do { \
  12244. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  12245. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  12246. } while (0)
  12247. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  12248. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  12249. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  12252. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  12253. } while (0)
  12254. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  12255. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  12256. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  12259. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  12260. } while (0)
  12261. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  12262. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  12263. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12264. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  12265. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  12266. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  12267. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  12268. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  12269. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  12270. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  12271. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  12272. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  12273. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  12274. #define HTT_RX_PEER_MAP_V2_BYTES 32
  12275. /**
  12276. * @brief target -> host rx peer map V3 message definition
  12277. *
  12278. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  12279. *
  12280. * @details
  12281. * The following diagram shows the format of the rx peer map v3 message sent
  12282. * from the target to the host.
  12283. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  12284. * This layout assumes the target operates as little-endian.
  12285. *
  12286. * |31 24|23 20|19|18|17|16|15 8|7 0|
  12287. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  12288. * | SW peer ID | VDEV ID | msg type |
  12289. * |-----------------+--------------------+-----------------+-----------------|
  12290. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12291. * |-----------------+--------------------+-----------------+-----------------|
  12292. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  12293. * |-----------------+--------+-----------+-----------------+-----------------|
  12294. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  12295. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  12296. * | (8bits) | | (4bits) | |
  12297. * |-----------------+--------+--+--+--+--------------------------------------|
  12298. * | RESERVED |E |O | | |
  12299. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  12300. * | |V |V | | |
  12301. * |-----------------+--------------------+-----------------------------------|
  12302. * | HTT_MSDU_IDX_ | RESERVED | |
  12303. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  12304. * | (8bits) | | |
  12305. * |-----------------+--------------------+-----------------------------------|
  12306. * | Reserved_2 |
  12307. * |--------------------------------------------------------------------------|
  12308. * | Reserved_3 |
  12309. * |--------------------------------------------------------------------------|
  12310. *
  12311. * Where:
  12312. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  12313. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  12314. * NH = Next Hop
  12315. * The following field definitions describe the format of the rx peer map v3
  12316. * messages sent from the target to the host.
  12317. * - MSG_TYPE
  12318. * Bits 7:0
  12319. * Purpose: identifies this as a peer map v3 message
  12320. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  12321. * - VDEV_ID
  12322. * Bits 15:8
  12323. * Purpose: Indicates which virtual device the peer is associated with.
  12324. * - SW_PEER_ID
  12325. * Bits 31:16
  12326. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  12327. * - MAC_ADDR_L32
  12328. * Bits 31:0
  12329. * Purpose: Identifies which peer node the peer ID is for.
  12330. * Value: lower 4 bytes of peer node's MAC address
  12331. * - MAC_ADDR_U16
  12332. * Bits 15:0
  12333. * Purpose: Identifies which peer node the peer ID is for.
  12334. * Value: upper 2 bytes of peer node's MAC address
  12335. * - MULTICAST_SW_PEER_ID
  12336. * Bits 31:16
  12337. * Purpose: The multicast peer ID (index)
  12338. * Value: set to HTT_INVALID_PEER if not valid
  12339. * - HW_PEER_ID / AST_INDEX
  12340. * Bits 15:0
  12341. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  12342. * address, so for rx frames marked for rx --> tx forwarding, the
  12343. * host can determine from the HW peer ID provided as meta-data with
  12344. * the rx frame which peer the frame is supposed to be forwarded to.
  12345. * - CACHE_SET_NUM
  12346. * Bits 19:16
  12347. * Purpose: Cache Set Number for AST_INDEX
  12348. * Cache set number that should be used to cache the index based
  12349. * search results, for address and flow search.
  12350. * This value should be equal to LSB 4 bits of the hash value
  12351. * of match data, in case of search index points to an entry which
  12352. * may be used in content based search also. The value can be
  12353. * anything when the entry pointed by search index will not be
  12354. * used for content based search.
  12355. * - HTT_MSDU_IDX_VALID_MASK
  12356. * Bits 31:24
  12357. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  12358. * - ONCHIP_AST_IDX / RESERVED
  12359. * Bits 15:0
  12360. * Purpose: This field is valid only when split AST feature is enabled.
  12361. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  12362. * If valid, identifies the HW peer ID corresponding to the peer MAC
  12363. * address, this ast_idx is used for LMAC modules for RXPCU.
  12364. * - NEXT_HOP
  12365. * Bits 16
  12366. * Purpose: Flag indicates next_hop AST entry used for WDS
  12367. * (Wireless Distribution System).
  12368. * - ONCHIP_AST_VALID
  12369. * Bits 17
  12370. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  12371. * - EXT_AST_VALID
  12372. * Bits 18
  12373. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  12374. * - EXT_AST_INDEX
  12375. * Bits 15:0
  12376. * Purpose: This field describes Extended AST index
  12377. * Valid if EXT_AST_VALID flag set
  12378. * - HTT_MSDU_IDX_VALID_MASK_EXT
  12379. * Bits 31:24
  12380. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  12381. */
  12382. /* dword 0 */
  12383. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  12384. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  12385. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  12386. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  12387. /* dword 1 */
  12388. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  12389. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  12390. /* dword 2 */
  12391. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  12392. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12393. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12394. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12395. /* dword 3 */
  12396. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12397. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12398. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12399. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12400. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12401. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12402. /* dword 4 */
  12403. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12404. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12405. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12406. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12407. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12408. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12409. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12410. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12411. /* dword 5 */
  12412. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12413. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12414. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12415. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12416. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12417. do { \
  12418. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12419. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12420. } while (0)
  12421. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12422. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12423. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12424. do { \
  12425. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12426. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12427. } while (0)
  12428. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12429. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12430. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12431. do { \
  12432. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12433. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12434. } while (0)
  12435. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12436. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12437. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12438. do { \
  12439. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12440. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12441. } while (0)
  12442. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12443. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12444. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12445. do { \
  12446. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12447. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12448. } while (0)
  12449. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12450. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12451. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12452. do { \
  12453. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12454. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12455. } while (0)
  12456. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12457. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12458. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12459. do { \
  12460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12461. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12462. } while (0)
  12463. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12464. (((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)
  12465. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12466. do { \
  12467. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12468. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12469. } while (0)
  12470. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12471. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12472. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12473. do { \
  12474. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12475. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12476. } while (0)
  12477. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12478. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12479. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12480. do { \
  12481. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12482. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12483. } while (0)
  12484. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12485. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12486. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12487. do { \
  12488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12489. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12490. } while (0)
  12491. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12492. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12493. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12494. do { \
  12495. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12496. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12497. } while (0)
  12498. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12499. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12500. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12501. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12502. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12503. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12504. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12505. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12506. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12507. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12508. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12509. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12510. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12511. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12512. /**
  12513. * @brief target -> host rx peer unmap V2 message definition
  12514. *
  12515. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12516. *
  12517. * The following diagram shows the format of the rx peer unmap message sent
  12518. * from the target to the host.
  12519. *
  12520. * |31 24|23 16|15 8|7 0|
  12521. * |-----------------------------------------------------------------------|
  12522. * | SW peer ID | VDEV ID | msg type |
  12523. * |-----------------------------------------------------------------------|
  12524. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12525. * |-----------------------------------------------------------------------|
  12526. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12527. * |-----------------------------------------------------------------------|
  12528. * | Peer Delete Duration |
  12529. * |-----------------------------------------------------------------------|
  12530. * | Reserved_0 | WDS Free Count |
  12531. * |-----------------------------------------------------------------------|
  12532. * | Reserved_1 |
  12533. * |-----------------------------------------------------------------------|
  12534. * | Reserved_2 |
  12535. * |-----------------------------------------------------------------------|
  12536. *
  12537. *
  12538. * The following field definitions describe the format of the rx peer unmap
  12539. * messages sent from the target to the host.
  12540. * - MSG_TYPE
  12541. * Bits 7:0
  12542. * Purpose: identifies this as an rx peer unmap v2 message
  12543. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12544. * - VDEV_ID
  12545. * Bits 15:8
  12546. * Purpose: Indicates which virtual device the peer is associated
  12547. * with.
  12548. * Value: vdev ID (used in the host to look up the vdev object)
  12549. * - SW_PEER_ID
  12550. * Bits 31:16
  12551. * Purpose: The peer ID (index) that WAL is freeing
  12552. * Value: (rx) peer ID
  12553. * - MAC_ADDR_L32
  12554. * Bits 31:0
  12555. * Purpose: Identifies which peer node the peer ID is for.
  12556. * Value: lower 4 bytes of peer node's MAC address
  12557. * - MAC_ADDR_U16
  12558. * Bits 15:0
  12559. * Purpose: Identifies which peer node the peer ID is for.
  12560. * Value: upper 2 bytes of peer node's MAC address
  12561. * - NEXT_HOP
  12562. * Bits 16
  12563. * Purpose: Bit indicates next_hop AST entry used for WDS
  12564. * (Wireless Distribution System).
  12565. * - PEER_DELETE_DURATION
  12566. * Bits 31:0
  12567. * Purpose: Time taken to delete peer, in msec,
  12568. * Used for monitoring / debugging PEER delete response delay
  12569. * - PEER_WDS_FREE_COUNT
  12570. * Bits 15:0
  12571. * Purpose: Count of WDS entries deleted associated to peer deleted
  12572. */
  12573. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12574. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12575. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12576. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12577. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12578. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12579. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12580. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12581. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12582. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12583. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12584. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12585. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12586. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12587. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12588. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12589. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12590. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12591. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12592. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12593. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12594. do { \
  12595. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12596. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12597. } while (0)
  12598. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12599. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12600. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12601. do { \
  12602. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12603. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12604. } while (0)
  12605. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12606. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12607. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12608. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12609. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12610. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12611. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12612. /**
  12613. * @brief target -> host rx peer mlo map message definition
  12614. *
  12615. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12616. *
  12617. * @details
  12618. * The following diagram shows the format of the rx mlo peer map message sent
  12619. * from the target to the host. This layout assumes the target operates
  12620. * as little-endian.
  12621. *
  12622. * MCC:
  12623. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12624. *
  12625. * WIN:
  12626. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12627. * It will be sent on the Assoc Link.
  12628. *
  12629. * This message always contains a MLO peer ID. The main purpose of the
  12630. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12631. * with, so that the host can use that MLO peer ID to determine which peer
  12632. * transmitted the rx frame.
  12633. *
  12634. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12635. * |-------------------------------------------------------------------------|
  12636. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12637. * |-------------------------------------------------------------------------|
  12638. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12639. * |-------------------------------------------------------------------------|
  12640. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12641. * |-------------------------------------------------------------------------|
  12642. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12643. * |-------------------------------------------------------------------------|
  12644. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12645. * |-------------------------------------------------------------------------|
  12646. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12647. * |-------------------------------------------------------------------------|
  12648. * |RSVD |
  12649. * |-------------------------------------------------------------------------|
  12650. * |RSVD |
  12651. * |-------------------------------------------------------------------------|
  12652. * | htt_tlv_hdr_t |
  12653. * |-------------------------------------------------------------------------|
  12654. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12655. * |-------------------------------------------------------------------------|
  12656. * | htt_tlv_hdr_t |
  12657. * |-------------------------------------------------------------------------|
  12658. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12659. * |-------------------------------------------------------------------------|
  12660. * | htt_tlv_hdr_t |
  12661. * |-------------------------------------------------------------------------|
  12662. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12663. * |-------------------------------------------------------------------------|
  12664. *
  12665. * Where:
  12666. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12667. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12668. * V (valid) - 1 Bit Bit17
  12669. * CHIPID - 3 Bits
  12670. * TIDMASK - 8 Bits
  12671. * CACHE_SET_NUM - 8 Bits
  12672. *
  12673. * The following field definitions describe the format of the rx MLO peer map
  12674. * messages sent from the target to the host.
  12675. * - MSG_TYPE
  12676. * Bits 7:0
  12677. * Purpose: identifies this as an rx mlo peer map message
  12678. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12679. *
  12680. * - MLO_PEER_ID
  12681. * Bits 23:8
  12682. * Purpose: The MLO peer ID (index).
  12683. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12684. * Value: MLO peer ID
  12685. *
  12686. * - NUMLINK
  12687. * Bits: 26:24 (3Bits)
  12688. * Purpose: Indicate the max number of logical links supported per client.
  12689. * Value: number of logical links
  12690. *
  12691. * - PRC
  12692. * Bits: 29:27 (3Bits)
  12693. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12694. * if there is migration of the primary chip.
  12695. * Value: Primary REO CHIPID
  12696. *
  12697. * - MAC_ADDR_L32
  12698. * Bits 31:0
  12699. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12700. * Value: lower 4 bytes of peer node's MAC address
  12701. *
  12702. * - MAC_ADDR_U16
  12703. * Bits 15:0
  12704. * Purpose: Identifies which peer node the peer ID is for.
  12705. * Value: upper 2 bytes of peer node's MAC address
  12706. *
  12707. * - PRIMARY_TCL_AST_IDX
  12708. * Bits 15:0
  12709. * Purpose: Primary TCL AST index for this peer.
  12710. *
  12711. * - V
  12712. * 1 Bit Position 16
  12713. * Purpose: If the ast idx is valid.
  12714. *
  12715. * - CHIPID
  12716. * Bits 19:17
  12717. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12718. *
  12719. * - TIDMASK
  12720. * Bits 27:20
  12721. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12722. *
  12723. * - CACHE_SET_NUM
  12724. * Bits 31:28
  12725. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12726. * Cache set number that should be used to cache the index based
  12727. * search results, for address and flow search.
  12728. * This value should be equal to LSB four bits of the hash value
  12729. * of match data, in case of search index points to an entry which
  12730. * may be used in content based search also. The value can be
  12731. * anything when the entry pointed by search index will not be
  12732. * used for content based search.
  12733. *
  12734. * - htt_tlv_hdr_t
  12735. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12736. *
  12737. * Bits 11:0
  12738. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12739. *
  12740. * Bits 23:12
  12741. * Purpose: Length, Length of the value that follows the header
  12742. *
  12743. * Bits 31:28
  12744. * Purpose: Reserved.
  12745. *
  12746. *
  12747. * - SW_PEER_ID
  12748. * Bits 15:0
  12749. * Purpose: The peer ID (index) that WAL is allocating
  12750. * Value: (rx) peer ID
  12751. *
  12752. * - VDEV_ID
  12753. * Bits 23:16
  12754. * Purpose: Indicates which virtual device the peer is associated with.
  12755. * Value: vdev ID (used in the host to look up the vdev object)
  12756. *
  12757. * - CHIPID
  12758. * Bits 26:24
  12759. * Purpose: Indicates which Chip id the peer is associated with.
  12760. * Value: chip ID (Provided by Host as part of QMI exchange)
  12761. */
  12762. typedef enum {
  12763. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12764. } MLO_PEER_MAP_TLV_TAG_ID;
  12765. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12766. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12767. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12768. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12769. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12770. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12771. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12772. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12773. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12774. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12775. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12776. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12777. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12778. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12779. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12780. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12781. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12782. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12783. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12784. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12785. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12786. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12787. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12788. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12789. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12790. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12791. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12792. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12793. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12794. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12795. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12796. do { \
  12797. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12798. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12799. } while (0)
  12800. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12801. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12802. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12803. do { \
  12804. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12805. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12806. } while (0)
  12807. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12808. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12809. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12810. do { \
  12811. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12812. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12813. } while (0)
  12814. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12815. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12816. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12817. do { \
  12818. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12819. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12820. } while (0)
  12821. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12822. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12823. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12824. do { \
  12825. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12826. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12827. } while (0)
  12828. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12829. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12830. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12831. do { \
  12832. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12833. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12834. } while (0)
  12835. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12836. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12837. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12838. do { \
  12839. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12840. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12841. } while (0)
  12842. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12843. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12844. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12845. do { \
  12846. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12847. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12848. } while (0)
  12849. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12850. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12851. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12852. do { \
  12853. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12854. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12855. } while (0)
  12856. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12857. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12858. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12859. do { \
  12860. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12861. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12862. } while (0)
  12863. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12864. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12865. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12866. do { \
  12867. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12868. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12869. } while (0)
  12870. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12871. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12872. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12873. do { \
  12874. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12875. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12876. } while (0)
  12877. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12878. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12879. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12880. do { \
  12881. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12882. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12883. } while (0)
  12884. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12885. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12886. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12887. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12888. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12889. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12890. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12891. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12892. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12893. *
  12894. * The following diagram shows the format of the rx mlo peer unmap message sent
  12895. * from the target to the host.
  12896. *
  12897. * |31 24|23 16|15 8|7 0|
  12898. * |-----------------------------------------------------------------------|
  12899. * | RSVD_24_31 | MLO peer ID | msg type |
  12900. * |-----------------------------------------------------------------------|
  12901. */
  12902. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12903. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12904. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12905. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12906. /**
  12907. * @brief target -> host peer extended event for additional information
  12908. *
  12909. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_EXTENDED_EVENT
  12910. *
  12911. * @details
  12912. * The following diagram shows the format of the peer extended message sent
  12913. * from the target to the host. This layout assumes the target operates
  12914. * as little-endian.
  12915. *
  12916. * This message always contains a SW peer ID. The main purpose of the
  12917. * SW peer ID is to tell the host what peer ID logical link id will be tagged
  12918. * with, so that the host can use that peer ID to determine which link
  12919. * transmitted the rx/tx frame.
  12920. *
  12921. * This message also contains MLO logical link id assigned to peer
  12922. * with sw_peer_id if it is valid ML link peer.
  12923. *
  12924. *
  12925. * |31 28|27 24|23 20|19|18 16|15 8|7 0|
  12926. * |---------------------------------------------------------------------------|
  12927. * | VDEV_ID | SW peer ID | msg type |
  12928. * |---------------------------------------------------------------------------|
  12929. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12930. * |---------------------------------------------------------------------------|
  12931. * | Reserved |V | LINK ID | MAC addr 5 | MAC addr 4 |
  12932. * |---------------------------------------------------------------------------|
  12933. * | Reserved |
  12934. * |---------------------------------------------------------------------------|
  12935. * | Reserved |
  12936. * |---------------------------------------------------------------------------|
  12937. *
  12938. * Where:
  12939. * LINK_ID (LOGICAL) - 3 Bits Bit16,17,18 of 3rd byte
  12940. * V (valid) - 1 Bit Bit19 of 3rd byte
  12941. *
  12942. * The following field definitions describe the format of the rx peer extended
  12943. * event messages sent from the target to the host.
  12944. * MSG_TYPE
  12945. * Bits 7:0
  12946. * Purpose: identifies this as an rx MLO peer extended information message
  12947. * Value: 0x39 (HTT_T2H_MSG_TYPE_PEER_EXTENDED_EVENT)
  12948. * - PEER_ID (a.k.a. SW_PEER_ID)
  12949. * Bits 8:23
  12950. * Purpose: The peer ID (index) that WAL has allocated
  12951. * Value: (rx) peer ID
  12952. * - VDEV_ID
  12953. * Bits 24:31
  12954. * Purpose: Gives the vdev id of peer with peer_id as above.
  12955. * Value: VDEV ID of wal_peer
  12956. *
  12957. * - MAC_ADDR_L32
  12958. * Bits 31:0
  12959. * Purpose: Identifies which peer node the peer ID is for.
  12960. * Value: lower 4 bytes of peer node's MAC address
  12961. *
  12962. * - MAC_ADDR_U16
  12963. * Bits 15:0
  12964. * Purpose: Identifies which peer node the peer ID is for.
  12965. * Value: upper 2 bytes of peer node's MAC address
  12966. * Rest all bits are reserved for future expansion
  12967. * - LOGICAL_LINK_ID
  12968. * Bits 18:16
  12969. * Purpose: Gives the logical link id of peer with peer_id as above. This
  12970. * field should be taken alongwith LOGICAL_LINK_ID_VALID
  12971. * Value: Logical link id used by wal_peer
  12972. * - LOGICAL_LINK_ID_VALID
  12973. * Bit 19
  12974. * Purpose: Clarifies whether the logical link id of peer with peer_id as
  12975. * is valid or not
  12976. * Value: 0/1 indicating LOGICAL_LINK_ID is valid or not
  12977. */
  12978. #define HTT_RX_PEER_EXTENDED_PEER_ID_M 0x00ffff00
  12979. #define HTT_RX_PEER_EXTENDED_PEER_ID_S 8
  12980. #define HTT_RX_PEER_EXTENDED_VDEV_ID_M 0xff000000
  12981. #define HTT_RX_PEER_EXTENDED_VDEV_ID_S 24
  12982. #define HTT_RX_PEER_EXTENDED_MAC_ADDR_L32_M 0xffffffff
  12983. #define HTT_RX_PEER_EXTENDED_MAC_ADDR_L32_S 0
  12984. #define HTT_RX_PEER_EXTENDED_MAC_ADDR_U16_M 0x0000ffff
  12985. #define HTT_RX_PEER_EXTENDED_MAC_ADDR_U16_S 0
  12986. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_M 0x00070000
  12987. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_S 16
  12988. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_M 0x00080000
  12989. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_S 19
  12990. #define HTT_RX_PEER_EXTENDED_PEER_ID_SET(word, value) \
  12991. do { \
  12992. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  12993. (word) |= (value) << HTT_RX_PEER_EXTENDED_PEER_ID_S; \
  12994. } while (0)
  12995. #define HTT_RX_PEER_EXTENDED_PEER_ID_GET(word) \
  12996. (((word) & HTT_RX_PEER_EXTENDED_PEER_ID_M) >> HTT_RX_PEER_EXTENDED_PEER_ID_S)
  12997. #define HTT_RX_PEER_EXTENDED_VDEV_ID_SET(word, value) \
  12998. do { \
  12999. HTT_CHECK_SET_VAL(HTT_RX_PEER_EXTENDED_VDEV_ID, value); \
  13000. (word) |= (value) << HTT_RX_PEER_EXTENDED_VDEV_ID_S; \
  13001. } while (0)
  13002. #define HTT_RX_PEER_EXTENDED_VDEV_ID_GET(word) \
  13003. (((word) & HTT_RX_PEER_EXTENDED_VDEV_ID_M) >> HTT_RX_PEER_EXTENDED_VDEV_ID_S)
  13004. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_SET(word, value) \
  13005. do { \
  13006. HTT_CHECK_SET_VAL(HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID, value); \
  13007. (word) |= (value) << HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_S; \
  13008. } while (0)
  13009. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_GET(word) \
  13010. (((word) & HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_S)
  13011. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_SET(word, value) \
  13012. do { \
  13013. HTT_CHECK_SET_VAL(HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID, value); \
  13014. (word) |= (value) << HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_S; \
  13015. } while (0)
  13016. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_GET(word) \
  13017. (((word) & HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_M) >> HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_S)
  13018. #define HTT_RX_PEER_EXTENDED_MAC_ADDR_OFFSET 4 /* bytes */
  13019. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_OFFSET 8 /* bytes */
  13020. #define HTT_RX_PEER_EXTENDED_LOGICAL_LINK_ID_VALID_OFFSET 8 /* bytes */
  13021. #define HTT_RX_PEER_EXTENDED_EVENT_BYTES 20 /* bytes */
  13022. /**
  13023. * @brief target -> host message specifying security parameters
  13024. *
  13025. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  13026. *
  13027. * @details
  13028. * The following diagram shows the format of the security specification
  13029. * message sent from the target to the host.
  13030. * This security specification message tells the host whether a PN check is
  13031. * necessary on rx data frames, and if so, how large the PN counter is.
  13032. * This message also tells the host about the security processing to apply
  13033. * to defragmented rx frames - specifically, whether a Message Integrity
  13034. * Check is required, and the Michael key to use.
  13035. *
  13036. * |31 24|23 16|15|14 8|7 0|
  13037. * |-----------------------------------------------------------------------|
  13038. * | peer ID | U| security type | msg type |
  13039. * |-----------------------------------------------------------------------|
  13040. * | Michael Key K0 |
  13041. * |-----------------------------------------------------------------------|
  13042. * | Michael Key K1 |
  13043. * |-----------------------------------------------------------------------|
  13044. * | WAPI RSC Low0 |
  13045. * |-----------------------------------------------------------------------|
  13046. * | WAPI RSC Low1 |
  13047. * |-----------------------------------------------------------------------|
  13048. * | WAPI RSC Hi0 |
  13049. * |-----------------------------------------------------------------------|
  13050. * | WAPI RSC Hi1 |
  13051. * |-----------------------------------------------------------------------|
  13052. *
  13053. * The following field definitions describe the format of the security
  13054. * indication message sent from the target to the host.
  13055. * - MSG_TYPE
  13056. * Bits 7:0
  13057. * Purpose: identifies this as a security specification message
  13058. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  13059. * - SEC_TYPE
  13060. * Bits 14:8
  13061. * Purpose: specifies which type of security applies to the peer
  13062. * Value: htt_sec_type enum value
  13063. * - UNICAST
  13064. * Bit 15
  13065. * Purpose: whether this security is applied to unicast or multicast data
  13066. * Value: 1 -> unicast, 0 -> multicast
  13067. * - PEER_ID
  13068. * Bits 31:16
  13069. * Purpose: The ID number for the peer the security specification is for
  13070. * Value: peer ID
  13071. * - MICHAEL_KEY_K0
  13072. * Bits 31:0
  13073. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  13074. * Value: Michael Key K0 (if security type is TKIP)
  13075. * - MICHAEL_KEY_K1
  13076. * Bits 31:0
  13077. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  13078. * Value: Michael Key K1 (if security type is TKIP)
  13079. * - WAPI_RSC_LOW0
  13080. * Bits 31:0
  13081. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  13082. * Value: WAPI RSC Low0 (if security type is WAPI)
  13083. * - WAPI_RSC_LOW1
  13084. * Bits 31:0
  13085. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  13086. * Value: WAPI RSC Low1 (if security type is WAPI)
  13087. * - WAPI_RSC_HI0
  13088. * Bits 31:0
  13089. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  13090. * Value: WAPI RSC Hi0 (if security type is WAPI)
  13091. * - WAPI_RSC_HI1
  13092. * Bits 31:0
  13093. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  13094. * Value: WAPI RSC Hi1 (if security type is WAPI)
  13095. */
  13096. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  13097. #define HTT_SEC_IND_SEC_TYPE_S 8
  13098. #define HTT_SEC_IND_UNICAST_M 0x00008000
  13099. #define HTT_SEC_IND_UNICAST_S 15
  13100. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  13101. #define HTT_SEC_IND_PEER_ID_S 16
  13102. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  13103. do { \
  13104. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  13105. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  13106. } while (0)
  13107. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  13108. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  13109. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  13112. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  13113. } while (0)
  13114. #define HTT_SEC_IND_UNICAST_GET(word) \
  13115. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  13116. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  13117. do { \
  13118. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  13119. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  13120. } while (0)
  13121. #define HTT_SEC_IND_PEER_ID_GET(word) \
  13122. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  13123. #define HTT_SEC_IND_BYTES 28
  13124. /**
  13125. * @brief target -> host rx ADDBA / DELBA message definitions
  13126. *
  13127. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  13128. *
  13129. * @details
  13130. * The following diagram shows the format of the rx ADDBA message sent
  13131. * from the target to the host:
  13132. *
  13133. * |31 20|19 16|15 8|7 0|
  13134. * |---------------------------------------------------------------------|
  13135. * | peer ID | TID | window size | msg type |
  13136. * |---------------------------------------------------------------------|
  13137. *
  13138. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  13139. *
  13140. * The following diagram shows the format of the rx DELBA message sent
  13141. * from the target to the host:
  13142. *
  13143. * |31 20|19 16|15 10|9 8|7 0|
  13144. * |---------------------------------------------------------------------|
  13145. * | peer ID | TID | window size | IR| msg type |
  13146. * |---------------------------------------------------------------------|
  13147. *
  13148. * The following field definitions describe the format of the rx ADDBA
  13149. * and DELBA messages sent from the target to the host.
  13150. * - MSG_TYPE
  13151. * Bits 7:0
  13152. * Purpose: identifies this as an rx ADDBA or DELBA message
  13153. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  13154. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  13155. * - IR (initiator / recipient)
  13156. * Bits 9:8 (DELBA only)
  13157. * Purpose: specify whether the DELBA handshake was initiated by the
  13158. * local STA/AP, or by the peer STA/AP
  13159. * Value:
  13160. * 0 - unspecified
  13161. * 1 - initiator (a.k.a. originator)
  13162. * 2 - recipient (a.k.a. responder)
  13163. * 3 - unused / reserved
  13164. * - WIN_SIZE
  13165. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  13166. * Purpose: Specifies the length of the block ack window (max = 64).
  13167. * Value:
  13168. * block ack window length specified by the received ADDBA/DELBA
  13169. * management message.
  13170. * - TID
  13171. * Bits 19:16
  13172. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  13173. * Value:
  13174. * TID specified by the received ADDBA or DELBA management message.
  13175. * - PEER_ID
  13176. * Bits 31:20
  13177. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  13178. * Value:
  13179. * ID (hash value) used by the host for fast, direct lookup of
  13180. * host SW peer info, including rx reorder states.
  13181. */
  13182. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  13183. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  13184. #define HTT_RX_ADDBA_TID_M 0xf0000
  13185. #define HTT_RX_ADDBA_TID_S 16
  13186. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  13187. #define HTT_RX_ADDBA_PEER_ID_S 20
  13188. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  13191. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  13192. } while (0)
  13193. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  13194. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  13195. #define HTT_RX_ADDBA_TID_SET(word, value) \
  13196. do { \
  13197. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  13198. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  13199. } while (0)
  13200. #define HTT_RX_ADDBA_TID_GET(word) \
  13201. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  13202. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  13203. do { \
  13204. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  13205. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  13206. } while (0)
  13207. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  13208. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  13209. #define HTT_RX_ADDBA_BYTES 4
  13210. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  13211. #define HTT_RX_DELBA_INITIATOR_S 8
  13212. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  13213. #define HTT_RX_DELBA_WIN_SIZE_S 10
  13214. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  13215. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  13216. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  13217. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  13218. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  13219. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  13220. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  13221. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  13222. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  13223. do { \
  13224. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  13225. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  13226. } while (0)
  13227. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  13228. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  13229. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  13230. do { \
  13231. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  13232. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  13233. } while (0)
  13234. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  13235. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  13236. #define HTT_RX_DELBA_BYTES 4
  13237. /**
  13238. * @brief target -> host rx ADDBA / DELBA message definitions
  13239. *
  13240. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  13241. *
  13242. * @details
  13243. * The following diagram shows the format of the rx ADDBA extn message sent
  13244. * from the target to the host:
  13245. *
  13246. * |31 20|19 16|15 13|12 8|7 0|
  13247. * |---------------------------------------------------------------------|
  13248. * | peer ID | TID | reserved | msg type |
  13249. * |---------------------------------------------------------------------|
  13250. * | reserved | window size |
  13251. * |---------------------------------------------------------------------|
  13252. *
  13253. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  13254. *
  13255. * The following diagram shows the format of the rx DELBA message sent
  13256. * from the target to the host:
  13257. *
  13258. * |31 20|19 16|15 13|12 10|9 8|7 0|
  13259. * |---------------------------------------------------------------------|
  13260. * | peer ID | TID | reserved | IR| msg type |
  13261. * |---------------------------------------------------------------------|
  13262. * | reserved | window size |
  13263. * |---------------------------------------------------------------------|
  13264. *
  13265. * The following field definitions describe the format of the rx ADDBA
  13266. * and DELBA messages sent from the target to the host.
  13267. * - MSG_TYPE
  13268. * Bits 7:0
  13269. * Purpose: identifies this as an rx ADDBA or DELBA message
  13270. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  13271. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  13272. * - IR (initiator / recipient)
  13273. * Bits 9:8 (DELBA only)
  13274. * Purpose: specify whether the DELBA handshake was initiated by the
  13275. * local STA/AP, or by the peer STA/AP
  13276. * Value:
  13277. * 0 - unspecified
  13278. * 1 - initiator (a.k.a. originator)
  13279. * 2 - recipient (a.k.a. responder)
  13280. * 3 - unused / reserved
  13281. * Value:
  13282. * block ack window length specified by the received ADDBA/DELBA
  13283. * management message.
  13284. * - TID
  13285. * Bits 19:16
  13286. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  13287. * Value:
  13288. * TID specified by the received ADDBA or DELBA management message.
  13289. * - PEER_ID
  13290. * Bits 31:20
  13291. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  13292. * Value:
  13293. * ID (hash value) used by the host for fast, direct lookup of
  13294. * host SW peer info, including rx reorder states.
  13295. * == DWORD 1
  13296. * - WIN_SIZE
  13297. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  13298. * Purpose: Specifies the length of the block ack window (max = 8191).
  13299. */
  13300. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  13301. #define HTT_RX_ADDBA_EXTN_TID_S 16
  13302. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  13303. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  13304. /*--- Dword 0 ---*/
  13305. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  13306. do { \
  13307. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  13308. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  13309. } while (0)
  13310. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  13311. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  13312. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  13313. do { \
  13314. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  13315. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  13316. } while (0)
  13317. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  13318. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  13319. /*--- Dword 1 ---*/
  13320. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  13321. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  13322. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  13323. do { \
  13324. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  13325. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  13326. } while (0)
  13327. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  13328. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  13329. #define HTT_RX_ADDBA_EXTN_BYTES 8
  13330. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  13331. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  13332. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  13333. #define HTT_RX_DELBA_EXTN_TID_S 16
  13334. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  13335. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  13336. /*--- Dword 0 ---*/
  13337. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  13338. do { \
  13339. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  13340. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  13341. } while (0)
  13342. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  13343. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  13344. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  13345. do { \
  13346. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  13347. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  13348. } while (0)
  13349. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  13350. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  13351. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  13352. do { \
  13353. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  13354. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  13355. } while (0)
  13356. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  13357. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  13358. /*--- Dword 1 ---*/
  13359. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  13360. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  13361. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  13362. do { \
  13363. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  13364. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  13365. } while (0)
  13366. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  13367. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  13368. #define HTT_RX_DELBA_EXTN_BYTES 8
  13369. /**
  13370. * @brief tx queue group information element definition
  13371. *
  13372. * @details
  13373. * The following diagram shows the format of the tx queue group
  13374. * information element, which can be included in target --> host
  13375. * messages to specify the number of tx "credits" (tx descriptors
  13376. * for LL, or tx buffers for HL) available to a particular group
  13377. * of host-side tx queues, and which host-side tx queues belong to
  13378. * the group.
  13379. *
  13380. * |31|30 24|23 16|15|14|13 0|
  13381. * |------------------------------------------------------------------------|
  13382. * | X| reserved | tx queue grp ID | A| S| credit count |
  13383. * |------------------------------------------------------------------------|
  13384. * | vdev ID mask | AC mask |
  13385. * |------------------------------------------------------------------------|
  13386. *
  13387. * The following definitions describe the fields within the tx queue group
  13388. * information element:
  13389. * - credit_count
  13390. * Bits 13:1
  13391. * Purpose: specify how many tx credits are available to the tx queue group
  13392. * Value: An absolute or relative, positive or negative credit value
  13393. * The 'A' bit specifies whether the value is absolute or relative.
  13394. * The 'S' bit specifies whether the value is positive or negative.
  13395. * A negative value can only be relative, not absolute.
  13396. * An absolute value replaces any prior credit value the host has for
  13397. * the tx queue group in question.
  13398. * A relative value is added to the prior credit value the host has for
  13399. * the tx queue group in question.
  13400. * - sign
  13401. * Bit 14
  13402. * Purpose: specify whether the credit count is positive or negative
  13403. * Value: 0 -> positive, 1 -> negative
  13404. * - absolute
  13405. * Bit 15
  13406. * Purpose: specify whether the credit count is absolute or relative
  13407. * Value: 0 -> relative, 1 -> absolute
  13408. * - txq_group_id
  13409. * Bits 23:16
  13410. * Purpose: indicate which tx queue group's credit and/or membership are
  13411. * being specified
  13412. * Value: 0 to max_tx_queue_groups-1
  13413. * - reserved
  13414. * Bits 30:16
  13415. * Value: 0x0
  13416. * - eXtension
  13417. * Bit 31
  13418. * Purpose: specify whether another tx queue group info element follows
  13419. * Value: 0 -> no more tx queue group information elements
  13420. * 1 -> another tx queue group information element immediately follows
  13421. * - ac_mask
  13422. * Bits 15:0
  13423. * Purpose: specify which Access Categories belong to the tx queue group
  13424. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  13425. * the tx queue group.
  13426. * The AC bit-mask values are obtained by left-shifting by the
  13427. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  13428. * - vdev_id_mask
  13429. * Bits 31:16
  13430. * Purpose: specify which vdev's tx queues belong to the tx queue group
  13431. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  13432. * belong to the tx queue group.
  13433. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  13434. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  13435. */
  13436. PREPACK struct htt_txq_group {
  13437. A_UINT32
  13438. credit_count: 14,
  13439. sign: 1,
  13440. absolute: 1,
  13441. tx_queue_group_id: 8,
  13442. reserved0: 7,
  13443. extension: 1;
  13444. A_UINT32
  13445. ac_mask: 16,
  13446. vdev_id_mask: 16;
  13447. } POSTPACK;
  13448. /* first word */
  13449. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  13450. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  13451. #define HTT_TXQ_GROUP_SIGN_S 14
  13452. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  13453. #define HTT_TXQ_GROUP_ABS_S 15
  13454. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  13455. #define HTT_TXQ_GROUP_ID_S 16
  13456. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  13457. #define HTT_TXQ_GROUP_EXT_S 31
  13458. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  13459. /* second word */
  13460. #define HTT_TXQ_GROUP_AC_MASK_S 0
  13461. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  13462. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  13463. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  13464. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  13465. do { \
  13466. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  13467. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  13468. } while (0)
  13469. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  13470. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  13471. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  13472. do { \
  13473. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  13474. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  13475. } while (0)
  13476. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  13477. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  13478. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  13479. do { \
  13480. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  13481. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  13482. } while (0)
  13483. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  13484. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  13485. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  13486. do { \
  13487. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  13488. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  13489. } while (0)
  13490. #define HTT_TXQ_GROUP_ID_GET(_info) \
  13491. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  13492. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  13493. do { \
  13494. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  13495. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  13496. } while (0)
  13497. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  13498. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  13499. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  13500. do { \
  13501. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  13502. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  13503. } while (0)
  13504. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  13505. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  13506. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  13507. do { \
  13508. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13509. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13510. } while (0)
  13511. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13512. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13513. /**
  13514. * @brief target -> host TX completion indication message definition
  13515. *
  13516. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13517. *
  13518. * @details
  13519. * The following diagram shows the format of the TX completion indication sent
  13520. * from the target to the host
  13521. *
  13522. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13523. * |-------------------------------------------------------------------|
  13524. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13525. * |-------------------------------------------------------------------|
  13526. * payload:| MSDU1 ID | MSDU0 ID |
  13527. * |-------------------------------------------------------------------|
  13528. * : MSDU3 ID | MSDU2 ID :
  13529. * |-------------------------------------------------------------------|
  13530. * | struct htt_tx_compl_ind_append_retries |
  13531. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13532. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13533. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13534. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13535. * |-------------------------------------------------------------------|
  13536. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13537. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13538. * | MSDU0 tx_tsf64_low |
  13539. * |-------------------------------------------------------------------|
  13540. * | MSDU0 tx_tsf64_high |
  13541. * |-------------------------------------------------------------------|
  13542. * | MSDU1 tx_tsf64_low |
  13543. * |-------------------------------------------------------------------|
  13544. * | MSDU1 tx_tsf64_high |
  13545. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13546. * | phy_timestamp |
  13547. * |-------------------------------------------------------------------|
  13548. * | rate specs (see below) |
  13549. * |-------------------------------------------------------------------|
  13550. * | seqctrl | framectrl |
  13551. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13552. * Where:
  13553. * A0 = append (a.k.a. append0)
  13554. * A1 = append1
  13555. * TP = MSDU tx power presence
  13556. * A2 = append2
  13557. * A3 = append3
  13558. * A4 = append4
  13559. *
  13560. * The following field definitions describe the format of the TX completion
  13561. * indication sent from the target to the host
  13562. * Header fields:
  13563. * - msg_type
  13564. * Bits 7:0
  13565. * Purpose: identifies this as HTT TX completion indication
  13566. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13567. * - status
  13568. * Bits 10:8
  13569. * Purpose: the TX completion status of payload fragmentations descriptors
  13570. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13571. * - tid
  13572. * Bits 14:11
  13573. * Purpose: the tid associated with those fragmentation descriptors. It is
  13574. * valid or not, depending on the tid_invalid bit.
  13575. * Value: 0 to 15
  13576. * - tid_invalid
  13577. * Bits 15:15
  13578. * Purpose: this bit indicates whether the tid field is valid or not
  13579. * Value: 0 indicates valid; 1 indicates invalid
  13580. * - num
  13581. * Bits 23:16
  13582. * Purpose: the number of payload in this indication
  13583. * Value: 1 to 255
  13584. * - append (a.k.a. append0)
  13585. * Bits 24:24
  13586. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13587. * the number of tx retries for one MSDU at the end of this message
  13588. * Value: 0 indicates no appending; 1 indicates appending
  13589. * - append1
  13590. * Bits 25:25
  13591. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13592. * contains the timestamp info for each TX msdu id in payload.
  13593. * The order of the timestamps matches the order of the MSDU IDs.
  13594. * Note that a big-endian host needs to account for the reordering
  13595. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13596. * conversion) when determining which tx timestamp corresponds to
  13597. * which MSDU ID.
  13598. * Value: 0 indicates no appending; 1 indicates appending
  13599. * - msdu_tx_power_presence
  13600. * Bits 26:26
  13601. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13602. * for each MSDU referenced by the TX_COMPL_IND message.
  13603. * The tx power is reported in 0.5 dBm units.
  13604. * The order of the per-MSDU tx power reports matches the order
  13605. * of the MSDU IDs.
  13606. * Note that a big-endian host needs to account for the reordering
  13607. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13608. * conversion) when determining which Tx Power corresponds to
  13609. * which MSDU ID.
  13610. * Value: 0 indicates MSDU tx power reports are not appended,
  13611. * 1 indicates MSDU tx power reports are appended
  13612. * - append2
  13613. * Bits 27:27
  13614. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13615. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13616. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13617. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13618. * for each MSDU, for convenience.
  13619. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13620. * this append2 bit is set).
  13621. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13622. * dB above the noise floor.
  13623. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13624. * 1 indicates MSDU ACK RSSI values are appended.
  13625. * - append3
  13626. * Bits 28:28
  13627. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13628. * contains the tx tsf info based on wlan global TSF for
  13629. * each TX msdu id in payload.
  13630. * The order of the tx tsf matches the order of the MSDU IDs.
  13631. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13632. * values to indicate the the lower 32 bits and higher 32 bits of
  13633. * the tx tsf.
  13634. * The tx_tsf64 here represents the time MSDU was acked and the
  13635. * tx_tsf64 has microseconds units.
  13636. * Value: 0 indicates no appending; 1 indicates appending
  13637. * - append4
  13638. * Bits 29:29
  13639. * Purpose: Indicate whether data frame control fields and fields required
  13640. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13641. * message. The order of the this message matches the order of
  13642. * the MSDU IDs.
  13643. * Value: 0 indicates frame control fields and fields required for
  13644. * radio tap header values are not appended,
  13645. * 1 indicates frame control fields and fields required for
  13646. * radio tap header values are appended.
  13647. * Payload fields:
  13648. * - hmsdu_id
  13649. * Bits 15:0
  13650. * Purpose: this ID is used to track the Tx buffer in host
  13651. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13652. */
  13653. PREPACK struct htt_tx_data_hdr_information {
  13654. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13655. A_UINT32 /* word 1 */
  13656. /* preamble:
  13657. * 0-OFDM,
  13658. * 1-CCk,
  13659. * 2-HT,
  13660. * 3-VHT
  13661. */
  13662. preamble: 2, /* [1:0] */
  13663. /* mcs:
  13664. * In case of HT preamble interpret
  13665. * MCS along with NSS.
  13666. * Valid values for HT are 0 to 7.
  13667. * HT mcs 0 with NSS 2 is mcs 8.
  13668. * Valid values for VHT are 0 to 9.
  13669. */
  13670. mcs: 4, /* [5:2] */
  13671. /* rate:
  13672. * This is applicable only for
  13673. * CCK and OFDM preamble type
  13674. * rate 0: OFDM 48 Mbps,
  13675. * 1: OFDM 24 Mbps,
  13676. * 2: OFDM 12 Mbps
  13677. * 3: OFDM 6 Mbps
  13678. * 4: OFDM 54 Mbps
  13679. * 5: OFDM 36 Mbps
  13680. * 6: OFDM 18 Mbps
  13681. * 7: OFDM 9 Mbps
  13682. * rate 0: CCK 11 Mbps Long
  13683. * 1: CCK 5.5 Mbps Long
  13684. * 2: CCK 2 Mbps Long
  13685. * 3: CCK 1 Mbps Long
  13686. * 4: CCK 11 Mbps Short
  13687. * 5: CCK 5.5 Mbps Short
  13688. * 6: CCK 2 Mbps Short
  13689. */
  13690. rate : 3, /* [ 8: 6] */
  13691. rssi : 8, /* [16: 9] units=dBm */
  13692. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13693. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13694. stbc : 1, /* [22] */
  13695. sgi : 1, /* [23] */
  13696. ldpc : 1, /* [24] */
  13697. beamformed: 1, /* [25] */
  13698. /* tx_retry_cnt:
  13699. * Indicates retry count of data tx frames provided by the host.
  13700. */
  13701. tx_retry_cnt: 6; /* [31:26] */
  13702. A_UINT32 /* word 2 */
  13703. framectrl:16, /* [15: 0] */
  13704. seqno:16; /* [31:16] */
  13705. } POSTPACK;
  13706. #define HTT_TX_COMPL_IND_STATUS_S 8
  13707. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13708. #define HTT_TX_COMPL_IND_TID_S 11
  13709. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13710. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13711. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13712. #define HTT_TX_COMPL_IND_NUM_S 16
  13713. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13714. #define HTT_TX_COMPL_IND_APPEND_S 24
  13715. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13716. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13717. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13718. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13719. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13720. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13721. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13722. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13723. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13724. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13725. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13726. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13727. do { \
  13728. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13729. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13730. } while (0)
  13731. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13732. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13733. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13734. do { \
  13735. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13736. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13737. } while (0)
  13738. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13739. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13740. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13741. do { \
  13742. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13743. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13744. } while (0)
  13745. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13746. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13747. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13748. do { \
  13749. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13750. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13751. } while (0)
  13752. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13753. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13754. HTT_TX_COMPL_IND_TID_INV_S)
  13755. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13756. do { \
  13757. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13758. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13759. } while (0)
  13760. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13761. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13762. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13763. do { \
  13764. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13765. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13766. } while (0)
  13767. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13768. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13769. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13770. do { \
  13771. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13772. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13773. } while (0)
  13774. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13775. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13776. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13777. do { \
  13778. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13779. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13780. } while (0)
  13781. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13782. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13783. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13784. do { \
  13785. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13786. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13787. } while (0)
  13788. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13789. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13790. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13791. do { \
  13792. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13793. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13794. } while (0)
  13795. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13796. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13797. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13798. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13799. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13800. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13801. #define HTT_TX_COMPL_IND_STAT_OK 0
  13802. /* DISCARD:
  13803. * current meaning:
  13804. * MSDUs were queued for transmission but filtered by HW or SW
  13805. * without any over the air attempts
  13806. * legacy meaning (HL Rome):
  13807. * MSDUs were discarded by the target FW without any over the air
  13808. * attempts due to lack of space
  13809. */
  13810. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13811. /* NO_ACK:
  13812. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13813. */
  13814. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13815. /* POSTPONE:
  13816. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13817. * be downloaded again later (in the appropriate order), when they are
  13818. * deliverable.
  13819. */
  13820. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13821. /*
  13822. * The PEER_DEL tx completion status is used for HL cases
  13823. * where the peer the frame is for has been deleted.
  13824. * The host has already discarded its copy of the frame, but
  13825. * it still needs the tx completion to restore its credit.
  13826. */
  13827. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13828. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13829. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13830. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13831. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13832. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13833. PREPACK struct htt_tx_compl_ind_base {
  13834. A_UINT32 hdr;
  13835. A_UINT16 payload[1/*or more*/];
  13836. } POSTPACK;
  13837. PREPACK struct htt_tx_compl_ind_append_retries {
  13838. A_UINT16 msdu_id;
  13839. A_UINT8 tx_retries;
  13840. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13841. 0: this is the last append_retries struct */
  13842. } POSTPACK;
  13843. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13844. A_UINT32 timestamp[1/*or more*/];
  13845. } POSTPACK;
  13846. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13847. A_UINT32 tx_tsf64_low;
  13848. A_UINT32 tx_tsf64_high;
  13849. } POSTPACK;
  13850. /* htt_tx_data_hdr_information payload extension fields: */
  13851. /* DWORD zero */
  13852. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13853. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13854. /* DWORD one */
  13855. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13856. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13857. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13858. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13859. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13860. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13861. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13862. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13863. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13864. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13865. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13866. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13867. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13868. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13869. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13870. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13871. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13872. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13873. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13874. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13875. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13876. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13877. /* DWORD two */
  13878. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13879. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13880. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13881. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13882. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13883. do { \
  13884. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13885. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13886. } while (0)
  13887. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13888. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13889. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13890. do { \
  13891. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13892. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13893. } while (0)
  13894. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13895. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13896. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13897. do { \
  13898. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13899. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13900. } while (0)
  13901. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13902. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13903. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13904. do { \
  13905. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13906. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13907. } while (0)
  13908. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13909. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13910. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13911. do { \
  13912. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13913. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13914. } while (0)
  13915. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13916. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13917. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13918. do { \
  13919. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13920. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13921. } while (0)
  13922. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13923. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13924. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13925. do { \
  13926. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13927. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13928. } while (0)
  13929. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13930. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13931. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13932. do { \
  13933. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13934. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13935. } while (0)
  13936. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13937. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13938. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13939. do { \
  13940. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13941. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13942. } while (0)
  13943. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13944. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13945. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13946. do { \
  13947. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13948. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13949. } while (0)
  13950. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13951. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13952. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13953. do { \
  13954. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13955. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13956. } while (0)
  13957. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13958. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13959. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13960. do { \
  13961. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13962. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13963. } while (0)
  13964. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13965. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13966. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13967. do { \
  13968. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13969. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13970. } while (0)
  13971. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13972. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13973. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13974. do { \
  13975. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13976. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13977. } while (0)
  13978. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13979. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13980. /**
  13981. * @brief target -> host software UMAC TX completion indication message
  13982. *
  13983. * MSG_TYPE => HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND
  13984. *
  13985. * @details
  13986. * The following diagram shows the format of the soft UMAC TX completion
  13987. * indication sent from the target to the host
  13988. *
  13989. * |31 30|29|28|27|26 20|19 17|16|15 12|11|10| 9|8|7 4|3 1|0|
  13990. * |-------------------------------------+----------------+------------|
  13991. * hdr: | rsvd | msdu_cnt | msg_type |
  13992. * pyld: |===================================================================|
  13993. * MSDU 0| buf addr low (bits 31:0) |
  13994. * |-----------------------------------------------+------+------------|
  13995. * | SW buffer cookie | RS | buf addr hi|
  13996. * |--------+--+--+-------------+--------+---------+------+------------|
  13997. * | rsvd0 | M| V| tx count | TID | SW peer ID |
  13998. * |--------+--+--+-------------+--------+----------------------+------|
  13999. * | frametype | TQM status number | RELR |
  14000. * |-----+-----+-----------------------------------+--+-+-+-----+------|
  14001. * |rsvd1| buffer timestamp | A|L|F| ACK RSSI |
  14002. * |-----+--+-------------------------+--+------+-----+--+-+-----+---+-|
  14003. * | rsvd2 | tones in RU |OF|tx MCS|txSGI|LC|S|PKTYP|BW |I|
  14004. * |--------+-------------------------+--+------+-----+--+-+-----+---+-|
  14005. * | PPDU transmission TSF |
  14006. * |-------------------------------------------------------------------|
  14007. * | rsvd3 |
  14008. * |===================================================================|
  14009. * MSDU 1| buf addr low (bits 31:0) |
  14010. * : ... :
  14011. * | rsvd3 |
  14012. * |===================================================================|
  14013. * etc.
  14014. *
  14015. * Where:
  14016. * RS = release source
  14017. * V = valid
  14018. * M = multicast
  14019. * RELR = release reason
  14020. * F = first MSDU
  14021. * L = last MSDU
  14022. * A = MSDU is part of A-MSDU
  14023. * I = rate info valid
  14024. * PKTYP = packet type
  14025. * S = STBC
  14026. * LC = LDPC
  14027. * OF = OFDMA transmission
  14028. */
  14029. typedef enum {
  14030. /* 0 (REASON_FRAME_ACKED):
  14031. * Corresponds to tqm_release_reason = <enum 0 tqm_rr_frame_acked>;
  14032. * frame is removed because an ACK of BA for it was received.
  14033. */
  14034. HTT_TX_MSDU_RELEASE_REASON_FRAME_ACKED,
  14035. /* 1 (REASON_REMOVE_CMD_FW):
  14036. * Corresponds to tqm_release_reason = <enum 1 tqm_rr_rem_cmd_rem>;
  14037. * frame is removed because a remove command of type "Remove_mpdus"
  14038. * initiated by SW.
  14039. */
  14040. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_FW,
  14041. /* 2 (REASON_REMOVE_CMD_TX):
  14042. * Corresponds to tqm_release_reason = <enum 2 tqm_rr_rem_cmd_tx>;
  14043. * frame is removed because a remove command of type
  14044. * "Remove_transmitted_mpdus" initiated by SW.
  14045. */
  14046. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_TX,
  14047. /* 3 (REASON_REMOVE_CMD_NOTX):
  14048. * Corresponds to tqm_release_reason = <enum 3 tqm_rr_rem_cmd_notx>;
  14049. * frame is removed because a remove command of type
  14050. * "Remove_untransmitted_mpdus" initiated by SW.
  14051. */
  14052. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_NOTX,
  14053. /* 4 (REASON_REMOVE_CMD_AGED):
  14054. * Corresponds to tqm_release_reason = <enum 4 tqm_rr_rem_cmd_aged>;
  14055. * frame is removed because a remove command of type "Remove_aged_mpdus"
  14056. * or "Remove_aged_msdus" initiated by SW.
  14057. */
  14058. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_AGED,
  14059. /* 5 (RELEASE_FW_REASON1):
  14060. * Corresponds to tqm_release_reason = <enum 5 tqm_fw_reason1>;
  14061. * frame is removed because a remove command where fw indicated that
  14062. * remove reason is fw_reason1.
  14063. */
  14064. HTT_TX_MSDU_RELEASE_FW_REASON1,
  14065. /* 6 (RELEASE_FW_REASON2):
  14066. * Corresponds to tqm_release_reason = <enum 6 tqm_fw_reason2>;
  14067. * frame is removed because a remove command where fw indicated that
  14068. * remove reason is fw_reason1.
  14069. */
  14070. HTT_TX_MSDU_RELEASE_FW_REASON2,
  14071. /* 7 (RELEASE_FW_REASON3):
  14072. * Corresponds to tqm_release_reason = <enum 7 tqm_fw_reason3>;
  14073. * frame is removed because a remove command where fw indicated that
  14074. * remove reason is fw_reason1.
  14075. */
  14076. HTT_TX_MSDU_RELEASE_FW_REASON3,
  14077. /* 8 (REASON_REMOVE_CMD_DISABLEQ):
  14078. * Corresponds to tqm_release_reason = <enum 8 tqm_rr_rem_cmd_disable_queue>
  14079. * frame is removed because a remove command of type
  14080. * "remove_mpdus_and_disable_queue" or "remove_msdus_and_disable_flow"
  14081. * initiated by SW.
  14082. */
  14083. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_DISABLEQ,
  14084. /* 9 (REASON_DROP_MISC):
  14085. * Corresponds to sw_release_reason = Packet dropped by FW due to
  14086. * any discard reason that is not categorized as MSDU TTL expired.
  14087. * Examples: TXDE ENQ layer dropped the packet due to peer delete,
  14088. * tid delete, no resource credit available.
  14089. */
  14090. HTT_TX_MSDU_RELEASE_REASON_DROP_MISC,
  14091. /* 10 (REASON_DROP_TTL):
  14092. * Corresponds to sw_release_reason = Packet dropped by FW due to
  14093. * discard reason that frame is not transmitted due to MSDU TTL expired.
  14094. */
  14095. HTT_TX_MSDU_RELEASE_REASON_DROP_TTL,
  14096. /* 11 - available for use */
  14097. /* 12 - available for use */
  14098. /* 13 - available for use */
  14099. /* 14 - available for use */
  14100. /* 15 - available for use */
  14101. HTT_TX_MSDU_RELEASE_REASON_MAX = 16
  14102. } htt_t2h_tx_msdu_release_reason_e;
  14103. typedef enum {
  14104. /* 0 (RELEASE_SOURCE_FW):
  14105. * MSDU released by FW even before the frame was queued to TQM-L HW.
  14106. */
  14107. HTT_TX_MSDU_RELEASE_SOURCE_FW,
  14108. /* 1 (RELEASE_SOURCE_TQM_LITE):
  14109. * MSDU released by TQM-L HW.
  14110. */
  14111. HTT_TX_MSDU_RELEASE_SOURCE_TQM_LITE,
  14112. HTT_TX_MSDU_RELEASE_SOURCE_MAX = 8
  14113. } htt_t2h_tx_msdu_release_source_e;
  14114. struct htt_t2h_tx_buffer_addr_info { /* 2 words */
  14115. A_UINT32 buffer_addr_31_0 : 32; /* [31:0] */
  14116. A_UINT32 buffer_addr_39_32 : 8, /* [7:0] */
  14117. /* release_source:
  14118. * holds a htt_t2h_tx_msdu_release_source_e enum value
  14119. */
  14120. release_source : 3, /* [10:8] */
  14121. sw_buffer_cookie : 21; /* [31:11] */
  14122. /* NOTE:
  14123. * To preserve backwards compatibility,
  14124. * no new fields can be added in this struct.
  14125. */
  14126. };
  14127. /* member definitions of htt_t2h_tx_buffer_addr_info */
  14128. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M 0xFFFFFFFF
  14129. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S 0
  14130. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_SET(word, value) \
  14131. do { \
  14132. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0, value); \
  14133. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S; \
  14134. } while (0)
  14135. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_GET(word) \
  14136. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S)
  14137. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M 0x000000FF
  14138. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S 0
  14139. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_SET(word, value) \
  14140. do { \
  14141. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32, value); \
  14142. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S; \
  14143. } while (0)
  14144. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_GET(word) \
  14145. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S)
  14146. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M 0x00000700
  14147. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S 8
  14148. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_SET(word, value) \
  14149. do { \
  14150. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE, value); \
  14151. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S; \
  14152. } while (0)
  14153. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_GET(word) \
  14154. (((word) & HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M) >> HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S)
  14155. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M 0xFFFFF800
  14156. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S 11
  14157. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  14158. do { \
  14159. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE, value); \
  14160. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S; \
  14161. } while (0)
  14162. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_GET(word) \
  14163. (((word) & HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M) >> HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S)
  14164. struct htt_t2h_tx_rate_stats_info { /* 2 words */
  14165. /* word 0 */
  14166. A_UINT32
  14167. /* tx_rate_stats_info_valid:
  14168. * Indicates if the tx rate stats below are valid.
  14169. */
  14170. tx_rate_stats_info_valid : 1, /* [0] */
  14171. /* transmit_bw:
  14172. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14173. * Indicates the BW of the upcoming transmission that shall likely
  14174. * start in about 3 -4 us on the medium:
  14175. * <enum 0 transmit_bw_20_MHz>
  14176. * <enum 1 transmit_bw_40_MHz>
  14177. * <enum 2 transmit_bw_80_MHz>
  14178. * <enum 3 transmit_bw_160_MHz>
  14179. * <enum 4 transmit_bw_320_MHz>
  14180. */
  14181. transmit_bw : 3, /* [3:1] */
  14182. /* transmit_pkt_type:
  14183. * same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14184. * Field filled in by PDG.
  14185. * Not valid when in SW transmit mode
  14186. * The packet type
  14187. * <enum_type PKT_TYPE_ENUM>
  14188. * Type: enum Definition Name: PKT_TYPE_ENUM
  14189. * enum number enum name Description
  14190. * ------------------------------------
  14191. * 0 dot11a 802.11a PPDU type
  14192. * 1 dot11b 802.11b PPDU type
  14193. * 2 dot11n_mm 802.11n Mixed Mode PPDU type
  14194. * 3 dot11ac 802.11ac PPDU type
  14195. * 4 dot11ax 802.11ax PPDU type
  14196. * 5 dot11ba 802.11ba (WUR) PPDU type
  14197. * 6 dot11be 802.11be PPDU type
  14198. * 7 dot11az 802.11az (ranging) PPDU type
  14199. */
  14200. transmit_pkt_type : 4, /* [7:4] */
  14201. /* transmit_stbc:
  14202. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14203. * Field filled in by PDG.
  14204. * Not valid when in SW transmit mode
  14205. * When set, STBC transmission rate was used.
  14206. */
  14207. transmit_stbc : 1, /* [8] */
  14208. /* transmit_ldpc:
  14209. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14210. * Field filled in by PDG.
  14211. * Not valid when in SW transmit mode
  14212. * When set, use LDPC transmission rates
  14213. */
  14214. transmit_ldpc : 1, /* [9] */
  14215. /* transmit_sgi:
  14216. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14217. * Field filled in by PDG.
  14218. * Not valid when in SW transmit mode
  14219. * <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used for HE
  14220. * <enum 1 0_4_us_sgi > Legacy short GI. Can also be used for HE
  14221. * <enum 2 1_6_us_sgi > HE related GI
  14222. * <enum 3 3_2_us_sgi > HE related GI
  14223. * <legal 0 - 3>
  14224. */
  14225. transmit_sgi : 2, /* [11:10] */
  14226. /* transmit_mcs:
  14227. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14228. * Field filled in by PDG.
  14229. * Not valid when in SW transmit mode
  14230. *
  14231. * For details, refer to MCS_TYPE description
  14232. * <legal all>
  14233. * Pkt_type Related definition of MCS_TYPE
  14234. * dot11b This field is the rate:
  14235. * 0: CCK 11 Mbps Long
  14236. * 1: CCK 5.5 Mbps Long
  14237. * 2: CCK 2 Mbps Long
  14238. * 3: CCK 1 Mbps Long
  14239. * 4: CCK 11 Mbps Short
  14240. * 5: CCK 5.5 Mbps Short
  14241. * 6: CCK 2 Mbps Short
  14242. * NOTE: The numbering here is NOT the same as the as MAC gives
  14243. * in the "rate" field in the SIG given to the PHY.
  14244. * The MAC will do an internal translation.
  14245. *
  14246. * Dot11a This field is the rate:
  14247. * 0: OFDM 48 Mbps
  14248. * 1: OFDM 24 Mbps
  14249. * 2: OFDM 12 Mbps
  14250. * 3: OFDM 6 Mbps
  14251. * 4: OFDM 54 Mbps
  14252. * 5: OFDM 36 Mbps
  14253. * 6: OFDM 18 Mbps
  14254. * 7: OFDM 9 Mbps
  14255. * NOTE: The numbering here is NOT the same as the as MAC gives
  14256. * in the "rate" field in the SIG given to the PHY.
  14257. * The MAC will do an internal translation.
  14258. *
  14259. * Dot11n_mm (mixed mode) This field represends the MCS.
  14260. * 0: HT MCS 0 (BPSK 1/2)
  14261. * 1: HT MCS 1 (QPSK 1/2)
  14262. * 2: HT MCS 2 (QPSK 3/4)
  14263. * 3: HT MCS 3 (16-QAM 1/2)
  14264. * 4: HT MCS 4 (16-QAM 3/4)
  14265. * 5: HT MCS 5 (64-QAM 2/3)
  14266. * 6: HT MCS 6 (64-QAM 3/4)
  14267. * 7: HT MCS 7 (64-QAM 5/6)
  14268. * NOTE: To get higher MCS's use the nss field to indicate the
  14269. * number of spatial streams.
  14270. *
  14271. * Dot11ac This field represends the MCS.
  14272. * 0: VHT MCS 0 (BPSK 1/2)
  14273. * 1: VHT MCS 1 (QPSK 1/2)
  14274. * 2: VHT MCS 2 (QPSK 3/4)
  14275. * 3: VHT MCS 3 (16-QAM 1/2)
  14276. * 4: VHT MCS 4 (16-QAM 3/4)
  14277. * 5: VHT MCS 5 (64-QAM 2/3)
  14278. * 6: VHT MCS 6 (64-QAM 3/4)
  14279. * 7: VHT MCS 7 (64-QAM 5/6)
  14280. * 8: VHT MCS 8 (256-QAM 3/4)
  14281. * 9: VHT MCS 9 (256-QAM 5/6)
  14282. * 10: VHT MCS 10 (1024-QAM 3/4)
  14283. * 11: VHT MCS 11 (1024-QAM 5/6)
  14284. * NOTE: There are several illegal VHT rates due to fractional
  14285. * number of bits per symbol.
  14286. * Below are the illegal rates for 4 streams and lower:
  14287. * 20 MHz, 1 stream, MCS 9
  14288. * 20 MHz, 2 stream, MCS 9
  14289. * 20 MHz, 4 stream, MCS 9
  14290. * 80 MHz, 3 stream, MCS 6
  14291. * 160 MHz, 3 stream, MCS 9 (Unsupported)
  14292. * 160 MHz, 4 stream, MCS 7 (Unsupported)
  14293. *
  14294. * dot11ax This field represends the MCS.
  14295. * 0: HE MCS 0 (BPSK 1/2)
  14296. * 1: HE MCS 1 (QPSK 1/2)
  14297. * 2: HE MCS 2 (QPSK 3/4)
  14298. * 3: HE MCS 3 (16-QAM 1/2)
  14299. * 4: HE MCS 4 (16-QAM 3/4)
  14300. * 5: HE MCS 5 (64-QAM 2/3)
  14301. * 6: HE MCS 6 (64-QAM 3/4)
  14302. * 7: HE MCS 7 (64-QAM 5/6)
  14303. * 8: HE MCS 8 (256-QAM 3/4)
  14304. * 9: HE MCS 9 (256-QAM 5/6)
  14305. * 10: HE MCS 10 (1024-QAM 3/4)
  14306. * 11: HE MCS 11 (1024-QAM 5/6)
  14307. * 12: HE MCS 12 (4096-QAM 3/4)
  14308. * 13: HE MCS 13 (4096-QAM 5/6)
  14309. *
  14310. * dot11ba This field is the rate:
  14311. * 0: LDR
  14312. * 1: HDR
  14313. * 2: Exclusive rate
  14314. */
  14315. transmit_mcs : 4, /* [15:12] */
  14316. /* ofdma_transmission:
  14317. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14318. * Field filled in by PDG.
  14319. * Set when the transmission was an OFDMA transmission (DL or UL).
  14320. * <legal all>
  14321. */
  14322. ofdma_transmission : 1, /* [16] */
  14323. /* tones_in_ru:
  14324. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14325. * Field filled in by PDG.
  14326. * Not valid when in SW transmit mode
  14327. * The number of tones in the RU used.
  14328. * <legal all>
  14329. */
  14330. tones_in_ru : 12, /* [28:17] */
  14331. rsvd2 : 3; /* [31:29] */
  14332. /* word 1 */
  14333. /* ppdu_transmission_tsf:
  14334. * Based on a HWSCH configuration register setting,
  14335. * this field either contains:
  14336. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14337. * of the PPDU containing the frame finished.
  14338. * OR
  14339. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14340. * of the PPDU containing the frame started.
  14341. * <legal all>
  14342. */
  14343. A_UINT32 ppdu_transmission_tsf;
  14344. /* NOTE:
  14345. * To preserve backwards compatibility,
  14346. * no new fields can be added in this struct.
  14347. */
  14348. };
  14349. /* member definitions of htt_t2h_tx_rate_stats_info */
  14350. #define HTT_TX_RATE_STATS_INFO_VALID_M 0x00000001
  14351. #define HTT_TX_RATE_STATS_INFO_VALID_S 0
  14352. #define HTT_TX_RATE_STATS_INFO_VALID_SET(word, value) \
  14353. do { \
  14354. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_VALID, value); \
  14355. (word) |= (value) << HTT_TX_RATE_STATS_INFO_VALID_S; \
  14356. } while (0)
  14357. #define HTT_TX_RATE_STATS_INFO_VALID_GET(word) \
  14358. (((word) & HTT_TX_RATE_STATS_INFO_VALID_M) >> HTT_TX_RATE_STATS_INFO_VALID_S)
  14359. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M 0x0000000E
  14360. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S 1
  14361. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_SET(word, value) \
  14362. do { \
  14363. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_BW, value); \
  14364. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S; \
  14365. } while (0)
  14366. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_GET(word) \
  14367. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S)
  14368. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M 0x000000F0
  14369. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S 4
  14370. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_SET(word, value) \
  14371. do { \
  14372. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE, value); \
  14373. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S; \
  14374. } while (0)
  14375. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_GET(word) \
  14376. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S)
  14377. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M 0x00000100
  14378. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S 8
  14379. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_SET(word, value) \
  14380. do { \
  14381. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC, value); \
  14382. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S; \
  14383. } while (0)
  14384. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_GET(word) \
  14385. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S)
  14386. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M 0x00000200
  14387. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S 9
  14388. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_SET(word, value) \
  14389. do { \
  14390. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC, value); \
  14391. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S; \
  14392. } while (0)
  14393. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_GET(word) \
  14394. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S)
  14395. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M 0x00000C00
  14396. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S 10
  14397. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_SET(word, value) \
  14398. do { \
  14399. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI, value); \
  14400. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S; \
  14401. } while (0)
  14402. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_GET(word) \
  14403. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S)
  14404. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M 0x0000F000
  14405. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S 12
  14406. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_SET(word, value) \
  14407. do { \
  14408. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS, value); \
  14409. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S; \
  14410. } while (0)
  14411. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_GET(word) \
  14412. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S)
  14413. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M 0x00010000
  14414. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S 16
  14415. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_SET(word, value) \
  14416. do { \
  14417. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION, value); \
  14418. (word) |= (value) << HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S; \
  14419. } while (0)
  14420. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_GET(word) \
  14421. (((word) & HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M) >> HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S)
  14422. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M 0x1FFE0000
  14423. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S 17
  14424. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_SET(word, value) \
  14425. do { \
  14426. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TONES_IN_RU, value); \
  14427. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S; \
  14428. } while (0)
  14429. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_GET(word) \
  14430. (((word) & HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M) >> HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S)
  14431. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M 0xFFFFFFFF
  14432. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S 0
  14433. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_SET(word, value) \
  14434. do { \
  14435. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF, value); \
  14436. (word) |= (value) << HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S; \
  14437. } while (0)
  14438. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_GET(word) \
  14439. (((word) & HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M) >> HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S)
  14440. struct htt_t2h_tx_msdu_info { /* 8 words */
  14441. /* words 0 + 1 */
  14442. struct htt_t2h_tx_buffer_addr_info addr_info;
  14443. /* word 2 */
  14444. A_UINT32
  14445. sw_peer_id : 16,
  14446. tid : 4,
  14447. transmit_cnt : 7,
  14448. valid : 1,
  14449. mcast : 1,
  14450. rsvd0 : 3;
  14451. /* word 3 */
  14452. A_UINT32
  14453. release_reason : 4, /* Refer to htt_t2h_tx_msdu_release_reason_e */
  14454. tqm_status_number : 24,
  14455. frame_type : 4; /* holds htt_tx_wbm_status_frame_type value */
  14456. /* word 4 */
  14457. A_UINT32
  14458. /* ack_frame_rssi:
  14459. * If this frame is removed as the result of the
  14460. * reception of an ACK or BA, this field indicates
  14461. * the RSSI of the received ACK or BA frame.
  14462. * When the frame is removed as result of a direct
  14463. * remove command from the SW, this field is set
  14464. * to 0x0 (which is never a valid value when real
  14465. * RSSI is available).
  14466. * Units: dB w.r.t noise floor
  14467. */
  14468. ack_frame_rssi : 8,
  14469. first_msdu : 1,
  14470. last_msdu : 1,
  14471. msdu_part_of_amsdu : 1,
  14472. buffer_timestamp : 19, /* units = TU = 1024 microseconds */
  14473. rsvd1 : 2;
  14474. /* words 5 + 6 */
  14475. struct htt_t2h_tx_rate_stats_info tx_rate_stats;
  14476. /* word 7 */
  14477. /* rsvd3:
  14478. * backup reserved field to add new parameters if [rsvd0, rsvd1, rsvd2]
  14479. * is not sufficient
  14480. */
  14481. A_UINT32 rsvd3;
  14482. /* NOTE:
  14483. * To preserve backwards compatibility,
  14484. * no new fields can be added in this struct.
  14485. */
  14486. };
  14487. /* member definitions of htt_t2h_tx_msdu_info */
  14488. #define HTT_TX_MSDU_INFO_SW_PEER_ID_M 0x0000FFFF
  14489. #define HTT_TX_MSDU_INFO_SW_PEER_ID_S 0
  14490. #define HTT_TX_MSDU_INFO_SW_PEER_ID_SET(word, value) \
  14491. do { \
  14492. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_SW_PEER_ID, value); \
  14493. (word) |= (value) << HTT_TX_MSDU_INFO_SW_PEER_ID_S; \
  14494. } while (0)
  14495. #define HTT_TX_MSDU_INFO_SW_PEER_ID_GET(word) \
  14496. (((word) & HTT_TX_MSDU_INFO_SW_PEER_ID_M) >> HTT_TX_MSDU_INFO_SW_PEER_ID_S)
  14497. #define HTT_TX_MSDU_INFO_TID_M 0x000F0000
  14498. #define HTT_TX_MSDU_INFO_TID_S 16
  14499. #define HTT_TX_MSDU_INFO_TID_SET(word, value) \
  14500. do { \
  14501. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TID, value); \
  14502. (word) |= (value) << HTT_TX_MSDU_INFO_TID_S; \
  14503. } while (0)
  14504. #define HTT_TX_MSDU_INFO_TID_GET(word) \
  14505. (((word) & HTT_TX_MSDU_INFO_TID_M) >> HTT_TX_MSDU_INFO_TID_S)
  14506. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_M 0x07F00000
  14507. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_S 20
  14508. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_SET(word, value) \
  14509. do { \
  14510. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TRANSMIT_CNT, value); \
  14511. (word) |= (value) << HTT_TX_MSDU_INFO_TRANSMIT_CNT_S; \
  14512. } while (0)
  14513. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_GET(word) \
  14514. (((word) & HTT_TX_MSDU_INFO_TRANSMIT_CNT_M) >> HTT_TX_MSDU_INFO_TRANSMIT_CNT_S)
  14515. #define HTT_TX_MSDU_INFO_VALID_M 0x08000000
  14516. #define HTT_TX_MSDU_INFO_VALID_S 27
  14517. #define HTT_TX_MSDU_INFO_VALID_SET(word, value) \
  14518. do { \
  14519. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_VALID, value); \
  14520. (word) |= (value) << HTT_TX_MSDU_INFO_VALID_S; \
  14521. } while (0)
  14522. #define HTT_TX_MSDU_INFO_VALID_GET(word) \
  14523. (((word) & HTT_TX_MSDU_INFO_VALID_M) >> HTT_TX_MSDU_INFO_VALID_S)
  14524. #define HTT_TX_MSDU_INFO_MCAST_M 0x10000000
  14525. #define HTT_TX_MSDU_INFO_MCAST_S 28
  14526. #define HTT_TX_MSDU_INFO_MCAST_SET(word, value) \
  14527. do { \
  14528. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MCAST, value); \
  14529. (word) |= (value) << HTT_TX_MSDU_INFO_MCAST_S; \
  14530. } while (0)
  14531. #define HTT_TX_MSDU_INFO_MCAST_GET(word) \
  14532. (((word) & HTT_TX_MSDU_INFO_MCAST_M) >> HTT_TX_MSDU_INFO_MCAST_S)
  14533. #define HTT_TX_MSDU_INFO_RELEASE_REASON_M 0x0000000F
  14534. #define HTT_TX_MSDU_INFO_RELEASE_REASON_S 0
  14535. #define HTT_TX_MSDU_INFO_RELEASE_REASON_SET(word, value) \
  14536. do { \
  14537. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_RELEASE_REASON, value); \
  14538. (word) |= (value) << HTT_TX_MSDU_INFO_RELEASE_REASON_S; \
  14539. } while (0)
  14540. #define HTT_TX_MSDU_INFO_RELEASE_REASON_GET(word) \
  14541. (((word) & HTT_TX_MSDU_INFO_RELEASE_REASON_M) >> HTT_TX_MSDU_INFO_RELEASE_REASON_S)
  14542. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M 0x0FFFFFF0
  14543. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S 4
  14544. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_SET(word, value) \
  14545. do { \
  14546. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER, value); \
  14547. (word) |= (value) << HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S; \
  14548. } while (0)
  14549. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_GET(word) \
  14550. (((word) & HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M) >> HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S)
  14551. #define HTT_TX_MSDU_INFO_FRAME_TYPE_M 0xF0000000
  14552. #define HTT_TX_MSDU_INFO_FRAME_TYPE_S 28
  14553. #define HTT_TX_MSDU_INFO_FRAME_TYPE_SET(word, value) \
  14554. do { \
  14555. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FRAME_TYPE, value); \
  14556. (word) |= (value) << HTT_TX_MSDU_INFO_FRAME_TYPE_S; \
  14557. } while (0)
  14558. #define HTT_TX_MSDU_INFO_FRAME_TYPE_GET(word) \
  14559. (((word) & HTT_TX_MSDU_INFO_FRAME_TYPE_M) >> HTT_TX_MSDU_INFO_FRAME_TYPE_S)
  14560. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M 0x000000FF
  14561. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S 0
  14562. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_SET(word, value) \
  14563. do { \
  14564. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_ACK_FRAME_RSSI, value); \
  14565. (word) |= (value) << HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S; \
  14566. } while (0)
  14567. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_GET(word) \
  14568. (((word) & HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M) >> HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S)
  14569. #define HTT_TX_MSDU_INFO_FIRST_MSDU_M 0x00000100
  14570. #define HTT_TX_MSDU_INFO_FIRST_MSDU_S 8
  14571. #define HTT_TX_MSDU_INFO_FIRST_MSDU_SET(word, value) \
  14572. do { \
  14573. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FIRST_MSDU, value); \
  14574. (word) |= (value) << HTT_TX_MSDU_INFO_FIRST_MSDU_S; \
  14575. } while (0)
  14576. #define HTT_TX_MSDU_INFO_FIRST_MSDU_GET(word) \
  14577. (((word) & HTT_TX_MSDU_INFO_FIRST_MSDU_M) >> HTT_TX_MSDU_INFO_FIRST_MSDU_S)
  14578. #define HTT_TX_MSDU_INFO_LAST_MSDU_M 0x00000200
  14579. #define HTT_TX_MSDU_INFO_LAST_MSDU_S 9
  14580. #define HTT_TX_MSDU_INFO_LAST_MSDU_SET(word, value) \
  14581. do { \
  14582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_LAST_MSDU, value); \
  14583. (word) |= (value) << HTT_TX_MSDU_INFO_LAST_MSDU_S; \
  14584. } while (0)
  14585. #define HTT_TX_MSDU_INFO_LAST_MSDU_GET(word) \
  14586. (((word) & HTT_TX_MSDU_INFO_LAST_MSDU_M) >> HTT_TX_MSDU_INFO_LAST_MSDU_S)
  14587. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M 0x00000400
  14588. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S 10
  14589. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_SET(word, value) \
  14590. do { \
  14591. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU, value); \
  14592. (word) |= (value) << HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S; \
  14593. } while (0)
  14594. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_GET(word) \
  14595. (((word) & HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M) >> HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S)
  14596. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M 0x3FFFF800
  14597. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S 11
  14598. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_SET(word, value) \
  14599. do { \
  14600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP, value); \
  14601. (word) |= (value) << HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S; \
  14602. } while (0)
  14603. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_GET(word) \
  14604. (((word) & HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M) >> HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S)
  14605. struct htt_t2h_soft_umac_tx_compl_ind {
  14606. A_UINT32 msg_type : 8, /* HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND */
  14607. msdu_cnt : 8, /* min: 0, max: 255 */
  14608. rsvd0 : 16;
  14609. /* NOTE:
  14610. * To preserve backwards compatibility,
  14611. * no new fields can be added in this struct.
  14612. */
  14613. /*
  14614. * append here:
  14615. * struct htt_t2h_tx_msdu_info payload[1(or more)]
  14616. * for all the msdu's that are part of this completion.
  14617. */
  14618. };
  14619. /* member definitions of htt_t2h_soft_umac_tx_compl_ind */
  14620. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M 0x0000FF00
  14621. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S 8
  14622. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_SET(word, value) \
  14623. do { \
  14624. HTT_CHECK_SET_VAL(HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT, value); \
  14625. (word) |= (value) << HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S; \
  14626. } while (0)
  14627. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_GET(word) \
  14628. (((word) & HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M) >> HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S)
  14629. /**
  14630. * @brief target -> host rate-control update indication message
  14631. *
  14632. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  14633. *
  14634. * @details
  14635. * The following diagram shows the format of the RC Update message
  14636. * sent from the target to the host, while processing the tx-completion
  14637. * of a transmitted PPDU.
  14638. *
  14639. * |31 24|23 16|15 8|7 0|
  14640. * |-------------------------------------------------------------|
  14641. * | peer ID | vdev ID | msg_type |
  14642. * |-------------------------------------------------------------|
  14643. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  14644. * |-------------------------------------------------------------|
  14645. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  14646. * |-------------------------------------------------------------|
  14647. * | : |
  14648. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14649. * | : |
  14650. * |-------------------------------------------------------------|
  14651. * | : |
  14652. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14653. * | : |
  14654. * |-------------------------------------------------------------|
  14655. * : :
  14656. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14657. *
  14658. */
  14659. typedef struct {
  14660. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  14661. A_UINT32 rate_code_flags;
  14662. A_UINT32 flags; /* Encodes information such as excessive
  14663. retransmission, aggregate, some info
  14664. from .11 frame control,
  14665. STBC, LDPC, (SGI and Tx Chain Mask
  14666. are encoded in ptx_rc->flags field),
  14667. AMPDU truncation (BT/time based etc.),
  14668. RTS/CTS attempt */
  14669. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  14670. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  14671. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  14672. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  14673. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  14674. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  14675. } HTT_RC_TX_DONE_PARAMS;
  14676. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  14677. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  14678. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  14679. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  14680. #define HTT_RC_UPDATE_VDEVID_S 8
  14681. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  14682. #define HTT_RC_UPDATE_PEERID_S 16
  14683. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  14684. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  14685. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  14686. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  14687. do { \
  14688. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  14689. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  14690. } while (0)
  14691. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  14692. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  14693. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  14694. do { \
  14695. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  14696. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  14697. } while (0)
  14698. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  14699. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  14700. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  14701. do { \
  14702. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  14703. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  14704. } while (0)
  14705. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  14706. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  14707. /**
  14708. * @brief target -> host rx fragment indication message definition
  14709. *
  14710. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  14711. *
  14712. * @details
  14713. * The following field definitions describe the format of the rx fragment
  14714. * indication message sent from the target to the host.
  14715. * The rx fragment indication message shares the format of the
  14716. * rx indication message, but not all fields from the rx indication message
  14717. * are relevant to the rx fragment indication message.
  14718. *
  14719. *
  14720. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  14721. * |-----------+-------------------+---------------------+-------------|
  14722. * | peer ID | |FV| ext TID | msg type |
  14723. * |-------------------------------------------------------------------|
  14724. * | | flush | flush |
  14725. * | | end | start |
  14726. * | | seq num | seq num |
  14727. * |-------------------------------------------------------------------|
  14728. * | reserved | FW rx desc bytes |
  14729. * |-------------------------------------------------------------------|
  14730. * | | FW MSDU Rx |
  14731. * | | desc B0 |
  14732. * |-------------------------------------------------------------------|
  14733. * Header fields:
  14734. * - MSG_TYPE
  14735. * Bits 7:0
  14736. * Purpose: identifies this as an rx fragment indication message
  14737. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  14738. * - EXT_TID
  14739. * Bits 12:8
  14740. * Purpose: identify the traffic ID of the rx data, including
  14741. * special "extended" TID values for multicast, broadcast, and
  14742. * non-QoS data frames
  14743. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  14744. * - FLUSH_VALID (FV)
  14745. * Bit 13
  14746. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  14747. * is valid
  14748. * Value:
  14749. * 1 -> flush IE is valid and needs to be processed
  14750. * 0 -> flush IE is not valid and should be ignored
  14751. * - PEER_ID
  14752. * Bits 31:16
  14753. * Purpose: Identify, by ID, which peer sent the rx data
  14754. * Value: ID of the peer who sent the rx data
  14755. * - FLUSH_SEQ_NUM_START
  14756. * Bits 5:0
  14757. * Purpose: Indicate the start of a series of MPDUs to flush
  14758. * Not all MPDUs within this series are necessarily valid - the host
  14759. * must check each sequence number within this range to see if the
  14760. * corresponding MPDU is actually present.
  14761. * This field is only valid if the FV bit is set.
  14762. * Value:
  14763. * The sequence number for the first MPDUs to check to flush.
  14764. * The sequence number is masked by 0x3f.
  14765. * - FLUSH_SEQ_NUM_END
  14766. * Bits 11:6
  14767. * Purpose: Indicate the end of a series of MPDUs to flush
  14768. * Value:
  14769. * The sequence number one larger than the sequence number of the
  14770. * last MPDU to check to flush.
  14771. * The sequence number is masked by 0x3f.
  14772. * Not all MPDUs within this series are necessarily valid - the host
  14773. * must check each sequence number within this range to see if the
  14774. * corresponding MPDU is actually present.
  14775. * This field is only valid if the FV bit is set.
  14776. * Rx descriptor fields:
  14777. * - FW_RX_DESC_BYTES
  14778. * Bits 15:0
  14779. * Purpose: Indicate how many bytes in the Rx indication are used for
  14780. * FW Rx descriptors
  14781. * Value: 1
  14782. */
  14783. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  14784. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  14785. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  14786. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  14787. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  14788. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  14789. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  14790. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  14791. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  14792. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  14793. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  14794. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  14795. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  14796. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  14797. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  14798. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  14799. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  14800. #define HTT_RX_FRAG_IND_BYTES \
  14801. (4 /* msg hdr */ + \
  14802. 4 /* flush spec */ + \
  14803. 4 /* (unused) FW rx desc bytes spec */ + \
  14804. 4 /* FW rx desc */)
  14805. /**
  14806. * @brief target -> host test message definition
  14807. *
  14808. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  14809. *
  14810. * @details
  14811. * The following field definitions describe the format of the test
  14812. * message sent from the target to the host.
  14813. * The message consists of a 4-octet header, followed by a variable
  14814. * number of 32-bit integer values, followed by a variable number
  14815. * of 8-bit character values.
  14816. *
  14817. * |31 16|15 8|7 0|
  14818. * |-----------------------------------------------------------|
  14819. * | num chars | num ints | msg type |
  14820. * |-----------------------------------------------------------|
  14821. * | int 0 |
  14822. * |-----------------------------------------------------------|
  14823. * | int 1 |
  14824. * |-----------------------------------------------------------|
  14825. * | ... |
  14826. * |-----------------------------------------------------------|
  14827. * | char 3 | char 2 | char 1 | char 0 |
  14828. * |-----------------------------------------------------------|
  14829. * | | | ... | char 4 |
  14830. * |-----------------------------------------------------------|
  14831. * - MSG_TYPE
  14832. * Bits 7:0
  14833. * Purpose: identifies this as a test message
  14834. * Value: HTT_MSG_TYPE_TEST
  14835. * - NUM_INTS
  14836. * Bits 15:8
  14837. * Purpose: indicate how many 32-bit integers follow the message header
  14838. * - NUM_CHARS
  14839. * Bits 31:16
  14840. * Purpose: indicate how many 8-bit characters follow the series of integers
  14841. */
  14842. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  14843. #define HTT_RX_TEST_NUM_INTS_S 8
  14844. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  14845. #define HTT_RX_TEST_NUM_CHARS_S 16
  14846. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  14847. do { \
  14848. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  14849. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  14850. } while (0)
  14851. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  14852. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  14853. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  14854. do { \
  14855. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  14856. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  14857. } while (0)
  14858. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  14859. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  14860. /**
  14861. * @brief target -> host packet log message
  14862. *
  14863. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  14864. *
  14865. * @details
  14866. * The following field definitions describe the format of the packet log
  14867. * message sent from the target to the host.
  14868. * The message consists of a 4-octet header,followed by a variable number
  14869. * of 32-bit character values.
  14870. *
  14871. * |31 16|15 12|11 10|9 8|7 0|
  14872. * |------------------------------------------------------------------|
  14873. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  14874. * |------------------------------------------------------------------|
  14875. * | payload |
  14876. * |------------------------------------------------------------------|
  14877. * - MSG_TYPE
  14878. * Bits 7:0
  14879. * Purpose: identifies this as a pktlog message
  14880. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  14881. * - mac_id
  14882. * Bits 9:8
  14883. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  14884. * Value: 0-3
  14885. * - pdev_id
  14886. * Bits 11:10
  14887. * Purpose: pdev_id
  14888. * Value: 0-3
  14889. * 0 (for rings at SOC level),
  14890. * 1/2/3 PDEV -> 0/1/2
  14891. * - payload_size
  14892. * Bits 31:16
  14893. * Purpose: explicitly specify the payload size
  14894. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  14895. */
  14896. PREPACK struct htt_pktlog_msg {
  14897. A_UINT32 header;
  14898. A_UINT32 payload[1/* or more */];
  14899. } POSTPACK;
  14900. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  14901. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  14902. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  14903. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  14904. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  14905. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  14906. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  14907. do { \
  14908. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  14909. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  14910. } while (0)
  14911. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  14912. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  14913. HTT_T2H_PKTLOG_MAC_ID_S)
  14914. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  14915. do { \
  14916. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  14917. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  14918. } while (0)
  14919. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  14920. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  14921. HTT_T2H_PKTLOG_PDEV_ID_S)
  14922. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  14923. do { \
  14924. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  14925. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  14926. } while (0)
  14927. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  14928. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  14929. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  14930. /*
  14931. * Rx reorder statistics
  14932. * NB: all the fields must be defined in 4 octets size.
  14933. */
  14934. struct rx_reorder_stats {
  14935. /* Non QoS MPDUs received */
  14936. A_UINT32 deliver_non_qos;
  14937. /* MPDUs received in-order */
  14938. A_UINT32 deliver_in_order;
  14939. /* Flush due to reorder timer expired */
  14940. A_UINT32 deliver_flush_timeout;
  14941. /* Flush due to move out of window */
  14942. A_UINT32 deliver_flush_oow;
  14943. /* Flush due to DELBA */
  14944. A_UINT32 deliver_flush_delba;
  14945. /* MPDUs dropped due to FCS error */
  14946. A_UINT32 fcs_error;
  14947. /* MPDUs dropped due to monitor mode non-data packet */
  14948. A_UINT32 mgmt_ctrl;
  14949. /* Unicast-data MPDUs dropped due to invalid peer */
  14950. A_UINT32 invalid_peer;
  14951. /* MPDUs dropped due to duplication (non aggregation) */
  14952. A_UINT32 dup_non_aggr;
  14953. /* MPDUs dropped due to processed before */
  14954. A_UINT32 dup_past;
  14955. /* MPDUs dropped due to duplicate in reorder queue */
  14956. A_UINT32 dup_in_reorder;
  14957. /* Reorder timeout happened */
  14958. A_UINT32 reorder_timeout;
  14959. /* invalid bar ssn */
  14960. A_UINT32 invalid_bar_ssn;
  14961. /* reorder reset due to bar ssn */
  14962. A_UINT32 ssn_reset;
  14963. /* Flush due to delete peer */
  14964. A_UINT32 deliver_flush_delpeer;
  14965. /* Flush due to offload*/
  14966. A_UINT32 deliver_flush_offload;
  14967. /* Flush due to out of buffer*/
  14968. A_UINT32 deliver_flush_oob;
  14969. /* MPDUs dropped due to PN check fail */
  14970. A_UINT32 pn_fail;
  14971. /* MPDUs dropped due to unable to allocate memory */
  14972. A_UINT32 store_fail;
  14973. /* Number of times the tid pool alloc succeeded */
  14974. A_UINT32 tid_pool_alloc_succ;
  14975. /* Number of times the MPDU pool alloc succeeded */
  14976. A_UINT32 mpdu_pool_alloc_succ;
  14977. /* Number of times the MSDU pool alloc succeeded */
  14978. A_UINT32 msdu_pool_alloc_succ;
  14979. /* Number of times the tid pool alloc failed */
  14980. A_UINT32 tid_pool_alloc_fail;
  14981. /* Number of times the MPDU pool alloc failed */
  14982. A_UINT32 mpdu_pool_alloc_fail;
  14983. /* Number of times the MSDU pool alloc failed */
  14984. A_UINT32 msdu_pool_alloc_fail;
  14985. /* Number of times the tid pool freed */
  14986. A_UINT32 tid_pool_free;
  14987. /* Number of times the MPDU pool freed */
  14988. A_UINT32 mpdu_pool_free;
  14989. /* Number of times the MSDU pool freed */
  14990. A_UINT32 msdu_pool_free;
  14991. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  14992. A_UINT32 msdu_queued;
  14993. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  14994. A_UINT32 msdu_recycled;
  14995. /* Number of MPDUs with invalid peer but A2 found in AST */
  14996. A_UINT32 invalid_peer_a2_in_ast;
  14997. /* Number of MPDUs with invalid peer but A3 found in AST */
  14998. A_UINT32 invalid_peer_a3_in_ast;
  14999. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  15000. A_UINT32 invalid_peer_bmc_mpdus;
  15001. /* Number of MSDUs with err attention word */
  15002. A_UINT32 rxdesc_err_att;
  15003. /* Number of MSDUs with flag of peer_idx_invalid */
  15004. A_UINT32 rxdesc_err_peer_idx_inv;
  15005. /* Number of MSDUs with flag of peer_idx_timeout */
  15006. A_UINT32 rxdesc_err_peer_idx_to;
  15007. /* Number of MSDUs with flag of overflow */
  15008. A_UINT32 rxdesc_err_ov;
  15009. /* Number of MSDUs with flag of msdu_length_err */
  15010. A_UINT32 rxdesc_err_msdu_len;
  15011. /* Number of MSDUs with flag of mpdu_length_err */
  15012. A_UINT32 rxdesc_err_mpdu_len;
  15013. /* Number of MSDUs with flag of tkip_mic_err */
  15014. A_UINT32 rxdesc_err_tkip_mic;
  15015. /* Number of MSDUs with flag of decrypt_err */
  15016. A_UINT32 rxdesc_err_decrypt;
  15017. /* Number of MSDUs with flag of fcs_err */
  15018. A_UINT32 rxdesc_err_fcs;
  15019. /* Number of Unicast (bc_mc bit is not set in attention word)
  15020. * frames with invalid peer handler
  15021. */
  15022. A_UINT32 rxdesc_uc_msdus_inv_peer;
  15023. /* Number of unicast frame directly (direct bit is set in attention word)
  15024. * to DUT with invalid peer handler
  15025. */
  15026. A_UINT32 rxdesc_direct_msdus_inv_peer;
  15027. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  15028. * frames with invalid peer handler
  15029. */
  15030. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  15031. /* Number of MSDUs dropped due to no first MSDU flag */
  15032. A_UINT32 rxdesc_no_1st_msdu;
  15033. /* Number of MSDUs dropped due to ring overflow */
  15034. A_UINT32 msdu_drop_ring_ov;
  15035. /* Number of MSDUs dropped due to FC mismatch */
  15036. A_UINT32 msdu_drop_fc_mismatch;
  15037. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  15038. A_UINT32 msdu_drop_mgmt_remote_ring;
  15039. /* Number of MSDUs dropped due to errors not reported in attention word */
  15040. A_UINT32 msdu_drop_misc;
  15041. /* Number of MSDUs go to offload before reorder */
  15042. A_UINT32 offload_msdu_wal;
  15043. /* Number of data frame dropped by offload after reorder */
  15044. A_UINT32 offload_msdu_reorder;
  15045. /* Number of MPDUs with sequence number in the past and within the BA window */
  15046. A_UINT32 dup_past_within_window;
  15047. /* Number of MPDUs with sequence number in the past and outside the BA window */
  15048. A_UINT32 dup_past_outside_window;
  15049. /* Number of MSDUs with decrypt/MIC error */
  15050. A_UINT32 rxdesc_err_decrypt_mic;
  15051. /* Number of data MSDUs received on both local and remote rings */
  15052. A_UINT32 data_msdus_on_both_rings;
  15053. /* MPDUs never filled */
  15054. A_UINT32 holes_not_filled;
  15055. };
  15056. /*
  15057. * Rx Remote buffer statistics
  15058. * NB: all the fields must be defined in 4 octets size.
  15059. */
  15060. struct rx_remote_buffer_mgmt_stats {
  15061. /* Total number of MSDUs reaped for Rx processing */
  15062. A_UINT32 remote_reaped;
  15063. /* MSDUs recycled within firmware */
  15064. A_UINT32 remote_recycled;
  15065. /* MSDUs stored by Data Rx */
  15066. A_UINT32 data_rx_msdus_stored;
  15067. /* Number of HTT indications from WAL Rx MSDU */
  15068. A_UINT32 wal_rx_ind;
  15069. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  15070. A_UINT32 wal_rx_ind_unconsumed;
  15071. /* Number of HTT indications from Data Rx MSDU */
  15072. A_UINT32 data_rx_ind;
  15073. /* Number of unconsumed HTT indications from Data Rx MSDU */
  15074. A_UINT32 data_rx_ind_unconsumed;
  15075. /* Number of HTT indications from ATHBUF */
  15076. A_UINT32 athbuf_rx_ind;
  15077. /* Number of remote buffers requested for refill */
  15078. A_UINT32 refill_buf_req;
  15079. /* Number of remote buffers filled by the host */
  15080. A_UINT32 refill_buf_rsp;
  15081. /* Number of times MAC hw_index = f/w write_index */
  15082. A_INT32 mac_no_bufs;
  15083. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  15084. A_INT32 fw_indices_equal;
  15085. /* Number of times f/w finds no buffers to post */
  15086. A_INT32 host_no_bufs;
  15087. };
  15088. /*
  15089. * TXBF MU/SU packets and NDPA statistics
  15090. * NB: all the fields must be defined in 4 octets size.
  15091. */
  15092. struct rx_txbf_musu_ndpa_pkts_stats {
  15093. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  15094. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  15095. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  15096. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  15097. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  15098. A_UINT32 reserved[3]; /* must be set to 0x0 */
  15099. };
  15100. /*
  15101. * htt_dbg_stats_status -
  15102. * present - The requested stats have been delivered in full.
  15103. * This indicates that either the stats information was contained
  15104. * in its entirety within this message, or else this message
  15105. * completes the delivery of the requested stats info that was
  15106. * partially delivered through earlier STATS_CONF messages.
  15107. * partial - The requested stats have been delivered in part.
  15108. * One or more subsequent STATS_CONF messages with the same
  15109. * cookie value will be sent to deliver the remainder of the
  15110. * information.
  15111. * error - The requested stats could not be delivered, for example due
  15112. * to a shortage of memory to construct a message holding the
  15113. * requested stats.
  15114. * invalid - The requested stat type is either not recognized, or the
  15115. * target is configured to not gather the stats type in question.
  15116. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15117. * series_done - This special value indicates that no further stats info
  15118. * elements are present within a series of stats info elems
  15119. * (within a stats upload confirmation message).
  15120. */
  15121. enum htt_dbg_stats_status {
  15122. HTT_DBG_STATS_STATUS_PRESENT = 0,
  15123. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  15124. HTT_DBG_STATS_STATUS_ERROR = 2,
  15125. HTT_DBG_STATS_STATUS_INVALID = 3,
  15126. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  15127. };
  15128. /**
  15129. * @brief target -> host statistics upload
  15130. *
  15131. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  15132. *
  15133. * @details
  15134. * The following field definitions describe the format of the HTT target
  15135. * to host stats upload confirmation message.
  15136. * The message contains a cookie echoed from the HTT host->target stats
  15137. * upload request, which identifies which request the confirmation is
  15138. * for, and a series of tag-length-value stats information elements.
  15139. * The tag-length header for each stats info element also includes a
  15140. * status field, to indicate whether the request for the stat type in
  15141. * question was fully met, partially met, unable to be met, or invalid
  15142. * (if the stat type in question is disabled in the target).
  15143. * A special value of all 1's in this status field is used to indicate
  15144. * the end of the series of stats info elements.
  15145. *
  15146. *
  15147. * |31 16|15 8|7 5|4 0|
  15148. * |------------------------------------------------------------|
  15149. * | reserved | msg type |
  15150. * |------------------------------------------------------------|
  15151. * | cookie LSBs |
  15152. * |------------------------------------------------------------|
  15153. * | cookie MSBs |
  15154. * |------------------------------------------------------------|
  15155. * | stats entry length | reserved | S |stat type|
  15156. * |------------------------------------------------------------|
  15157. * | |
  15158. * | type-specific stats info |
  15159. * | |
  15160. * |------------------------------------------------------------|
  15161. * | stats entry length | reserved | S |stat type|
  15162. * |------------------------------------------------------------|
  15163. * | |
  15164. * | type-specific stats info |
  15165. * | |
  15166. * |------------------------------------------------------------|
  15167. * | n/a | reserved | 111 | n/a |
  15168. * |------------------------------------------------------------|
  15169. * Header fields:
  15170. * - MSG_TYPE
  15171. * Bits 7:0
  15172. * Purpose: identifies this is a statistics upload confirmation message
  15173. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  15174. * - COOKIE_LSBS
  15175. * Bits 31:0
  15176. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15177. * message with its preceding host->target stats request message.
  15178. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15179. * - COOKIE_MSBS
  15180. * Bits 31:0
  15181. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15182. * message with its preceding host->target stats request message.
  15183. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15184. *
  15185. * Stats Information Element tag-length header fields:
  15186. * - STAT_TYPE
  15187. * Bits 4:0
  15188. * Purpose: identifies the type of statistics info held in the
  15189. * following information element
  15190. * Value: htt_dbg_stats_type
  15191. * - STATUS
  15192. * Bits 7:5
  15193. * Purpose: indicate whether the requested stats are present
  15194. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  15195. * the completion of the stats entry series
  15196. * - LENGTH
  15197. * Bits 31:16
  15198. * Purpose: indicate the stats information size
  15199. * Value: This field specifies the number of bytes of stats information
  15200. * that follows the element tag-length header.
  15201. * It is expected but not required that this length is a multiple of
  15202. * 4 bytes. Even if the length is not an integer multiple of 4, the
  15203. * subsequent stats entry header will begin on a 4-byte aligned
  15204. * boundary.
  15205. */
  15206. #define HTT_T2H_STATS_COOKIE_SIZE 8
  15207. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  15208. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  15209. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  15210. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  15211. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  15212. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  15213. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  15214. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15215. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  15216. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  15217. do { \
  15218. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  15219. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  15220. } while (0)
  15221. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  15222. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  15223. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  15224. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  15225. do { \
  15226. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  15227. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  15228. } while (0)
  15229. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  15230. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  15231. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  15232. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15233. do { \
  15234. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  15235. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  15236. } while (0)
  15237. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  15238. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  15239. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  15240. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  15241. #define HTT_MAX_AGGR 64
  15242. #define HTT_HL_MAX_AGGR 18
  15243. /**
  15244. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  15245. *
  15246. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  15247. *
  15248. * @details
  15249. * The following field definitions describe the format of the HTT host
  15250. * to target frag_desc/msdu_ext bank configuration message.
  15251. * The message contains the based address and the min and max id of the
  15252. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  15253. * MSDU_EXT/FRAG_DESC.
  15254. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  15255. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  15256. * the hardware does the mapping/translation.
  15257. *
  15258. * Total banks that can be configured is configured to 16.
  15259. *
  15260. * This should be called before any TX has be initiated by the HTT
  15261. *
  15262. * |31 16|15 8|7 5|4 0|
  15263. * |------------------------------------------------------------|
  15264. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  15265. * |------------------------------------------------------------|
  15266. * | BANK0_BASE_ADDRESS (bits 31:0) |
  15267. #if HTT_PADDR64
  15268. * | BANK0_BASE_ADDRESS (bits 63:32) |
  15269. #endif
  15270. * |------------------------------------------------------------|
  15271. * | ... |
  15272. * |------------------------------------------------------------|
  15273. * | BANK15_BASE_ADDRESS (bits 31:0) |
  15274. #if HTT_PADDR64
  15275. * | BANK15_BASE_ADDRESS (bits 63:32) |
  15276. #endif
  15277. * |------------------------------------------------------------|
  15278. * | BANK0_MAX_ID | BANK0_MIN_ID |
  15279. * |------------------------------------------------------------|
  15280. * | ... |
  15281. * |------------------------------------------------------------|
  15282. * | BANK15_MAX_ID | BANK15_MIN_ID |
  15283. * |------------------------------------------------------------|
  15284. * Header fields:
  15285. * - MSG_TYPE
  15286. * Bits 7:0
  15287. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  15288. * for systems with 64-bit format for bus addresses:
  15289. * - BANKx_BASE_ADDRESS_LO
  15290. * Bits 31:0
  15291. * Purpose: Provide a mechanism to specify the base address of the
  15292. * MSDU_EXT bank physical/bus address.
  15293. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  15294. * - BANKx_BASE_ADDRESS_HI
  15295. * Bits 31:0
  15296. * Purpose: Provide a mechanism to specify the base address of the
  15297. * MSDU_EXT bank physical/bus address.
  15298. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  15299. * for systems with 32-bit format for bus addresses:
  15300. * - BANKx_BASE_ADDRESS
  15301. * Bits 31:0
  15302. * Purpose: Provide a mechanism to specify the base address of the
  15303. * MSDU_EXT bank physical/bus address.
  15304. * Value: MSDU_EXT bank physical / bus address
  15305. * - BANKx_MIN_ID
  15306. * Bits 15:0
  15307. * Purpose: Provide a mechanism to specify the min index that needs to
  15308. * mapped.
  15309. * - BANKx_MAX_ID
  15310. * Bits 31:16
  15311. * Purpose: Provide a mechanism to specify the max index that needs to
  15312. * mapped.
  15313. *
  15314. */
  15315. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  15316. * safe value.
  15317. * @note MAX supported banks is 16.
  15318. */
  15319. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  15320. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  15321. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  15322. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  15323. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  15324. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  15325. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  15326. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  15327. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  15328. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  15329. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  15330. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  15331. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  15332. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  15333. do { \
  15334. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  15335. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  15336. } while (0)
  15337. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  15338. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  15339. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  15340. do { \
  15341. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  15342. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  15343. } while (0)
  15344. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  15345. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  15346. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  15347. do { \
  15348. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  15349. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  15350. } while (0)
  15351. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  15352. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  15353. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  15354. do { \
  15355. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  15356. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  15357. } while (0)
  15358. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  15359. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  15360. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  15361. do { \
  15362. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  15363. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  15364. } while (0)
  15365. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  15366. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  15367. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  15368. do { \
  15369. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  15370. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  15371. } while (0)
  15372. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  15373. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  15374. /*
  15375. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  15376. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  15377. * addresses are stored in a XXX-bit field.
  15378. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  15379. * htt_tx_frag_desc64_bank_cfg_t structs.
  15380. */
  15381. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  15382. _paddr_bits_, \
  15383. _paddr__bank_base_address_) \
  15384. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  15385. /** word 0 \
  15386. * msg_type: 8, \
  15387. * pdev_id: 2, \
  15388. * swap: 1, \
  15389. * reserved0: 5, \
  15390. * num_banks: 8, \
  15391. * desc_size: 8; \
  15392. */ \
  15393. A_UINT32 word0; \
  15394. /* \
  15395. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  15396. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  15397. * the second A_UINT32). \
  15398. */ \
  15399. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15400. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15401. } POSTPACK
  15402. /* define htt_tx_frag_desc32_bank_cfg_t */
  15403. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  15404. /* define htt_tx_frag_desc64_bank_cfg_t */
  15405. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  15406. /*
  15407. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  15408. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  15409. */
  15410. #if HTT_PADDR64
  15411. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  15412. #else
  15413. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  15414. #endif
  15415. /**
  15416. * @brief target -> host HTT TX Credit total count update message definition
  15417. *
  15418. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  15419. *
  15420. *|31 16|15|14 9| 8 |7 0 |
  15421. *|---------------------+--+----------+-------+----------|
  15422. *|cur htt credit delta | Q| reserved | sign | msg type |
  15423. *|------------------------------------------------------|
  15424. *
  15425. * Header fields:
  15426. * - MSG_TYPE
  15427. * Bits 7:0
  15428. * Purpose: identifies this as a htt tx credit delta update message
  15429. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  15430. * - SIGN
  15431. * Bits 8
  15432. * identifies whether credit delta is positive or negative
  15433. * Value:
  15434. * - 0x0: credit delta is positive, rebalance in some buffers
  15435. * - 0x1: credit delta is negative, rebalance out some buffers
  15436. * - reserved
  15437. * Bits 14:9
  15438. * Value: 0x0
  15439. * - TXQ_GRP
  15440. * Bit 15
  15441. * Purpose: indicates whether any tx queue group information elements
  15442. * are appended to the tx credit update message
  15443. * Value: 0 -> no tx queue group information element is present
  15444. * 1 -> a tx queue group information element immediately follows
  15445. * - DELTA_COUNT
  15446. * Bits 31:16
  15447. * Purpose: Specify current htt credit delta absolute count
  15448. */
  15449. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  15450. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  15451. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  15452. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  15453. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  15454. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  15455. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  15456. do { \
  15457. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  15458. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  15459. } while (0)
  15460. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  15461. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  15462. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  15463. do { \
  15464. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  15465. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  15466. } while (0)
  15467. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  15468. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  15469. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  15470. do { \
  15471. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  15472. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  15473. } while (0)
  15474. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  15475. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  15476. #define HTT_TX_CREDIT_MSG_BYTES 4
  15477. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  15478. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  15479. /**
  15480. * @brief HTT WDI_IPA Operation Response Message
  15481. *
  15482. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  15483. *
  15484. * @details
  15485. * HTT WDI_IPA Operation Response message is sent by target
  15486. * to host confirming suspend or resume operation.
  15487. * |31 24|23 16|15 8|7 0|
  15488. * |----------------+----------------+----------------+----------------|
  15489. * | op_code | Rsvd | msg_type |
  15490. * |-------------------------------------------------------------------|
  15491. * | Rsvd | Response len |
  15492. * |-------------------------------------------------------------------|
  15493. * | |
  15494. * | Response-type specific info |
  15495. * | |
  15496. * | |
  15497. * |-------------------------------------------------------------------|
  15498. * Header fields:
  15499. * - MSG_TYPE
  15500. * Bits 7:0
  15501. * Purpose: Identifies this as WDI_IPA Operation Response message
  15502. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  15503. * - OP_CODE
  15504. * Bits 31:16
  15505. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  15506. * value: = enum htt_wdi_ipa_op_code
  15507. * - RSP_LEN
  15508. * Bits 16:0
  15509. * Purpose: length for the response-type specific info
  15510. * value: = length in bytes for response-type specific info
  15511. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  15512. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  15513. */
  15514. PREPACK struct htt_wdi_ipa_op_response_t
  15515. {
  15516. /* DWORD 0: flags and meta-data */
  15517. A_UINT32
  15518. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15519. reserved1: 8,
  15520. op_code: 16;
  15521. A_UINT32
  15522. rsp_len: 16,
  15523. reserved2: 16;
  15524. } POSTPACK;
  15525. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  15526. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  15527. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  15528. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  15529. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  15530. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  15531. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  15532. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  15533. do { \
  15534. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  15535. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  15536. } while (0)
  15537. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  15538. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  15539. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  15540. do { \
  15541. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  15542. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  15543. } while (0)
  15544. enum htt_phy_mode {
  15545. htt_phy_mode_11a = 0,
  15546. htt_phy_mode_11g = 1,
  15547. htt_phy_mode_11b = 2,
  15548. htt_phy_mode_11g_only = 3,
  15549. htt_phy_mode_11na_ht20 = 4,
  15550. htt_phy_mode_11ng_ht20 = 5,
  15551. htt_phy_mode_11na_ht40 = 6,
  15552. htt_phy_mode_11ng_ht40 = 7,
  15553. htt_phy_mode_11ac_vht20 = 8,
  15554. htt_phy_mode_11ac_vht40 = 9,
  15555. htt_phy_mode_11ac_vht80 = 10,
  15556. htt_phy_mode_11ac_vht20_2g = 11,
  15557. htt_phy_mode_11ac_vht40_2g = 12,
  15558. htt_phy_mode_11ac_vht80_2g = 13,
  15559. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  15560. htt_phy_mode_11ac_vht160 = 15,
  15561. htt_phy_mode_max,
  15562. };
  15563. /**
  15564. * @brief target -> host HTT channel change indication
  15565. *
  15566. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  15567. *
  15568. * @details
  15569. * Specify when a channel change occurs.
  15570. * This allows the host to precisely determine which rx frames arrived
  15571. * on the old channel and which rx frames arrived on the new channel.
  15572. *
  15573. *|31 |7 0 |
  15574. *|-------------------------------------------+----------|
  15575. *| reserved | msg type |
  15576. *|------------------------------------------------------|
  15577. *| primary_chan_center_freq_mhz |
  15578. *|------------------------------------------------------|
  15579. *| contiguous_chan1_center_freq_mhz |
  15580. *|------------------------------------------------------|
  15581. *| contiguous_chan2_center_freq_mhz |
  15582. *|------------------------------------------------------|
  15583. *| phy_mode |
  15584. *|------------------------------------------------------|
  15585. *
  15586. * Header fields:
  15587. * - MSG_TYPE
  15588. * Bits 7:0
  15589. * Purpose: identifies this as a htt channel change indication message
  15590. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  15591. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  15592. * Bits 31:0
  15593. * Purpose: identify the (center of the) new 20 MHz primary channel
  15594. * Value: center frequency of the 20 MHz primary channel, in MHz units
  15595. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  15596. * Bits 31:0
  15597. * Purpose: identify the (center of the) contiguous frequency range
  15598. * comprising the new channel.
  15599. * For example, if the new channel is a 80 MHz channel extending
  15600. * 60 MHz beyond the primary channel, this field would be 30 larger
  15601. * than the primary channel center frequency field.
  15602. * Value: center frequency of the contiguous frequency range comprising
  15603. * the full channel in MHz units
  15604. * (80+80 channels also use the CONTIG_CHAN2 field)
  15605. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  15606. * Bits 31:0
  15607. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  15608. * within a VHT 80+80 channel.
  15609. * This field is only relevant for VHT 80+80 channels.
  15610. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  15611. * channel (arbitrary value for cases besides VHT 80+80)
  15612. * - PHY_MODE
  15613. * Bits 31:0
  15614. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  15615. * and band
  15616. * Value: htt_phy_mode enum value
  15617. */
  15618. PREPACK struct htt_chan_change_t
  15619. {
  15620. /* DWORD 0: flags and meta-data */
  15621. A_UINT32
  15622. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15623. reserved1: 24;
  15624. A_UINT32 primary_chan_center_freq_mhz;
  15625. A_UINT32 contig_chan1_center_freq_mhz;
  15626. A_UINT32 contig_chan2_center_freq_mhz;
  15627. A_UINT32 phy_mode;
  15628. } POSTPACK;
  15629. /*
  15630. * Due to historical / backwards-compatibility reasons, maintain the
  15631. * below htt_chan_change_msg struct definition, which needs to be
  15632. * consistent with the above htt_chan_change_t struct definition
  15633. * (aside from the htt_chan_change_t definition including the msg_type
  15634. * dword within the message, and the htt_chan_change_msg only containing
  15635. * the payload of the message that follows the msg_type dword).
  15636. */
  15637. PREPACK struct htt_chan_change_msg {
  15638. A_UINT32 chan_mhz; /* frequency in mhz */
  15639. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  15640. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  15641. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  15642. } POSTPACK;
  15643. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  15644. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  15645. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  15646. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  15647. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  15648. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  15649. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  15650. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  15651. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  15652. do { \
  15653. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  15654. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  15655. } while (0)
  15656. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  15657. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  15658. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  15659. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  15660. do { \
  15661. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  15662. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  15663. } while (0)
  15664. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  15665. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  15666. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  15667. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  15668. do { \
  15669. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  15670. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  15671. } while (0)
  15672. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  15673. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  15674. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  15675. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  15676. do { \
  15677. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  15678. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  15679. } while (0)
  15680. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  15681. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  15682. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  15683. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  15684. /**
  15685. * @brief rx offload packet error message
  15686. *
  15687. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  15688. *
  15689. * @details
  15690. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  15691. * of target payload like mic err.
  15692. *
  15693. * |31 24|23 16|15 8|7 0|
  15694. * |----------------+----------------+----------------+----------------|
  15695. * | tid | vdev_id | msg_sub_type | msg_type |
  15696. * |-------------------------------------------------------------------|
  15697. * : (sub-type dependent content) :
  15698. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15699. * Header fields:
  15700. * - msg_type
  15701. * Bits 7:0
  15702. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  15703. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  15704. * - msg_sub_type
  15705. * Bits 15:8
  15706. * Purpose: Identifies which type of rx error is reported by this message
  15707. * value: htt_rx_ofld_pkt_err_type
  15708. * - vdev_id
  15709. * Bits 23:16
  15710. * Purpose: Identifies which vdev received the erroneous rx frame
  15711. * value:
  15712. * - tid
  15713. * Bits 31:24
  15714. * Purpose: Identifies the traffic type of the rx frame
  15715. * value:
  15716. *
  15717. * - The payload fields used if the sub-type == MIC error are shown below.
  15718. * Note - MIC err is per MSDU, while PN is per MPDU.
  15719. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  15720. * with MIC err in A-MSDU case, so FW will send only one HTT message
  15721. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  15722. * instead of sending separate HTT messages for each wrong MSDU within
  15723. * the MPDU.
  15724. *
  15725. * |31 24|23 16|15 8|7 0|
  15726. * |----------------+----------------+----------------+----------------|
  15727. * | Rsvd | key_id | peer_id |
  15728. * |-------------------------------------------------------------------|
  15729. * | receiver MAC addr 31:0 |
  15730. * |-------------------------------------------------------------------|
  15731. * | Rsvd | receiver MAC addr 47:32 |
  15732. * |-------------------------------------------------------------------|
  15733. * | transmitter MAC addr 31:0 |
  15734. * |-------------------------------------------------------------------|
  15735. * | Rsvd | transmitter MAC addr 47:32 |
  15736. * |-------------------------------------------------------------------|
  15737. * | PN 31:0 |
  15738. * |-------------------------------------------------------------------|
  15739. * | Rsvd | PN 47:32 |
  15740. * |-------------------------------------------------------------------|
  15741. * - peer_id
  15742. * Bits 15:0
  15743. * Purpose: identifies which peer is frame is from
  15744. * value:
  15745. * - key_id
  15746. * Bits 23:16
  15747. * Purpose: identifies key_id of rx frame
  15748. * value:
  15749. * - RA_31_0 (receiver MAC addr 31:0)
  15750. * Bits 31:0
  15751. * Purpose: identifies by MAC address which vdev received the frame
  15752. * value: MAC address lower 4 bytes
  15753. * - RA_47_32 (receiver MAC addr 47:32)
  15754. * Bits 15:0
  15755. * Purpose: identifies by MAC address which vdev received the frame
  15756. * value: MAC address upper 2 bytes
  15757. * - TA_31_0 (transmitter MAC addr 31:0)
  15758. * Bits 31:0
  15759. * Purpose: identifies by MAC address which peer transmitted the frame
  15760. * value: MAC address lower 4 bytes
  15761. * - TA_47_32 (transmitter MAC addr 47:32)
  15762. * Bits 15:0
  15763. * Purpose: identifies by MAC address which peer transmitted the frame
  15764. * value: MAC address upper 2 bytes
  15765. * - PN_31_0
  15766. * Bits 31:0
  15767. * Purpose: Identifies pn of rx frame
  15768. * value: PN lower 4 bytes
  15769. * - PN_47_32
  15770. * Bits 15:0
  15771. * Purpose: Identifies pn of rx frame
  15772. * value:
  15773. * TKIP or CCMP: PN upper 2 bytes
  15774. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  15775. */
  15776. enum htt_rx_ofld_pkt_err_type {
  15777. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  15778. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  15779. };
  15780. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  15781. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  15782. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  15783. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  15784. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  15785. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  15786. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  15787. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  15788. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  15789. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  15790. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  15791. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  15792. do { \
  15793. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  15794. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  15795. } while (0)
  15796. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  15797. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  15798. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  15799. do { \
  15800. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  15801. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  15802. } while (0)
  15803. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  15804. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  15805. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  15806. do { \
  15807. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  15808. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  15809. } while (0)
  15810. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  15811. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  15812. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  15813. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  15814. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  15815. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  15816. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  15817. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  15818. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  15819. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  15820. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  15821. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  15822. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  15823. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  15824. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  15825. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  15826. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  15827. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  15828. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  15829. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  15830. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  15831. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  15832. do { \
  15833. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  15834. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  15835. } while (0)
  15836. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  15837. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  15838. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  15839. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  15840. do { \
  15841. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  15842. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  15843. } while (0)
  15844. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  15845. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  15846. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  15847. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  15848. do { \
  15849. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  15850. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  15851. } while (0)
  15852. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  15853. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  15854. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  15855. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  15856. do { \
  15857. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  15858. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  15859. } while (0)
  15860. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  15861. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  15862. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  15863. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  15864. do { \
  15865. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  15866. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  15867. } while (0)
  15868. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  15869. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  15870. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  15871. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  15872. do { \
  15873. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  15874. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  15875. } while (0)
  15876. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  15877. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  15878. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  15879. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  15880. do { \
  15881. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  15882. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  15883. } while (0)
  15884. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  15885. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  15886. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  15887. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  15888. do { \
  15889. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  15890. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  15891. } while (0)
  15892. /**
  15893. * @brief target -> host peer rate report message
  15894. *
  15895. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  15896. *
  15897. * @details
  15898. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  15899. * justified rate of all the peers.
  15900. *
  15901. * |31 24|23 16|15 8|7 0|
  15902. * |----------------+----------------+----------------+----------------|
  15903. * | peer_count | | msg_type |
  15904. * |-------------------------------------------------------------------|
  15905. * : Payload (variant number of peer rate report) :
  15906. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15907. * Header fields:
  15908. * - msg_type
  15909. * Bits 7:0
  15910. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  15911. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  15912. * - reserved
  15913. * Bits 15:8
  15914. * Purpose:
  15915. * value:
  15916. * - peer_count
  15917. * Bits 31:16
  15918. * Purpose: Specify how many peer rate report elements are present in the payload.
  15919. * value:
  15920. *
  15921. * Payload:
  15922. * There are variant number of peer rate report follow the first 32 bits.
  15923. * The peer rate report is defined as follows.
  15924. *
  15925. * |31 20|19 16|15 0|
  15926. * |-----------------------+---------+---------------------------------|-
  15927. * | reserved | phy | peer_id | \
  15928. * |-------------------------------------------------------------------| -> report #0
  15929. * | rate | /
  15930. * |-----------------------+---------+---------------------------------|-
  15931. * | reserved | phy | peer_id | \
  15932. * |-------------------------------------------------------------------| -> report #1
  15933. * | rate | /
  15934. * |-----------------------+---------+---------------------------------|-
  15935. * | reserved | phy | peer_id | \
  15936. * |-------------------------------------------------------------------| -> report #2
  15937. * | rate | /
  15938. * |-------------------------------------------------------------------|-
  15939. * : :
  15940. * : :
  15941. * : :
  15942. * :-------------------------------------------------------------------:
  15943. *
  15944. * - peer_id
  15945. * Bits 15:0
  15946. * Purpose: identify the peer
  15947. * value:
  15948. * - phy
  15949. * Bits 19:16
  15950. * Purpose: identify which phy is in use
  15951. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  15952. * Please see enum htt_peer_report_phy_type for detail.
  15953. * - reserved
  15954. * Bits 31:20
  15955. * Purpose:
  15956. * value:
  15957. * - rate
  15958. * Bits 31:0
  15959. * Purpose: represent the justified rate of the peer specified by peer_id
  15960. * value:
  15961. */
  15962. enum htt_peer_rate_report_phy_type {
  15963. HTT_PEER_RATE_REPORT_11B = 0,
  15964. HTT_PEER_RATE_REPORT_11A_G,
  15965. HTT_PEER_RATE_REPORT_11N,
  15966. HTT_PEER_RATE_REPORT_11AC,
  15967. };
  15968. #define HTT_PEER_RATE_REPORT_SIZE 8
  15969. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  15970. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  15971. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  15972. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  15973. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  15974. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  15975. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  15976. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  15977. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  15978. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  15979. do { \
  15980. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  15981. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  15982. } while (0)
  15983. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  15984. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  15985. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  15986. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  15987. do { \
  15988. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  15989. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  15990. } while (0)
  15991. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  15992. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  15993. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  15994. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  15995. do { \
  15996. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  15997. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  15998. } while (0)
  15999. /**
  16000. * @brief target -> host flow pool map message
  16001. *
  16002. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  16003. *
  16004. * @details
  16005. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  16006. * a flow of descriptors.
  16007. *
  16008. * This message is in TLV format and indicates the parameters to be setup a
  16009. * flow in the host. Each entry indicates that a particular flow ID is ready to
  16010. * receive descriptors from a specified pool.
  16011. *
  16012. * The message would appear as follows:
  16013. *
  16014. * |31 24|23 16|15 8|7 0|
  16015. * |----------------+----------------+----------------+----------------|
  16016. * header | reserved | num_flows | msg_type |
  16017. * |-------------------------------------------------------------------|
  16018. * | |
  16019. * : payload :
  16020. * | |
  16021. * |-------------------------------------------------------------------|
  16022. *
  16023. * The header field is one DWORD long and is interpreted as follows:
  16024. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  16025. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  16026. * this message
  16027. * b'16-31 - reserved: These bits are reserved for future use
  16028. *
  16029. * Payload:
  16030. * The payload would contain multiple objects of the following structure. Each
  16031. * object represents a flow.
  16032. *
  16033. * |31 24|23 16|15 8|7 0|
  16034. * |----------------+----------------+----------------+----------------|
  16035. * header | reserved | num_flows | msg_type |
  16036. * |-------------------------------------------------------------------|
  16037. * payload0| flow_type |
  16038. * |-------------------------------------------------------------------|
  16039. * | flow_id |
  16040. * |-------------------------------------------------------------------|
  16041. * | reserved0 | flow_pool_id |
  16042. * |-------------------------------------------------------------------|
  16043. * | reserved1 | flow_pool_size |
  16044. * |-------------------------------------------------------------------|
  16045. * | reserved2 |
  16046. * |-------------------------------------------------------------------|
  16047. * payload1| flow_type |
  16048. * |-------------------------------------------------------------------|
  16049. * | flow_id |
  16050. * |-------------------------------------------------------------------|
  16051. * | reserved0 | flow_pool_id |
  16052. * |-------------------------------------------------------------------|
  16053. * | reserved1 | flow_pool_size |
  16054. * |-------------------------------------------------------------------|
  16055. * | reserved2 |
  16056. * |-------------------------------------------------------------------|
  16057. * | . |
  16058. * | . |
  16059. * | . |
  16060. * |-------------------------------------------------------------------|
  16061. *
  16062. * Each payload is 5 DWORDS long and is interpreted as follows:
  16063. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  16064. * this flow is associated. It can be VDEV, peer,
  16065. * or tid (AC). Based on enum htt_flow_type.
  16066. *
  16067. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  16068. * object. For flow_type vdev it is set to the
  16069. * vdevid, for peer it is peerid and for tid, it is
  16070. * tid_num.
  16071. *
  16072. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  16073. * in the host for this flow
  16074. * b'16:31 - reserved0: This field in reserved for the future. In case
  16075. * we have a hierarchical implementation (HCM) of
  16076. * pools, it can be used to indicate the ID of the
  16077. * parent-pool.
  16078. *
  16079. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  16080. * Descriptors for this flow will be
  16081. * allocated from this pool in the host.
  16082. * b'16:31 - reserved1: This field in reserved for the future. In case
  16083. * we have a hierarchical implementation of pools,
  16084. * it can be used to indicate the max number of
  16085. * descriptors in the pool. The b'0:15 can be used
  16086. * to indicate min number of descriptors in the
  16087. * HCM scheme.
  16088. *
  16089. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  16090. * we have a hierarchical implementation of pools,
  16091. * b'0:15 can be used to indicate the
  16092. * priority-based borrowing (PBB) threshold of
  16093. * the flow's pool. The b'16:31 are still left
  16094. * reserved.
  16095. */
  16096. enum htt_flow_type {
  16097. FLOW_TYPE_VDEV = 0,
  16098. /* Insert new flow types above this line */
  16099. };
  16100. PREPACK struct htt_flow_pool_map_payload_t {
  16101. A_UINT32 flow_type;
  16102. A_UINT32 flow_id;
  16103. A_UINT32 flow_pool_id:16,
  16104. reserved0:16;
  16105. A_UINT32 flow_pool_size:16,
  16106. reserved1:16;
  16107. A_UINT32 reserved2;
  16108. } POSTPACK;
  16109. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  16110. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  16111. (sizeof(struct htt_flow_pool_map_payload_t))
  16112. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  16113. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  16114. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  16115. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  16116. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  16117. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  16118. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  16119. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  16120. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  16121. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  16122. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  16123. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  16124. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  16125. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  16126. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  16127. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  16128. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  16129. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  16130. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  16131. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  16132. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  16133. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  16134. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  16135. do { \
  16136. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  16137. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  16138. } while (0)
  16139. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  16140. do { \
  16141. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  16142. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  16143. } while (0)
  16144. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  16145. do { \
  16146. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  16147. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  16148. } while (0)
  16149. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  16150. do { \
  16151. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  16152. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  16153. } while (0)
  16154. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  16155. do { \
  16156. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  16157. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  16158. } while (0)
  16159. /**
  16160. * @brief target -> host flow pool unmap message
  16161. *
  16162. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  16163. *
  16164. * @details
  16165. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  16166. * down a flow of descriptors.
  16167. * This message indicates that for the flow (whose ID is provided) is wanting
  16168. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  16169. * pool of descriptors from where descriptors are being allocated for this
  16170. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  16171. * be unmapped by the host.
  16172. *
  16173. * The message would appear as follows:
  16174. *
  16175. * |31 24|23 16|15 8|7 0|
  16176. * |----------------+----------------+----------------+----------------|
  16177. * | reserved0 | msg_type |
  16178. * |-------------------------------------------------------------------|
  16179. * | flow_type |
  16180. * |-------------------------------------------------------------------|
  16181. * | flow_id |
  16182. * |-------------------------------------------------------------------|
  16183. * | reserved1 | flow_pool_id |
  16184. * |-------------------------------------------------------------------|
  16185. *
  16186. * The message is interpreted as follows:
  16187. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  16188. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  16189. * b'8:31 - reserved0: Reserved for future use
  16190. *
  16191. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  16192. * this flow is associated. It can be VDEV, peer,
  16193. * or tid (AC). Based on enum htt_flow_type.
  16194. *
  16195. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  16196. * object. For flow_type vdev it is set to the
  16197. * vdevid, for peer it is peerid and for tid, it is
  16198. * tid_num.
  16199. *
  16200. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  16201. * used in the host for this flow
  16202. * b'16:31 - reserved0: This field in reserved for the future.
  16203. *
  16204. */
  16205. PREPACK struct htt_flow_pool_unmap_t {
  16206. A_UINT32 msg_type:8,
  16207. reserved0:24;
  16208. A_UINT32 flow_type;
  16209. A_UINT32 flow_id;
  16210. A_UINT32 flow_pool_id:16,
  16211. reserved1:16;
  16212. } POSTPACK;
  16213. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  16214. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  16215. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  16216. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  16217. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  16218. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  16219. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  16220. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  16221. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  16222. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  16223. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  16224. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  16225. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  16226. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  16227. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  16228. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  16229. do { \
  16230. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  16231. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  16232. } while (0)
  16233. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  16234. do { \
  16235. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  16236. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  16237. } while (0)
  16238. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  16239. do { \
  16240. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  16241. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  16242. } while (0)
  16243. /**
  16244. * @brief target -> host SRING setup done message
  16245. *
  16246. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  16247. *
  16248. * @details
  16249. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  16250. * SRNG ring setup is done
  16251. *
  16252. * This message indicates whether the last setup operation is successful.
  16253. * It will be sent to host when host set respose_required bit in
  16254. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  16255. * The message would appear as follows:
  16256. *
  16257. * |31 24|23 16|15 8|7 0|
  16258. * |--------------- +----------------+----------------+----------------|
  16259. * | setup_status | ring_id | pdev_id | msg_type |
  16260. * |-------------------------------------------------------------------|
  16261. *
  16262. * The message is interpreted as follows:
  16263. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  16264. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  16265. * b'8:15 - pdev_id:
  16266. * 0 (for rings at SOC/UMAC level),
  16267. * 1/2/3 mac id (for rings at LMAC level)
  16268. * b'16:23 - ring_id: Identify the ring which is set up
  16269. * More details can be got from enum htt_srng_ring_id
  16270. * b'24:31 - setup_status: Indicate status of setup operation
  16271. * Refer to htt_ring_setup_status
  16272. */
  16273. PREPACK struct htt_sring_setup_done_t {
  16274. A_UINT32 msg_type: 8,
  16275. pdev_id: 8,
  16276. ring_id: 8,
  16277. setup_status: 8;
  16278. } POSTPACK;
  16279. enum htt_ring_setup_status {
  16280. htt_ring_setup_status_ok = 0,
  16281. htt_ring_setup_status_error,
  16282. };
  16283. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  16284. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  16285. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  16286. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  16287. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  16288. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  16289. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  16290. do { \
  16291. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  16292. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16293. } while (0)
  16294. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  16295. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  16296. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  16297. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  16298. HTT_SRING_SETUP_DONE_RING_ID_S)
  16299. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  16300. do { \
  16301. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  16302. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  16303. } while (0)
  16304. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  16305. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  16306. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  16307. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  16308. HTT_SRING_SETUP_DONE_STATUS_S)
  16309. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  16310. do { \
  16311. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  16312. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  16313. } while (0)
  16314. /**
  16315. * @brief target -> flow map flow info
  16316. *
  16317. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  16318. *
  16319. * @details
  16320. * HTT TX map flow entry with tqm flow pointer
  16321. * Sent from firmware to host to add tqm flow pointer in corresponding
  16322. * flow search entry. Flow metadata is replayed back to host as part of this
  16323. * struct to enable host to find the specific flow search entry
  16324. *
  16325. * The message would appear as follows:
  16326. *
  16327. * |31 28|27 18|17 14|13 8|7 0|
  16328. * |-------+------------------------------------------+----------------|
  16329. * | rsvd0 | fse_hsh_idx | msg_type |
  16330. * |-------------------------------------------------------------------|
  16331. * | rsvd1 | tid | peer_id |
  16332. * |-------------------------------------------------------------------|
  16333. * | tqm_flow_pntr_lo |
  16334. * |-------------------------------------------------------------------|
  16335. * | tqm_flow_pntr_hi |
  16336. * |-------------------------------------------------------------------|
  16337. * | fse_meta_data |
  16338. * |-------------------------------------------------------------------|
  16339. *
  16340. * The message is interpreted as follows:
  16341. *
  16342. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  16343. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  16344. *
  16345. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  16346. * for this flow entry
  16347. *
  16348. * dword0 - b'28:31 - rsvd0: Reserved for future use
  16349. *
  16350. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  16351. *
  16352. * dword1 - b'14:17 - tid
  16353. *
  16354. * dword1 - b'18:31 - rsvd1: Reserved for future use
  16355. *
  16356. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  16357. *
  16358. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  16359. *
  16360. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  16361. * given by host
  16362. */
  16363. PREPACK struct htt_tx_map_flow_info {
  16364. A_UINT32
  16365. msg_type: 8,
  16366. fse_hsh_idx: 20,
  16367. rsvd0: 4;
  16368. A_UINT32
  16369. peer_id: 14,
  16370. tid: 4,
  16371. rsvd1: 14;
  16372. A_UINT32 tqm_flow_pntr_lo;
  16373. A_UINT32 tqm_flow_pntr_hi;
  16374. struct htt_tx_flow_metadata fse_meta_data;
  16375. } POSTPACK;
  16376. /* DWORD 0 */
  16377. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  16378. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  16379. /* DWORD 1 */
  16380. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  16381. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  16382. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  16383. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  16384. /* DWORD 0 */
  16385. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  16386. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  16387. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  16388. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  16389. do { \
  16390. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  16391. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  16392. } while (0)
  16393. /* DWORD 1 */
  16394. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  16395. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  16396. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  16397. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  16398. do { \
  16399. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  16400. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  16401. } while (0)
  16402. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  16403. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  16404. HTT_TX_MAP_FLOW_INFO_TID_S)
  16405. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  16406. do { \
  16407. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  16408. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  16409. } while (0)
  16410. /*
  16411. * htt_dbg_ext_stats_status -
  16412. * present - The requested stats have been delivered in full.
  16413. * This indicates that either the stats information was contained
  16414. * in its entirety within this message, or else this message
  16415. * completes the delivery of the requested stats info that was
  16416. * partially delivered through earlier STATS_CONF messages.
  16417. * partial - The requested stats have been delivered in part.
  16418. * One or more subsequent STATS_CONF messages with the same
  16419. * cookie value will be sent to deliver the remainder of the
  16420. * information.
  16421. * error - The requested stats could not be delivered, for example due
  16422. * to a shortage of memory to construct a message holding the
  16423. * requested stats.
  16424. * invalid - The requested stat type is either not recognized, or the
  16425. * target is configured to not gather the stats type in question.
  16426. */
  16427. enum htt_dbg_ext_stats_status {
  16428. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  16429. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  16430. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  16431. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  16432. };
  16433. /**
  16434. * @brief target -> host ppdu stats upload
  16435. *
  16436. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  16437. *
  16438. * @details
  16439. * The following field definitions describe the format of the HTT target
  16440. * to host ppdu stats indication message.
  16441. *
  16442. *
  16443. * |31 24|23 16|15 12|11 10|9 8|7 0 |
  16444. * |-----------------------------+-------+-------+--------+---------------|
  16445. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  16446. * |-------------+---------------+-------+-------+--------+---------------|
  16447. * | tgt_private | ppdu_id |
  16448. * |-------------+--------------------------------------------------------|
  16449. * | Timestamp in us |
  16450. * |----------------------------------------------------------------------|
  16451. * | reserved |
  16452. * |----------------------------------------------------------------------|
  16453. * | type-specific stats info |
  16454. * | (see htt_ppdu_stats.h) |
  16455. * |----------------------------------------------------------------------|
  16456. * Header fields:
  16457. * - MSG_TYPE
  16458. * Bits 7:0
  16459. * Purpose: Identifies this is a PPDU STATS indication
  16460. * message.
  16461. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  16462. * - mac_id
  16463. * Bits 9:8
  16464. * Purpose: mac_id of this ppdu_id
  16465. * Value: 0-3
  16466. * - pdev_id
  16467. * Bits 11:10
  16468. * Purpose: pdev_id of this ppdu_id
  16469. * Value: 0-3
  16470. * 0 (for rings at SOC level),
  16471. * 1/2/3 PDEV -> 0/1/2
  16472. * - payload_size
  16473. * Bits 31:16
  16474. * Purpose: total tlv size
  16475. * Value: payload_size in bytes
  16476. */
  16477. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  16478. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  16479. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  16480. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  16481. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  16482. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  16483. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  16484. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0x00FFFFFF
  16485. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  16486. /* bits 31:24 are used by the target for internal purposes */
  16487. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  16488. do { \
  16489. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  16490. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  16491. } while (0)
  16492. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  16493. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  16494. HTT_T2H_PPDU_STATS_MAC_ID_S)
  16495. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  16496. do { \
  16497. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  16498. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  16499. } while (0)
  16500. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  16501. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  16502. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  16503. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  16504. do { \
  16505. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  16506. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  16507. } while (0)
  16508. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  16509. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  16510. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  16511. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  16512. do { \
  16513. /*HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value);*/ \
  16514. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  16515. } while (0)
  16516. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  16517. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  16518. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  16519. /* htt_t2h_ppdu_stats_ind_hdr_t
  16520. * This struct contains the fields within the header of the
  16521. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  16522. * stats info.
  16523. * This struct assumes little-endian layout, and thus is only
  16524. * suitable for use within processors known to be little-endian
  16525. * (such as the target).
  16526. * In contrast, the above macros provide endian-portable methods
  16527. * to get and set the bitfields within this PPDU_STATS_IND header.
  16528. */
  16529. typedef struct {
  16530. A_UINT32 msg_type: 8, /* bits 7:0 */
  16531. mac_id: 2, /* bits 9:8 */
  16532. pdev_id: 2, /* bits 11:10 */
  16533. reserved1: 4, /* bits 15:12 */
  16534. payload_size: 16; /* bits 31:16 */
  16535. A_UINT32 ppdu_id;
  16536. A_UINT32 timestamp_us;
  16537. A_UINT32 reserved2;
  16538. } htt_t2h_ppdu_stats_ind_hdr_t;
  16539. /**
  16540. * @brief target -> host extended statistics upload
  16541. *
  16542. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  16543. *
  16544. * @details
  16545. * The following field definitions describe the format of the HTT target
  16546. * to host stats upload confirmation message.
  16547. * The message contains a cookie echoed from the HTT host->target stats
  16548. * upload request, which identifies which request the confirmation is
  16549. * for, and a single stats can span over multiple HTT stats indication
  16550. * due to the HTT message size limitation so every HTT ext stats indication
  16551. * will have tag-length-value stats information elements.
  16552. * The tag-length header for each HTT stats IND message also includes a
  16553. * status field, to indicate whether the request for the stat type in
  16554. * question was fully met, partially met, unable to be met, or invalid
  16555. * (if the stat type in question is disabled in the target).
  16556. * A Done bit 1's indicate the end of the of stats info elements.
  16557. *
  16558. *
  16559. * |31 16|15 12|11|10 8|7 5|4 0|
  16560. * |--------------------------------------------------------------|
  16561. * | reserved | msg type |
  16562. * |--------------------------------------------------------------|
  16563. * | cookie LSBs |
  16564. * |--------------------------------------------------------------|
  16565. * | cookie MSBs |
  16566. * |--------------------------------------------------------------|
  16567. * | stats entry length | rsvd | D| S | stat type |
  16568. * |--------------------------------------------------------------|
  16569. * | type-specific stats info |
  16570. * | (see htt_stats.h) |
  16571. * |--------------------------------------------------------------|
  16572. * Header fields:
  16573. * - MSG_TYPE
  16574. * Bits 7:0
  16575. * Purpose: Identifies this is a extended statistics upload confirmation
  16576. * message.
  16577. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  16578. * - COOKIE_LSBS
  16579. * Bits 31:0
  16580. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16581. * message with its preceding host->target stats request message.
  16582. * Value: LSBs of the opaque cookie specified by the host-side requestor
  16583. * - COOKIE_MSBS
  16584. * Bits 31:0
  16585. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16586. * message with its preceding host->target stats request message.
  16587. * Value: MSBs of the opaque cookie specified by the host-side requestor
  16588. *
  16589. * Stats Information Element tag-length header fields:
  16590. * - STAT_TYPE
  16591. * Bits 7:0
  16592. * Purpose: identifies the type of statistics info held in the
  16593. * following information element
  16594. * Value: htt_dbg_ext_stats_type
  16595. * - STATUS
  16596. * Bits 10:8
  16597. * Purpose: indicate whether the requested stats are present
  16598. * Value: htt_dbg_ext_stats_status
  16599. * - DONE
  16600. * Bits 11
  16601. * Purpose:
  16602. * Indicates the completion of the stats entry, this will be the last
  16603. * stats conf HTT segment for the requested stats type.
  16604. * Value:
  16605. * 0 -> the stats retrieval is ongoing
  16606. * 1 -> the stats retrieval is complete
  16607. * - LENGTH
  16608. * Bits 31:16
  16609. * Purpose: indicate the stats information size
  16610. * Value: This field specifies the number of bytes of stats information
  16611. * that follows the element tag-length header.
  16612. * It is expected but not required that this length is a multiple of
  16613. * 4 bytes.
  16614. */
  16615. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  16616. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  16617. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  16618. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  16619. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  16620. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  16621. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  16622. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  16623. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  16624. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  16625. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  16626. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  16627. do { \
  16628. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  16629. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  16630. } while (0)
  16631. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  16632. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  16633. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  16634. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  16635. do { \
  16636. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  16637. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  16638. } while (0)
  16639. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  16640. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  16641. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  16642. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  16643. do { \
  16644. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  16645. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  16646. } while (0)
  16647. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  16648. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  16649. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  16650. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  16651. do { \
  16652. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  16653. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  16654. } while (0)
  16655. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  16656. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  16657. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  16658. /**
  16659. * @brief target -> host streaming statistics upload
  16660. *
  16661. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  16662. *
  16663. * @details
  16664. * The following field definitions describe the format of the HTT target
  16665. * to host streaming stats upload indication message.
  16666. * The host can use a STREAMING_STATS_REQ message to enable the target to
  16667. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  16668. * use the STREAMING_STATS_REQ message to halt the target's production of
  16669. * STREAMING_STATS_IND messages.
  16670. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  16671. * the stats enabled by the host's STREAMING_STATS_REQ message.
  16672. *
  16673. * |31 8|7 0|
  16674. * |--------------------------------------------------------------|
  16675. * | reserved | msg type |
  16676. * |--------------------------------------------------------------|
  16677. * | type-specific stats info |
  16678. * | (see htt_stats.h) |
  16679. * |--------------------------------------------------------------|
  16680. * Header fields:
  16681. * - MSG_TYPE
  16682. * Bits 7:0
  16683. * Purpose: Identifies this as a streaming statistics upload indication
  16684. * message.
  16685. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  16686. */
  16687. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  16688. typedef enum {
  16689. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  16690. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  16691. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  16692. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  16693. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  16694. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  16695. /* Reserved from 128 - 255 for target internal use.*/
  16696. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  16697. } HTT_PEER_TYPE;
  16698. /** macro to convert MAC address from char array to HTT word format */
  16699. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  16700. (phtt_mac_addr)->mac_addr31to0 = \
  16701. (((c_macaddr)[0] << 0) | \
  16702. ((c_macaddr)[1] << 8) | \
  16703. ((c_macaddr)[2] << 16) | \
  16704. ((c_macaddr)[3] << 24)); \
  16705. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  16706. } while (0)
  16707. /**
  16708. * @brief target -> host monitor mac header indication message
  16709. *
  16710. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  16711. *
  16712. * @details
  16713. * The following diagram shows the format of the monitor mac header message
  16714. * sent from the target to the host.
  16715. * This message is primarily sent when promiscuous rx mode is enabled.
  16716. * One message is sent per rx PPDU.
  16717. *
  16718. * |31 24|23 16|15 8|7 0|
  16719. * |-------------------------------------------------------------|
  16720. * | peer_id | reserved0 | msg_type |
  16721. * |-------------------------------------------------------------|
  16722. * | reserved1 | num_mpdu |
  16723. * |-------------------------------------------------------------|
  16724. * | struct hw_rx_desc |
  16725. * | (see wal_rx_desc.h) |
  16726. * |-------------------------------------------------------------|
  16727. * | struct ieee80211_frame_addr4 |
  16728. * | (see ieee80211_defs.h) |
  16729. * |-------------------------------------------------------------|
  16730. * | struct ieee80211_frame_addr4 |
  16731. * | (see ieee80211_defs.h) |
  16732. * |-------------------------------------------------------------|
  16733. * | ...... |
  16734. * |-------------------------------------------------------------|
  16735. *
  16736. * Header fields:
  16737. * - msg_type
  16738. * Bits 7:0
  16739. * Purpose: Identifies this is a monitor mac header indication message.
  16740. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  16741. * - peer_id
  16742. * Bits 31:16
  16743. * Purpose: Software peer id given by host during association,
  16744. * During promiscuous mode, the peer ID will be invalid (0xFF)
  16745. * for rx PPDUs received from unassociated peers.
  16746. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  16747. * - num_mpdu
  16748. * Bits 15:0
  16749. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  16750. * delivered within the message.
  16751. * Value: 1 to 32
  16752. * num_mpdu is limited to a maximum value of 32, due to buffer
  16753. * size limits. For PPDUs with more than 32 MPDUs, only the
  16754. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  16755. * the PPDU will be provided.
  16756. */
  16757. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  16758. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  16759. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  16760. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  16761. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  16762. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  16763. do { \
  16764. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  16765. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  16766. } while (0)
  16767. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  16768. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  16769. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  16770. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  16771. do { \
  16772. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  16773. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  16774. } while (0)
  16775. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  16776. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  16777. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  16778. /**
  16779. * @brief target -> host flow pool resize Message
  16780. *
  16781. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  16782. *
  16783. * @details
  16784. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  16785. * the flow pool associated with the specified ID is resized
  16786. *
  16787. * The message would appear as follows:
  16788. *
  16789. * |31 16|15 8|7 0|
  16790. * |---------------------------------+----------------+----------------|
  16791. * | reserved0 | Msg type |
  16792. * |-------------------------------------------------------------------|
  16793. * | flow pool new size | flow pool ID |
  16794. * |-------------------------------------------------------------------|
  16795. *
  16796. * The message is interpreted as follows:
  16797. * b'0:7 - msg_type: This will be set to 0x21
  16798. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  16799. *
  16800. * b'0:15 - flow pool ID: Existing flow pool ID
  16801. *
  16802. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  16803. *
  16804. */
  16805. PREPACK struct htt_flow_pool_resize_t {
  16806. A_UINT32 msg_type:8,
  16807. reserved0:24;
  16808. A_UINT32 flow_pool_id:16,
  16809. flow_pool_new_size:16;
  16810. } POSTPACK;
  16811. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  16812. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  16813. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  16814. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  16815. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  16816. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  16817. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  16818. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  16819. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  16820. do { \
  16821. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  16822. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  16823. } while (0)
  16824. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  16825. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  16826. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  16827. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  16828. do { \
  16829. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  16830. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  16831. } while (0)
  16832. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  16833. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  16834. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  16835. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  16836. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  16837. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  16838. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  16839. /*
  16840. * The read and write indices point to the data within the host buffer.
  16841. * Because the first 4 bytes of the host buffer is used for the read index and
  16842. * the next 4 bytes for the write index, the data itself starts at offset 8.
  16843. * The read index and write index are the byte offsets from the base of the
  16844. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  16845. * Refer the ASCII text picture below.
  16846. */
  16847. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  16848. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  16849. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  16850. /*
  16851. ***************************************************************************
  16852. *
  16853. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16854. *
  16855. ***************************************************************************
  16856. *
  16857. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  16858. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  16859. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  16860. * written into the Host memory region mentioned below.
  16861. *
  16862. * Read index is updated by the Host. At any point of time, the read index will
  16863. * indicate the index that will next be read by the Host. The read index is
  16864. * in units of bytes offset from the base of the meta-data buffer.
  16865. *
  16866. * Write index is updated by the FW. At any point of time, the write index will
  16867. * indicate from where the FW can start writing any new data. The write index is
  16868. * in units of bytes offset from the base of the meta-data buffer.
  16869. *
  16870. * If the Host is not fast enough in reading the CFR data, any new capture data
  16871. * would be dropped if there is no space left to write the new captures.
  16872. *
  16873. * The last 4 bytes of the memory region will have the magic pattern
  16874. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  16875. * not overrun the host buffer.
  16876. *
  16877. * ,--------------------. read and write indices store the
  16878. * | | byte offset from the base of the
  16879. * | ,--------+--------. meta-data buffer to the next
  16880. * | | | | location within the data buffer
  16881. * | | v v that will be read / written
  16882. * ************************************************************************
  16883. * * Read * Write * * Magic *
  16884. * * index * index * CFR data1 ...... CFR data N * pattern *
  16885. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  16886. * ************************************************************************
  16887. * |<---------- data buffer ---------->|
  16888. *
  16889. * |<----------------- meta-data buffer allocated in Host ----------------|
  16890. *
  16891. * Note:
  16892. * - Considering the 4 bytes needed to store the Read index (R) and the
  16893. * Write index (W), the initial value is as follows:
  16894. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  16895. * - Buffer empty condition:
  16896. * R = W
  16897. *
  16898. * Regarding CFR data format:
  16899. * --------------------------
  16900. *
  16901. * Each CFR tone is stored in HW as 16-bits with the following format:
  16902. * {bits[15:12], bits[11:6], bits[5:0]} =
  16903. * {unsigned exponent (4 bits),
  16904. * signed mantissa_real (6 bits),
  16905. * signed mantissa_imag (6 bits)}
  16906. *
  16907. * CFR_real = mantissa_real * 2^(exponent-5)
  16908. * CFR_imag = mantissa_imag * 2^(exponent-5)
  16909. *
  16910. *
  16911. * The CFR data is written to the 16-bit unsigned output array (buff) in
  16912. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  16913. *
  16914. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  16915. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  16916. * .
  16917. * .
  16918. * .
  16919. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  16920. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  16921. */
  16922. /* Bandwidth of peer CFR captures */
  16923. typedef enum {
  16924. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  16925. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  16926. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  16927. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  16928. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  16929. HTT_PEER_CFR_CAPTURE_BW_MAX,
  16930. } HTT_PEER_CFR_CAPTURE_BW;
  16931. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  16932. * was captured
  16933. */
  16934. typedef enum {
  16935. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  16936. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  16937. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  16938. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  16939. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  16940. } HTT_PEER_CFR_CAPTURE_MODE;
  16941. typedef enum {
  16942. /* This message type is currently used for the below purpose:
  16943. *
  16944. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  16945. * wmi_peer_cfr_capture_cmd.
  16946. * If payload_present bit is set to 0 then the associated memory region
  16947. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  16948. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  16949. * message; the CFR dump will be present at the end of the message,
  16950. * after the chan_phy_mode.
  16951. */
  16952. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  16953. /* Always keep this last */
  16954. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  16955. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  16956. /**
  16957. * @brief target -> host CFR dump completion indication message definition
  16958. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  16959. *
  16960. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  16961. *
  16962. * @details
  16963. * The following diagram shows the format of the Channel Frequency Response
  16964. * (CFR) dump completion indication. This inidcation is sent to the Host when
  16965. * the channel capture of a peer is copied by Firmware into the Host memory
  16966. *
  16967. * **************************************************************************
  16968. *
  16969. * Message format when the CFR capture message type is
  16970. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16971. *
  16972. * **************************************************************************
  16973. *
  16974. * |31 16|15 |8|7 0|
  16975. * |----------------------------------------------------------------|
  16976. * header: | reserved |P| msg_type |
  16977. * word 0 | | | |
  16978. * |----------------------------------------------------------------|
  16979. * payload: | cfr_capture_msg_type |
  16980. * word 1 | |
  16981. * |----------------------------------------------------------------|
  16982. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  16983. * word 2 | | | | | | | | |
  16984. * |----------------------------------------------------------------|
  16985. * | mac_addr31to0 |
  16986. * word 3 | |
  16987. * |----------------------------------------------------------------|
  16988. * | unused / reserved | mac_addr47to32 |
  16989. * word 4 | | |
  16990. * |----------------------------------------------------------------|
  16991. * | index |
  16992. * word 5 | |
  16993. * |----------------------------------------------------------------|
  16994. * | length |
  16995. * word 6 | |
  16996. * |----------------------------------------------------------------|
  16997. * | timestamp |
  16998. * word 7 | |
  16999. * |----------------------------------------------------------------|
  17000. * | counter |
  17001. * word 8 | |
  17002. * |----------------------------------------------------------------|
  17003. * | chan_mhz |
  17004. * word 9 | |
  17005. * |----------------------------------------------------------------|
  17006. * | band_center_freq1 |
  17007. * word 10 | |
  17008. * |----------------------------------------------------------------|
  17009. * | band_center_freq2 |
  17010. * word 11 | |
  17011. * |----------------------------------------------------------------|
  17012. * | chan_phy_mode |
  17013. * word 12 | |
  17014. * |----------------------------------------------------------------|
  17015. * where,
  17016. * P - payload present bit (payload_present explained below)
  17017. * req_id - memory request id (mem_req_id explained below)
  17018. * S - status field (status explained below)
  17019. * capbw - capture bandwidth (capture_bw explained below)
  17020. * mode - mode of capture (mode explained below)
  17021. * sts - space time streams (sts_count explained below)
  17022. * chbw - channel bandwidth (channel_bw explained below)
  17023. * captype - capture type (cap_type explained below)
  17024. *
  17025. * The following field definitions describe the format of the CFR dump
  17026. * completion indication sent from the target to the host
  17027. *
  17028. * Header fields:
  17029. *
  17030. * Word 0
  17031. * - msg_type
  17032. * Bits 7:0
  17033. * Purpose: Identifies this as CFR TX completion indication
  17034. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  17035. * - payload_present
  17036. * Bit 8
  17037. * Purpose: Identifies how CFR data is sent to host
  17038. * Value: 0 - If CFR Payload is written to host memory
  17039. * 1 - If CFR Payload is sent as part of HTT message
  17040. * (This is the requirement for SDIO/USB where it is
  17041. * not possible to write CFR data to host memory)
  17042. * - reserved
  17043. * Bits 31:9
  17044. * Purpose: Reserved
  17045. * Value: 0
  17046. *
  17047. * Payload fields:
  17048. *
  17049. * Word 1
  17050. * - cfr_capture_msg_type
  17051. * Bits 31:0
  17052. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  17053. * to specify the format used for the remainder of the message
  17054. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  17055. * (currently only MSG_TYPE_1 is defined)
  17056. *
  17057. * Word 2
  17058. * - mem_req_id
  17059. * Bits 6:0
  17060. * Purpose: Contain the mem request id of the region where the CFR capture
  17061. * has been stored - of type WMI_HOST_MEM_REQ_ID
  17062. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  17063. this value is invalid)
  17064. * - status
  17065. * Bit 7
  17066. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  17067. * Value: 1 (True) - Successful; 0 (False) - Not successful
  17068. * - capture_bw
  17069. * Bits 10:8
  17070. * Purpose: Carry the bandwidth of the CFR capture
  17071. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  17072. * - mode
  17073. * Bits 13:11
  17074. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  17075. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  17076. * - sts_count
  17077. * Bits 16:14
  17078. * Purpose: Carry the number of space time streams
  17079. * Value: Number of space time streams
  17080. * - channel_bw
  17081. * Bits 19:17
  17082. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  17083. * measurement
  17084. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  17085. * - cap_type
  17086. * Bits 23:20
  17087. * Purpose: Carry the type of the capture
  17088. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  17089. * - vdev_id
  17090. * Bits 31:24
  17091. * Purpose: Carry the virtual device id
  17092. * Value: vdev ID
  17093. *
  17094. * Word 3
  17095. * - mac_addr31to0
  17096. * Bits 31:0
  17097. * Purpose: Contain the bits 31:0 of the peer MAC address
  17098. * Value: Bits 31:0 of the peer MAC address
  17099. *
  17100. * Word 4
  17101. * - mac_addr47to32
  17102. * Bits 15:0
  17103. * Purpose: Contain the bits 47:32 of the peer MAC address
  17104. * Value: Bits 47:32 of the peer MAC address
  17105. *
  17106. * Word 5
  17107. * - index
  17108. * Bits 31:0
  17109. * Purpose: Contain the index at which this CFR dump was written in the Host
  17110. * allocated memory. This index is the number of bytes from the base address.
  17111. * Value: Index position
  17112. *
  17113. * Word 6
  17114. * - length
  17115. * Bits 31:0
  17116. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  17117. * Value: Length of the CFR capture of the peer
  17118. *
  17119. * Word 7
  17120. * - timestamp
  17121. * Bits 31:0
  17122. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  17123. * clock used for this timestamp is private to the target and not visible to
  17124. * the host i.e., Host can interpret only the relative timestamp deltas from
  17125. * one message to the next, but can't interpret the absolute timestamp from a
  17126. * single message.
  17127. * Value: Timestamp in microseconds
  17128. *
  17129. * Word 8
  17130. * - counter
  17131. * Bits 31:0
  17132. * Purpose: Carry the count of the current CFR capture from FW. This is
  17133. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  17134. * in host memory)
  17135. * Value: Count of the current CFR capture
  17136. *
  17137. * Word 9
  17138. * - chan_mhz
  17139. * Bits 31:0
  17140. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  17141. * Value: Primary 20 channel frequency
  17142. *
  17143. * Word 10
  17144. * - band_center_freq1
  17145. * Bits 31:0
  17146. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  17147. * Value: Center frequency 1 in MHz
  17148. *
  17149. * Word 11
  17150. * - band_center_freq2
  17151. * Bits 31:0
  17152. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  17153. * the VDEV
  17154. * 80plus80 mode
  17155. * Value: Center frequency 2 in MHz
  17156. *
  17157. * Word 12
  17158. * - chan_phy_mode
  17159. * Bits 31:0
  17160. * Purpose: Carry the phy mode of the channel, of the VDEV
  17161. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  17162. */
  17163. PREPACK struct htt_cfr_dump_ind_type_1 {
  17164. A_UINT32 mem_req_id:7,
  17165. status:1,
  17166. capture_bw:3,
  17167. mode:3,
  17168. sts_count:3,
  17169. channel_bw:3,
  17170. cap_type:4,
  17171. vdev_id:8;
  17172. htt_mac_addr addr;
  17173. A_UINT32 index;
  17174. A_UINT32 length;
  17175. A_UINT32 timestamp;
  17176. A_UINT32 counter;
  17177. struct htt_chan_change_msg chan;
  17178. } POSTPACK;
  17179. PREPACK struct htt_cfr_dump_compl_ind {
  17180. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  17181. union {
  17182. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  17183. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  17184. /* If there is a need to change the memory layout and its associated
  17185. * HTT indication format, a new CFR capture message type can be
  17186. * introduced and added into this union.
  17187. */
  17188. };
  17189. } POSTPACK;
  17190. /*
  17191. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  17192. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  17193. */
  17194. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  17195. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  17196. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  17197. do { \
  17198. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  17199. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  17200. } while(0)
  17201. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  17202. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  17203. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  17204. /*
  17205. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  17206. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  17207. */
  17208. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  17209. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  17210. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  17211. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  17212. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  17213. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  17214. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  17215. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  17216. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  17217. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  17218. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  17219. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  17220. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  17221. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  17222. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  17223. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  17224. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  17225. do { \
  17226. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  17227. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  17228. } while (0)
  17229. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  17230. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  17231. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  17232. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  17233. do { \
  17234. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  17235. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  17236. } while (0)
  17237. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  17238. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  17239. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  17240. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  17241. do { \
  17242. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  17243. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  17244. } while (0)
  17245. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  17246. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  17247. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  17248. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  17249. do { \
  17250. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  17251. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  17252. } while (0)
  17253. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  17254. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  17255. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  17256. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  17257. do { \
  17258. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  17259. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  17260. } while (0)
  17261. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  17262. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  17263. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  17264. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  17265. do { \
  17266. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  17267. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  17268. } while (0)
  17269. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  17270. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  17271. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  17272. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  17273. do { \
  17274. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  17275. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  17276. } while (0)
  17277. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  17278. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  17279. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  17280. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  17281. do { \
  17282. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  17283. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  17284. } while (0)
  17285. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  17286. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  17287. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  17288. /**
  17289. * @brief target -> host peer (PPDU) stats message
  17290. *
  17291. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  17292. *
  17293. * @details
  17294. * This message is generated by FW when FW is sending stats to host
  17295. * about one or more PPDUs that the FW has transmitted to one or more peers.
  17296. * This message is sent autonomously by the target rather than upon request
  17297. * by the host.
  17298. * The following field definitions describe the format of the HTT target
  17299. * to host peer stats indication message.
  17300. *
  17301. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  17302. * or more PPDU stats records.
  17303. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  17304. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  17305. * then the message would start with the
  17306. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  17307. * below.
  17308. *
  17309. * |31 16|15|14|13 11|10 9|8|7 0|
  17310. * |-------------------------------------------------------------|
  17311. * | reserved |MSG_TYPE |
  17312. * |-------------------------------------------------------------|
  17313. * rec 0 | TLV header |
  17314. * rec 0 |-------------------------------------------------------------|
  17315. * rec 0 | ppdu successful bytes |
  17316. * rec 0 |-------------------------------------------------------------|
  17317. * rec 0 | ppdu retry bytes |
  17318. * rec 0 |-------------------------------------------------------------|
  17319. * rec 0 | ppdu failed bytes |
  17320. * rec 0 |-------------------------------------------------------------|
  17321. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  17322. * rec 0 |-------------------------------------------------------------|
  17323. * rec 0 | retried MSDUs | successful MSDUs |
  17324. * rec 0 |-------------------------------------------------------------|
  17325. * rec 0 | TX duration | failed MSDUs |
  17326. * rec 0 |-------------------------------------------------------------|
  17327. * ...
  17328. * |-------------------------------------------------------------|
  17329. * rec N | TLV header |
  17330. * rec N |-------------------------------------------------------------|
  17331. * rec N | ppdu successful bytes |
  17332. * rec N |-------------------------------------------------------------|
  17333. * rec N | ppdu retry bytes |
  17334. * rec N |-------------------------------------------------------------|
  17335. * rec N | ppdu failed bytes |
  17336. * rec N |-------------------------------------------------------------|
  17337. * rec N | peer id | S|SG| BW | BA |A|rate code|
  17338. * rec N |-------------------------------------------------------------|
  17339. * rec N | retried MSDUs | successful MSDUs |
  17340. * rec N |-------------------------------------------------------------|
  17341. * rec N | TX duration | failed MSDUs |
  17342. * rec N |-------------------------------------------------------------|
  17343. *
  17344. * where:
  17345. * A = is A-MPDU flag
  17346. * BA = block-ack failure flags
  17347. * BW = bandwidth spec
  17348. * SG = SGI enabled spec
  17349. * S = skipped rate ctrl
  17350. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  17351. *
  17352. * Header
  17353. * ------
  17354. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  17355. * dword0 - b'8:31 - reserved : Reserved for future use
  17356. *
  17357. * payload include below peer_stats information
  17358. * --------------------------------------------
  17359. * @TLV : HTT_PPDU_STATS_INFO_TLV
  17360. * @tx_success_bytes : total successful bytes in the PPDU.
  17361. * @tx_retry_bytes : total retried bytes in the PPDU.
  17362. * @tx_failed_bytes : total failed bytes in the PPDU.
  17363. * @tx_ratecode : rate code used for the PPDU.
  17364. * @is_ampdu : Indicates PPDU is AMPDU or not.
  17365. * @ba_ack_failed : BA/ACK failed for this PPDU
  17366. * b00 -> BA received
  17367. * b01 -> BA failed once
  17368. * b10 -> BA failed twice, when HW retry is enabled.
  17369. * @bw : BW
  17370. * b00 -> 20 MHz
  17371. * b01 -> 40 MHz
  17372. * b10 -> 80 MHz
  17373. * b11 -> 160 MHz (or 80+80)
  17374. * @sg : SGI enabled
  17375. * @s : skipped ratectrl
  17376. * @peer_id : peer id
  17377. * @tx_success_msdus : successful MSDUs
  17378. * @tx_retry_msdus : retried MSDUs
  17379. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  17380. * @tx_duration : Tx duration for the PPDU (microsecond units)
  17381. */
  17382. /**
  17383. * @brief target -> host backpressure event
  17384. *
  17385. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  17386. *
  17387. * @details
  17388. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  17389. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  17390. * This message will only be sent if the backpressure condition has existed
  17391. * continuously for an initial period (100 ms).
  17392. * Repeat messages with updated information will be sent after each
  17393. * subsequent period (100 ms) as long as the backpressure remains unabated.
  17394. * This message indicates the ring id along with current head and tail index
  17395. * locations (i.e. write and read indices).
  17396. * The backpressure time indicates the time in ms for which continuous
  17397. * backpressure has been observed in the ring.
  17398. *
  17399. * The message format is as follows:
  17400. *
  17401. * |31 24|23 16|15 8|7 0|
  17402. * |----------------+----------------+----------------+----------------|
  17403. * | ring_id | ring_type | pdev_id | msg_type |
  17404. * |-------------------------------------------------------------------|
  17405. * | tail_idx | head_idx |
  17406. * |-------------------------------------------------------------------|
  17407. * | backpressure_time_ms |
  17408. * |-------------------------------------------------------------------|
  17409. *
  17410. * The message is interpreted as follows:
  17411. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  17412. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  17413. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  17414. * 1, 2, 3 indicates pdev_id 0,1,2 and
  17415. * the msg is for LMAC ring.
  17416. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  17417. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  17418. * htt_backpressure_lmac_ring_id. This represents
  17419. * the ring id for which continuous backpressure
  17420. * is seen
  17421. *
  17422. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  17423. * the ring indicated by the ring_id
  17424. *
  17425. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  17426. * the ring indicated by the ring id
  17427. *
  17428. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  17429. * backpressure has been seen in the ring
  17430. * indicated by the ring_id.
  17431. * Units = milliseconds
  17432. */
  17433. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  17434. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  17435. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  17436. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  17437. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  17438. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  17439. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  17440. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  17441. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  17442. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  17443. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  17444. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  17445. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  17446. do { \
  17447. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  17448. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  17449. } while (0)
  17450. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  17451. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  17452. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  17453. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  17454. do { \
  17455. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  17456. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  17457. } while (0)
  17458. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  17459. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  17460. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  17461. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  17462. do { \
  17463. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  17464. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  17465. } while (0)
  17466. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  17467. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  17468. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  17469. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  17470. do { \
  17471. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  17472. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  17473. } while (0)
  17474. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  17475. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  17476. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  17477. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  17478. do { \
  17479. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  17480. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  17481. } while (0)
  17482. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  17483. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  17484. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  17485. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  17486. do { \
  17487. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  17488. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  17489. } while (0)
  17490. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  17491. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  17492. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  17493. enum htt_backpressure_ring_type {
  17494. HTT_SW_RING_TYPE_UMAC,
  17495. HTT_SW_RING_TYPE_LMAC,
  17496. HTT_SW_RING_TYPE_MAX,
  17497. };
  17498. /* Ring id for which the message is sent to host */
  17499. enum htt_backpressure_umac_ringid {
  17500. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  17501. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  17502. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  17503. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  17504. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  17505. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  17506. HTT_SW_RING_IDX_REO_REO2FW_RING,
  17507. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  17508. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  17509. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  17510. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  17511. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  17512. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  17513. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  17514. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  17515. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  17516. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  17517. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  17518. HTT_SW_UMAC_RING_IDX_MAX,
  17519. };
  17520. enum htt_backpressure_lmac_ringid {
  17521. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  17522. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  17523. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  17524. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  17525. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  17526. HTT_SW_RING_IDX_RXDMA2FW_RING,
  17527. HTT_SW_RING_IDX_RXDMA2SW_RING,
  17528. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  17529. HTT_SW_RING_IDX_RXDMA2REO_RING,
  17530. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  17531. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  17532. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  17533. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  17534. HTT_SW_LMAC_RING_IDX_MAX,
  17535. };
  17536. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  17537. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  17538. pdev_id: 8,
  17539. ring_type: 8, /* htt_backpressure_ring_type */
  17540. /*
  17541. * ring_id holds an enum value from either
  17542. * htt_backpressure_umac_ringid or
  17543. * htt_backpressure_lmac_ringid, based on
  17544. * the ring_type setting.
  17545. */
  17546. ring_id: 8;
  17547. A_UINT16 head_idx;
  17548. A_UINT16 tail_idx;
  17549. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  17550. } POSTPACK;
  17551. /*
  17552. * Defines two 32 bit words that can be used by the target to indicate a per
  17553. * user RU allocation and rate information.
  17554. *
  17555. * This information is currently provided in the "sw_response_reference_ptr"
  17556. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  17557. * "rx_ppdu_end_user_stats" TLV.
  17558. *
  17559. * VALID:
  17560. * The consumer of these words must explicitly check the valid bit,
  17561. * and only attempt interpretation of any of the remaining fields if
  17562. * the valid bit is set to 1.
  17563. *
  17564. * VERSION:
  17565. * The consumer of these words must also explicitly check the version bit,
  17566. * and only use the V0 definition if the VERSION field is set to 0.
  17567. *
  17568. * Version 1 is currently undefined, with the exception of the VALID and
  17569. * VERSION fields.
  17570. *
  17571. * Version 0:
  17572. *
  17573. * The fields below are duplicated per BW.
  17574. *
  17575. * The consumer must determine which BW field to use, based on the UL OFDMA
  17576. * PPDU BW indicated by HW.
  17577. *
  17578. * RU_START: RU26 start index for the user.
  17579. * Note that this is always using the RU26 index, regardless
  17580. * of the actual RU assigned to the user
  17581. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  17582. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  17583. *
  17584. * For example, 20MHz (the value in the top row is RU_START)
  17585. *
  17586. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  17587. * RU Size 1 (52): | | | | | |
  17588. * RU Size 2 (106): | | | |
  17589. * RU Size 3 (242): | |
  17590. *
  17591. * RU_SIZE: Indicates the RU size, as defined by enum
  17592. * htt_ul_ofdma_user_info_ru_size.
  17593. *
  17594. * LDPC: LDPC enabled (if 0, BCC is used)
  17595. *
  17596. * DCM: DCM enabled
  17597. *
  17598. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  17599. * |---------------------------------+--------------------------------|
  17600. * |Ver|Valid| FW internal |
  17601. * |---------------------------------+--------------------------------|
  17602. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  17603. * |---------------------------------+--------------------------------|
  17604. */
  17605. enum htt_ul_ofdma_user_info_ru_size {
  17606. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  17607. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  17608. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  17609. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  17610. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  17611. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  17612. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  17613. };
  17614. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  17615. struct htt_ul_ofdma_user_info_v0 {
  17616. A_UINT32 word0;
  17617. A_UINT32 word1;
  17618. };
  17619. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  17620. A_UINT32 w0_fw_rsvd:29; \
  17621. A_UINT32 w0_manual_ulofdma_trig:1; \
  17622. A_UINT32 w0_valid:1; \
  17623. A_UINT32 w0_version:1;
  17624. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  17625. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17626. };
  17627. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  17628. A_UINT32 w1_nss:3; \
  17629. A_UINT32 w1_mcs:4; \
  17630. A_UINT32 w1_ldpc:1; \
  17631. A_UINT32 w1_dcm:1; \
  17632. A_UINT32 w1_ru_start:7; \
  17633. A_UINT32 w1_ru_size:3; \
  17634. A_UINT32 w1_trig_type:4; \
  17635. A_UINT32 w1_unused:9;
  17636. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  17637. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17638. };
  17639. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  17640. A_UINT32 w0_fw_rsvd:27; \
  17641. A_UINT32 w0_sub_version:3; /* set to a value of "0" on WKK/Beryllium targets (future expansion) */ \
  17642. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  17643. 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) */
  17644. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  17645. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17646. };
  17647. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  17648. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  17649. A_UINT32 w1_trig_type:4; \
  17650. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  17651. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  17652. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17653. };
  17654. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  17655. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  17656. union {
  17657. A_UINT32 word0;
  17658. struct {
  17659. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17660. };
  17661. };
  17662. union {
  17663. A_UINT32 word1;
  17664. struct {
  17665. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17666. };
  17667. };
  17668. } POSTPACK;
  17669. /*
  17670. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  17671. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  17672. * this should be picked.
  17673. */
  17674. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  17675. union {
  17676. A_UINT32 word0;
  17677. struct {
  17678. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17679. };
  17680. };
  17681. union {
  17682. A_UINT32 word1;
  17683. struct {
  17684. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17685. };
  17686. };
  17687. } POSTPACK;
  17688. enum HTT_UL_OFDMA_TRIG_TYPE {
  17689. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  17690. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  17691. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  17692. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  17693. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  17694. };
  17695. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  17696. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  17697. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  17698. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_M 0x20000000
  17699. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_S 29
  17700. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  17701. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  17702. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  17703. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  17704. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  17705. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  17706. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  17707. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  17708. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  17709. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  17710. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  17711. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  17712. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  17713. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  17714. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  17715. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  17716. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  17717. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  17718. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  17719. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  17720. /*--- word 0 ---*/
  17721. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  17722. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  17723. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  17724. do { \
  17725. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  17726. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  17727. } while (0)
  17728. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  17729. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  17730. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  17731. do { \
  17732. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  17733. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  17734. } while (0)
  17735. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  17736. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  17737. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  17738. do { \
  17739. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  17740. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  17741. } while (0)
  17742. /*--- word 1 ---*/
  17743. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  17744. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  17745. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  17746. do { \
  17747. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  17748. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  17749. } while (0)
  17750. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  17751. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  17752. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  17753. do { \
  17754. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  17755. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  17756. } while (0)
  17757. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  17758. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  17759. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  17760. do { \
  17761. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  17762. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  17763. } while (0)
  17764. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  17765. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  17766. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  17767. do { \
  17768. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  17769. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  17770. } while (0)
  17771. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  17772. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  17773. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  17774. do { \
  17775. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  17776. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  17777. } while (0)
  17778. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  17779. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  17780. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  17781. do { \
  17782. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  17783. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  17784. } while (0)
  17785. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  17786. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  17787. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  17788. do { \
  17789. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  17790. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  17791. } while (0)
  17792. /**
  17793. * @brief target -> host channel calibration data message
  17794. *
  17795. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  17796. *
  17797. * @brief host -> target channel calibration data message
  17798. *
  17799. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  17800. *
  17801. * @details
  17802. * The following field definitions describe the format of the channel
  17803. * calibration data message sent from the target to the host when
  17804. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  17805. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  17806. * The message is defined as htt_chan_caldata_msg followed by a variable
  17807. * number of 32-bit character values.
  17808. *
  17809. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  17810. * |------------------------------------------------------------------|
  17811. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  17812. * |------------------------------------------------------------------|
  17813. * | payload size | mhz |
  17814. * |------------------------------------------------------------------|
  17815. * | center frequency 2 | center frequency 1 |
  17816. * |------------------------------------------------------------------|
  17817. * | check sum |
  17818. * |------------------------------------------------------------------|
  17819. * | payload |
  17820. * |------------------------------------------------------------------|
  17821. * message info field:
  17822. * - MSG_TYPE
  17823. * Bits 7:0
  17824. * Purpose: identifies this as a channel calibration data message
  17825. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  17826. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  17827. * - SUB_TYPE
  17828. * Bits 11:8
  17829. * Purpose: T2H: indicates whether target is providing chan cal data
  17830. * to the host to store, or requesting that the host
  17831. * download previously-stored data.
  17832. * H2T: indicates whether the host is providing the requested
  17833. * channel cal data, or if it is rejecting the data
  17834. * request because it does not have the requested data.
  17835. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  17836. * - CHKSUM_VALID
  17837. * Bit 12
  17838. * Purpose: indicates if the checksum field is valid
  17839. * value:
  17840. * - FRAG
  17841. * Bit 19:16
  17842. * Purpose: indicates the fragment index for message
  17843. * value: 0 for first fragment, 1 for second fragment, ...
  17844. * - APPEND
  17845. * Bit 20
  17846. * Purpose: indicates if this is the last fragment
  17847. * value: 0 = final fragment, 1 = more fragments will be appended
  17848. *
  17849. * channel and payload size field
  17850. * - MHZ
  17851. * Bits 15:0
  17852. * Purpose: indicates the channel primary frequency
  17853. * Value:
  17854. * - PAYLOAD_SIZE
  17855. * Bits 31:16
  17856. * Purpose: indicates the bytes of calibration data in payload
  17857. * Value:
  17858. *
  17859. * center frequency field
  17860. * - CENTER FREQUENCY 1
  17861. * Bits 15:0
  17862. * Purpose: indicates the channel center frequency
  17863. * Value: channel center frequency, in MHz units
  17864. * - CENTER FREQUENCY 2
  17865. * Bits 31:16
  17866. * Purpose: indicates the secondary channel center frequency,
  17867. * only for 11acvht 80plus80 mode
  17868. * Value: secondary channel center frequency, in MHz units, if applicable
  17869. *
  17870. * checksum field
  17871. * - CHECK_SUM
  17872. * Bits 31:0
  17873. * Purpose: check the payload data, it is just for this fragment.
  17874. * This is intended for the target to check that the channel
  17875. * calibration data returned by the host is the unmodified data
  17876. * that was previously provided to the host by the target.
  17877. * value: checksum of fragment payload
  17878. */
  17879. PREPACK struct htt_chan_caldata_msg {
  17880. /* DWORD 0: message info */
  17881. A_UINT32
  17882. msg_type: 8,
  17883. sub_type: 4 ,
  17884. chksum_valid: 1, /** 1:valid, 0:invalid */
  17885. reserved1: 3,
  17886. frag_idx: 4, /** fragment index for calibration data */
  17887. appending: 1, /** 0: no fragment appending,
  17888. * 1: extra fragment appending */
  17889. reserved2: 11;
  17890. /* DWORD 1: channel and payload size */
  17891. A_UINT32
  17892. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  17893. payload_size: 16; /** unit: bytes */
  17894. /* DWORD 2: center frequency */
  17895. A_UINT32
  17896. band_center_freq1: 16, /** Center frequency 1 in MHz */
  17897. band_center_freq2: 16; /** Center frequency 2 in MHz,
  17898. * valid only for 11acvht 80plus80 mode */
  17899. /* DWORD 3: check sum */
  17900. A_UINT32 chksum;
  17901. /* variable length for calibration data */
  17902. A_UINT32 payload[1/* or more */];
  17903. } POSTPACK;
  17904. /* T2H SUBTYPE */
  17905. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  17906. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  17907. /* H2T SUBTYPE */
  17908. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  17909. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  17910. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  17911. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  17912. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  17913. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  17914. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  17915. do { \
  17916. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  17917. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  17918. } while (0)
  17919. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  17920. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  17921. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  17922. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  17923. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  17924. do { \
  17925. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  17926. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  17927. } while (0)
  17928. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  17929. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  17930. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  17931. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  17932. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  17933. do { \
  17934. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  17935. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  17936. } while (0)
  17937. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  17938. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  17939. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  17940. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  17941. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  17942. do { \
  17943. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  17944. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  17945. } while (0)
  17946. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  17947. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  17948. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  17949. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  17950. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  17951. do { \
  17952. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  17953. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  17954. } while (0)
  17955. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  17956. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  17957. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  17958. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  17959. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  17960. do { \
  17961. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  17962. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  17963. } while (0)
  17964. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  17965. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  17966. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  17967. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  17968. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  17969. do { \
  17970. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  17971. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  17972. } while (0)
  17973. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  17974. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  17975. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  17976. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  17977. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  17978. do { \
  17979. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  17980. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  17981. } while (0)
  17982. /**
  17983. * @brief target -> host FSE CMEM based send
  17984. *
  17985. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  17986. *
  17987. * @details
  17988. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  17989. * FSE placement in CMEM is enabled.
  17990. *
  17991. * This message sends the non-secure CMEM base address.
  17992. * It will be sent to host in response to message
  17993. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  17994. * The message would appear as follows:
  17995. *
  17996. * |31 24|23 16|15 8|7 0|
  17997. * |----------------+----------------+----------------+----------------|
  17998. * | reserved | num_entries | msg_type |
  17999. * |----------------+----------------+----------------+----------------|
  18000. * | base_address_lo |
  18001. * |----------------+----------------+----------------+----------------|
  18002. * | base_address_hi |
  18003. * |-------------------------------------------------------------------|
  18004. *
  18005. * The message is interpreted as follows:
  18006. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  18007. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  18008. * b'8:15 - number_entries: Indicated the number of entries
  18009. * programmed.
  18010. * b'16:31 - reserved.
  18011. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  18012. * CMEM base address
  18013. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  18014. * CMEM base address
  18015. */
  18016. PREPACK struct htt_cmem_base_send_t {
  18017. A_UINT32 msg_type: 8,
  18018. num_entries: 8,
  18019. reserved: 16;
  18020. A_UINT32 base_address_lo;
  18021. A_UINT32 base_address_hi;
  18022. } POSTPACK;
  18023. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  18024. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  18025. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  18026. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  18027. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  18028. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  18029. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  18030. do { \
  18031. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  18032. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  18033. } while (0)
  18034. /**
  18035. * @brief - HTT PPDU ID format
  18036. *
  18037. * @details
  18038. * The following field definitions describe the format of the PPDU ID.
  18039. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  18040. *
  18041. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  18042. * +--------------------------------------------------------------------------
  18043. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  18044. * +--------------------------------------------------------------------------
  18045. *
  18046. * sch id :Schedule command id
  18047. * Bits [11 : 0] : monotonically increasing counter to track the
  18048. * PPDU posted to a specific transmit queue.
  18049. *
  18050. * hwq_id: Hardware Queue ID.
  18051. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  18052. *
  18053. * mac_id: MAC ID
  18054. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  18055. *
  18056. * seq_idx: Sequence index.
  18057. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  18058. * a particular TXOP.
  18059. *
  18060. * tqm_cmd: HWSCH/TQM flag.
  18061. * Bit [23] : Always set to 0.
  18062. *
  18063. * seq_cmd_type: Sequence command type.
  18064. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  18065. * Refer to enum HTT_STATS_FTYPE for values.
  18066. */
  18067. PREPACK struct htt_ppdu_id {
  18068. A_UINT32
  18069. sch_id: 12,
  18070. hwq_id: 5,
  18071. mac_id: 2,
  18072. seq_idx: 2,
  18073. reserved1: 2,
  18074. tqm_cmd: 1,
  18075. seq_cmd_type: 6,
  18076. reserved2: 2;
  18077. } POSTPACK;
  18078. #define HTT_PPDU_ID_SCH_ID_S 0
  18079. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  18080. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  18081. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  18082. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  18083. do { \
  18084. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  18085. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  18086. } while (0)
  18087. #define HTT_PPDU_ID_HWQ_ID_S 12
  18088. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  18089. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  18090. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  18091. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  18092. do { \
  18093. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  18094. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  18095. } while (0)
  18096. #define HTT_PPDU_ID_MAC_ID_S 17
  18097. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  18098. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  18099. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  18100. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  18101. do { \
  18102. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  18103. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  18104. } while (0)
  18105. #define HTT_PPDU_ID_SEQ_IDX_S 19
  18106. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  18107. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  18108. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  18109. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  18110. do { \
  18111. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  18112. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  18113. } while (0)
  18114. #define HTT_PPDU_ID_TQM_CMD_S 23
  18115. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  18116. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  18117. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  18118. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  18119. do { \
  18120. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  18121. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  18122. } while (0)
  18123. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  18124. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  18125. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  18126. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  18127. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  18128. do { \
  18129. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  18130. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  18131. } while (0)
  18132. /**
  18133. * @brief target -> RX PEER METADATA V0 format
  18134. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18135. * message from target, and will confirm to the target which peer metadata
  18136. * version to use in the wmi_init message.
  18137. *
  18138. * The following diagram shows the format of the RX PEER METADATA.
  18139. *
  18140. * |31 24|23 16|15 8|7 0|
  18141. * |-----------------------------------------------------------------------|
  18142. * | Reserved | VDEV ID | PEER ID |
  18143. * |-----------------------------------------------------------------------|
  18144. */
  18145. PREPACK struct htt_rx_peer_metadata_v0 {
  18146. A_UINT32
  18147. peer_id: 16,
  18148. vdev_id: 8,
  18149. reserved1: 8;
  18150. } POSTPACK;
  18151. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  18152. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  18153. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  18154. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  18155. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  18156. do { \
  18157. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  18158. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  18159. } while (0)
  18160. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  18161. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  18162. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  18163. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  18164. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  18165. do { \
  18166. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  18167. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  18168. } while (0)
  18169. /**
  18170. * @brief target -> RX PEER METADATA V1 format
  18171. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18172. * message from target, and will confirm to the target which peer metadata
  18173. * version to use in the wmi_init message.
  18174. *
  18175. * The following diagram shows the format of the RX PEER METADATA V1 format.
  18176. *
  18177. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  18178. * |---------------------------------------------------------------------------|
  18179. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  18180. * |---------------------------------------------------------------------------|
  18181. */
  18182. PREPACK struct htt_rx_peer_metadata_v1 {
  18183. A_UINT32
  18184. peer_id: 13,
  18185. ml_peer_valid: 1,
  18186. logical_link_id: 2,
  18187. vdev_id: 8,
  18188. lmac_id: 2,
  18189. chip_id: 3,
  18190. reserved2: 3;
  18191. } POSTPACK;
  18192. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  18193. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  18194. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  18195. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  18196. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  18197. do { \
  18198. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  18199. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  18200. } while (0)
  18201. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  18202. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  18203. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  18204. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  18205. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  18206. do { \
  18207. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  18208. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  18209. } while (0)
  18210. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  18211. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  18212. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  18213. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  18214. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  18215. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  18216. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  18217. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  18218. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  18219. do { \
  18220. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  18221. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  18222. } while (0)
  18223. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  18224. do { \
  18225. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  18226. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  18227. } while (0)
  18228. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  18229. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  18230. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  18231. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  18232. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  18233. do { \
  18234. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  18235. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  18236. } while (0)
  18237. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  18238. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  18239. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  18240. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  18241. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  18242. do { \
  18243. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  18244. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  18245. } while (0)
  18246. /**
  18247. * @brief target -> RX PEER METADATA V1A format
  18248. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18249. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  18250. * and will confirm to the target which peer metadata version to use in the
  18251. * wmi_init message.
  18252. *
  18253. * The following diagram shows the format of the RX PEER METADATA V1A format.
  18254. *
  18255. * |31 29|28 26|25 22|21 14| 13 |12 0|
  18256. * |-------------------------------------------------------------------|
  18257. * |Rsvd2|CHIP ID|logical_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  18258. * |-------------------------------------------------------------------|
  18259. */
  18260. PREPACK struct htt_rx_peer_metadata_v1a {
  18261. A_UINT32
  18262. peer_id: 13,
  18263. ml_peer_valid: 1,
  18264. vdev_id: 8,
  18265. logical_link_id: 4,
  18266. chip_id: 3,
  18267. reserved2: 3;
  18268. } POSTPACK;
  18269. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_S 0
  18270. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_M 0x00001fff
  18271. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_GET(_var) \
  18272. (((_var) & HTT_RX_PEER_META_DATA_V1A_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)
  18273. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_SET(_var, _val) \
  18274. do { \
  18275. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_PEER_ID, _val); \
  18276. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)); \
  18277. } while (0)
  18278. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S 13
  18279. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M 0x00002000
  18280. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_GET(_var) \
  18281. (((_var) & HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)
  18282. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_SET(_var, _val) \
  18283. do { \
  18284. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID, _val); \
  18285. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)); \
  18286. } while (0)
  18287. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S 14
  18288. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M 0x003fc000
  18289. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_GET(_var) \
  18290. (((_var) & HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)
  18291. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_SET(_var, _val) \
  18292. do { \
  18293. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_VDEV_ID, _val); \
  18294. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)); \
  18295. } while (0)
  18296. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S 22
  18297. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M 0x03C00000
  18298. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_GET(_var) \
  18299. (((_var) & HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)
  18300. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_SET(_var, _val) \
  18301. do { \
  18302. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID, _val); \
  18303. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)); \
  18304. } while (0)
  18305. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S 26
  18306. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M 0x1c000000
  18307. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_GET(_var) \
  18308. (((_var) & HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)
  18309. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_SET(_var, _val) \
  18310. do { \
  18311. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_CHIP_ID, _val); \
  18312. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)); \
  18313. } while (0)
  18314. /**
  18315. * @brief target -> RX PEER METADATA V1B format
  18316. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18317. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  18318. * and will confirm to the target which peer metadata version to use in the
  18319. * wmi_init message.
  18320. *
  18321. * The following diagram shows the format of the RX PEER METADATA V1B format.
  18322. *
  18323. * |31 29|28 26|25 22|21 14| 13 |12 0|
  18324. * |--------------------------------------------------------------|
  18325. * |Rsvd2|CHIP ID|hw_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  18326. * |--------------------------------------------------------------|
  18327. */
  18328. PREPACK struct htt_rx_peer_metadata_v1b {
  18329. A_UINT32
  18330. peer_id: 13,
  18331. ml_peer_valid: 1,
  18332. vdev_id: 8,
  18333. hw_link_id: 4,
  18334. chip_id: 3,
  18335. reserved2: 3;
  18336. } POSTPACK;
  18337. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_S 0
  18338. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_M 0x00001fff
  18339. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_GET(_var) \
  18340. (((_var) & HTT_RX_PEER_META_DATA_V1B_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)
  18341. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_SET(_var, _val) \
  18342. do { \
  18343. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_PEER_ID, _val); \
  18344. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)); \
  18345. } while (0)
  18346. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S 13
  18347. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M 0x00002000
  18348. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_GET(_var) \
  18349. (((_var) & HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)
  18350. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_SET(_var, _val) \
  18351. do { \
  18352. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID, _val); \
  18353. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)); \
  18354. } while (0)
  18355. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S 14
  18356. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M 0x003fc000
  18357. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_GET(_var) \
  18358. (((_var) & HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)
  18359. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_SET(_var, _val) \
  18360. do { \
  18361. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_VDEV_ID, _val); \
  18362. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)); \
  18363. } while (0)
  18364. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S 22
  18365. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M 0x03C00000
  18366. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_GET(_var) \
  18367. (((_var) & HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)
  18368. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_SET(_var, _val) \
  18369. do { \
  18370. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID, _val); \
  18371. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)); \
  18372. } while (0)
  18373. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S 26
  18374. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M 0x1c000000
  18375. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_GET(_var) \
  18376. (((_var) & HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)
  18377. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_SET(_var, _val) \
  18378. do { \
  18379. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_CHIP_ID, _val); \
  18380. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)); \
  18381. } while (0)
  18382. /* generic variables for masks and shifts for various fields */
  18383. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_S;
  18384. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_M;
  18385. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_S;
  18386. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_M;
  18387. /* generic function pointers to get/set values from rx peer metadata v0/v1/v1a/v1b */
  18388. extern A_UINT32 (*HTT_RX_PEER_META_DATA_PEER_ID_GET) (A_UINT32 var);
  18389. extern void (*HTT_RX_PEER_META_DATA_PEER_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18390. extern A_UINT32 (*HTT_RX_PEER_META_DATA_VDEV_ID_GET) (A_UINT32 var);
  18391. extern void (*HTT_RX_PEER_META_DATA_VDEV_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18392. extern A_UINT32 (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_GET) (A_UINT32 var);
  18393. extern void (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_SET) (A_UINT32 *var, A_UINT32 val);
  18394. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_GET) (A_UINT32 var);
  18395. extern void (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18396. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LMAC_ID_GET) (A_UINT32 var);
  18397. extern void (*HTT_RX_PEER_META_DATA_LMAC_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18398. extern A_UINT32 (*HTT_RX_PEER_META_DATA_CHIP_ID_GET) (A_UINT32 var);
  18399. extern void (*HTT_RX_PEER_META_DATA_CHIP_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18400. extern A_UINT32 (*HTT_RX_PEER_META_DATA_HW_LINK_ID_GET) (A_UINT32 var);
  18401. extern void (*HTT_RX_PEER_META_DATA_HW_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18402. /*
  18403. * In some systems, the host SW wants to specify priorities between
  18404. * different MSDU / flow queues within the same peer-TID.
  18405. * The below enums are used for the host to identify to the target
  18406. * which MSDU queue's priority it wants to adjust.
  18407. */
  18408. /*
  18409. * The MSDUQ index describe index of TCL HW, where each index is
  18410. * used for queuing particular types of MSDUs.
  18411. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  18412. */
  18413. enum HTT_MSDUQ_INDEX {
  18414. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  18415. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  18416. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  18417. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  18418. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  18419. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  18420. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  18421. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  18422. HTT_MSDUQ_MAX_INDEX,
  18423. };
  18424. /* MSDU qtype definition */
  18425. enum HTT_MSDU_QTYPE {
  18426. /*
  18427. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  18428. * relative priority. Instead, the relative priority of CRIT_0 versus
  18429. * CRIT_1 is controlled by the FW, through the configuration parameters
  18430. * it applies to the queues.
  18431. */
  18432. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  18433. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  18434. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  18435. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  18436. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  18437. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  18438. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  18439. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  18440. /* New MSDU_QTYPE should be added above this line */
  18441. /*
  18442. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  18443. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  18444. * any host/target message definitions. The QTYPE_MAX value can
  18445. * only be used internally within the host or within the target.
  18446. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  18447. * it must regard the unexpected value as a default qtype value,
  18448. * or ignore it.
  18449. */
  18450. HTT_MSDU_QTYPE_MAX,
  18451. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  18452. };
  18453. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  18454. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  18455. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  18456. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  18457. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  18458. };
  18459. /**
  18460. * @brief target -> host mlo timestamp offset indication
  18461. *
  18462. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18463. *
  18464. * @details
  18465. * The following field definitions describe the format of the HTT target
  18466. * to host mlo timestamp offset indication message.
  18467. *
  18468. *
  18469. * |31 16|15 12|11 10|9 8|7 0 |
  18470. * |----------------------------------------------------------------------|
  18471. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  18472. * |----------------------------------------------------------------------|
  18473. * | Sync time stamp lo in us |
  18474. * |----------------------------------------------------------------------|
  18475. * | Sync time stamp hi in us |
  18476. * |----------------------------------------------------------------------|
  18477. * | mlo time stamp offset lo in us |
  18478. * |----------------------------------------------------------------------|
  18479. * | mlo time stamp offset hi in us |
  18480. * |----------------------------------------------------------------------|
  18481. * | mlo time stamp offset clocks in clock ticks |
  18482. * |----------------------------------------------------------------------|
  18483. * |31 26|25 16|15 0 |
  18484. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  18485. * | | compensation in clks | |
  18486. * |----------------------------------------------------------------------|
  18487. * |31 22|21 0 |
  18488. * | rsvd 3 | mlo time stamp comp timer period |
  18489. * |----------------------------------------------------------------------|
  18490. * The message is interpreted as follows:
  18491. *
  18492. * dword0 - b'0:7 - msg_type: This will be set to
  18493. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18494. * value: 0x28
  18495. *
  18496. * dword0 - b'9:8 - pdev_id
  18497. *
  18498. * dword0 - b'11:10 - chip_id
  18499. *
  18500. * dword0 - b'15:12 - rsvd1: Reserved for future use
  18501. *
  18502. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  18503. *
  18504. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  18505. * which last sync interrupt was received
  18506. *
  18507. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  18508. * which last sync interrupt was received
  18509. *
  18510. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  18511. *
  18512. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  18513. *
  18514. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  18515. *
  18516. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  18517. *
  18518. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  18519. * for sub us resolution
  18520. *
  18521. * dword6 - b'31:26 - rsvd2: Reserved for future use
  18522. *
  18523. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  18524. * is applied, in us
  18525. *
  18526. * dword7 - b'31:22 - rsvd3: Reserved for future use
  18527. */
  18528. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  18529. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  18530. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  18531. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  18532. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  18533. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  18534. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  18535. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  18536. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  18537. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  18538. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  18539. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  18540. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  18541. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  18542. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  18543. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  18544. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  18545. do { \
  18546. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  18547. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  18548. } while (0)
  18549. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  18550. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  18551. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  18552. do { \
  18553. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  18554. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  18555. } while (0)
  18556. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  18557. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  18558. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  18559. do { \
  18560. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  18561. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  18562. } while (0)
  18563. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  18564. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  18565. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  18566. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  18567. do { \
  18568. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  18569. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  18570. } while (0)
  18571. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  18572. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  18573. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  18574. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  18575. do { \
  18576. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  18577. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  18578. } while (0)
  18579. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  18580. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  18581. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  18582. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  18583. do { \
  18584. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  18585. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  18586. } while (0)
  18587. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  18588. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  18589. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  18590. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  18591. do { \
  18592. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  18593. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  18594. } while (0)
  18595. typedef struct {
  18596. A_UINT32 msg_type: 8, /* bits 7:0 */
  18597. pdev_id: 2, /* bits 9:8 */
  18598. chip_id: 2, /* bits 11:10 */
  18599. reserved1: 4, /* bits 15:12 */
  18600. mac_clk_freq_mhz: 16; /* bits 31:16 */
  18601. A_UINT32 sync_timestamp_lo_us;
  18602. A_UINT32 sync_timestamp_hi_us;
  18603. A_UINT32 mlo_timestamp_offset_lo_us;
  18604. A_UINT32 mlo_timestamp_offset_hi_us;
  18605. A_UINT32 mlo_timestamp_offset_clks;
  18606. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  18607. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  18608. reserved2: 6; /* bits 31:26 */
  18609. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  18610. reserved3: 10; /* bits 31:22 */
  18611. } htt_t2h_mlo_offset_ind_t;
  18612. /*
  18613. * @brief target -> host VDEV TX RX STATS
  18614. *
  18615. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  18616. *
  18617. * @details
  18618. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  18619. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  18620. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  18621. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  18622. * periodically by target even in the absence of any further HTT request
  18623. * messages from host.
  18624. *
  18625. * The message is formatted as follows:
  18626. *
  18627. * |31 16|15 8|7 0|
  18628. * |---------------------------------+----------------+----------------|
  18629. * | payload_size | pdev_id | msg_type |
  18630. * |---------------------------------+----------------+----------------|
  18631. * | reserved0 |
  18632. * |-------------------------------------------------------------------|
  18633. * | reserved1 |
  18634. * |-------------------------------------------------------------------|
  18635. * | reserved2 |
  18636. * |-------------------------------------------------------------------|
  18637. * | |
  18638. * | VDEV specific Tx Rx stats info |
  18639. * | |
  18640. * |-------------------------------------------------------------------|
  18641. *
  18642. * The message is interpreted as follows:
  18643. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  18644. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  18645. * b'8:15 - pdev_id
  18646. * b'16:31 - size in bytes of the payload that follows the 16-byte
  18647. * message header fields (msg_type through reserved2)
  18648. * dword1 - b'0:31 - reserved0.
  18649. * dword2 - b'0:31 - reserved1.
  18650. * dword3 - b'0:31 - reserved2.
  18651. */
  18652. typedef struct {
  18653. A_UINT32 msg_type: 8,
  18654. pdev_id: 8,
  18655. payload_size: 16;
  18656. A_UINT32 reserved0;
  18657. A_UINT32 reserved1;
  18658. A_UINT32 reserved2;
  18659. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  18660. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  18661. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  18662. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  18663. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  18664. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  18665. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  18666. do { \
  18667. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  18668. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  18669. } while (0)
  18670. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  18671. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  18672. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  18673. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  18674. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  18675. do { \
  18676. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  18677. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  18678. } while (0)
  18679. /* SOC related stats */
  18680. typedef struct {
  18681. htt_tlv_hdr_t tlv_hdr;
  18682. /* When TQM is not able to find the peers during Tx, then it drops the packets
  18683. * This can be due to either the peer is deleted or deletion is ongoing
  18684. * */
  18685. A_UINT32 inv_peers_msdu_drop_count_lo;
  18686. A_UINT32 inv_peers_msdu_drop_count_hi;
  18687. } htt_stats_soc_txrx_stats_common_tlv;
  18688. /* preserve old name alias for new name consistent with the tag name */
  18689. typedef htt_stats_soc_txrx_stats_common_tlv htt_t2h_soc_txrx_stats_common_tlv;
  18690. /* VDEV HW Tx/Rx stats */
  18691. typedef struct {
  18692. htt_tlv_hdr_t tlv_hdr;
  18693. A_UINT32 vdev_id;
  18694. /* Rx msdu byte cnt */
  18695. A_UINT32 rx_msdu_byte_cnt_lo;
  18696. A_UINT32 rx_msdu_byte_cnt_hi;
  18697. /* Rx msdu cnt */
  18698. A_UINT32 rx_msdu_cnt_lo;
  18699. A_UINT32 rx_msdu_cnt_hi;
  18700. /* tx msdu byte cnt */
  18701. A_UINT32 tx_msdu_byte_cnt_lo;
  18702. A_UINT32 tx_msdu_byte_cnt_hi;
  18703. /* tx msdu cnt */
  18704. A_UINT32 tx_msdu_cnt_lo;
  18705. A_UINT32 tx_msdu_cnt_hi;
  18706. /* tx excessive retry discarded msdu cnt */
  18707. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  18708. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  18709. /* TX congestion ctrl msdu drop cnt */
  18710. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  18711. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  18712. /* discarded tx msdus cnt coz of time to live expiry */
  18713. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  18714. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  18715. /* tx excessive retry discarded msdu byte cnt */
  18716. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  18717. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  18718. /* TX congestion ctrl msdu drop byte cnt */
  18719. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  18720. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  18721. /* discarded tx msdus byte cnt coz of time to live expiry */
  18722. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  18723. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  18724. /* TQM bypass frame cnt */
  18725. A_UINT32 tqm_bypass_frame_cnt_lo;
  18726. A_UINT32 tqm_bypass_frame_cnt_hi;
  18727. /* TQM bypass byte cnt */
  18728. A_UINT32 tqm_bypass_byte_cnt_lo;
  18729. A_UINT32 tqm_bypass_byte_cnt_hi;
  18730. } htt_stats_vdev_txrx_stats_hw_stats_tlv;
  18731. /* preserve old name alias for new name consistent with the tag name */
  18732. typedef htt_stats_vdev_txrx_stats_hw_stats_tlv
  18733. htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  18734. /*
  18735. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  18736. *
  18737. * @details
  18738. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  18739. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  18740. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  18741. * the default MSDU queues of each of the specified TIDs for the peer
  18742. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  18743. * If the default MSDU queues of a given TID within the peer are not linked
  18744. * to a service class, the svc_class_id field for that TID will have a
  18745. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  18746. * queues for that TID are not mapped to any service class.
  18747. *
  18748. * |31 16|15 8|7 0|
  18749. * |------------------------------+--------------+--------------|
  18750. * | peer ID | reserved | msg type |
  18751. * |------------------------------+--------------+------+-------|
  18752. * | reserved | svc class ID | TID |
  18753. * |------------------------------------------------------------|
  18754. * ...
  18755. * |------------------------------------------------------------|
  18756. * | reserved | svc class ID | TID |
  18757. * |------------------------------------------------------------|
  18758. * Header fields:
  18759. * dword0 - b'7:0 - msg_type: This will be set to
  18760. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  18761. * b'31:16 - peer ID
  18762. * dword1 - b'7:0 - TID
  18763. * b'15:8 - svc class ID
  18764. * (dword2, etc. same format as dword1)
  18765. */
  18766. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  18767. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  18768. A_UINT32 msg_type :8,
  18769. reserved0 :8,
  18770. peer_id :16;
  18771. struct {
  18772. A_UINT32 tid :8,
  18773. svc_class_id :8,
  18774. reserved1 :16;
  18775. } tid_reports[1/*or more*/];
  18776. } POSTPACK;
  18777. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  18778. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  18779. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  18780. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  18781. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  18782. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  18783. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  18784. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  18785. do { \
  18786. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  18787. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  18788. } while (0)
  18789. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  18790. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  18791. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  18792. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  18793. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  18794. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  18795. do { \
  18796. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  18797. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  18798. } while (0)
  18799. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  18800. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  18801. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  18802. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  18803. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  18804. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  18805. do { \
  18806. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  18807. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  18808. } while (0)
  18809. /*
  18810. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  18811. *
  18812. * @details
  18813. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  18814. * flow if the flow is seen the associated service class is conveyed to the
  18815. * target via TCL Data Command. Target on the other hand internally creates the
  18816. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  18817. * of the newly created MSDUQ and some other identifiers to uniquely identity
  18818. * the newly created MSDUQ
  18819. *
  18820. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  18821. * |------------------------------+------------------------+--------------|
  18822. * | peer ID | HTT qtype | msg type |
  18823. * |---------------------------------+--------------+--+---+-------+------|
  18824. * | reserved |AST list index|FO|WC | HLOS | remap|
  18825. * | | | | | TID | TID |
  18826. * |---------------------+------------------------------------------------|
  18827. * | reserved1 | tgt_opaque_id |
  18828. * |---------------------+------------------------------------------------|
  18829. *
  18830. * Header fields:
  18831. *
  18832. * dword0 - b'7:0 - msg_type: This will be set to
  18833. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  18834. * b'15:8 - HTT qtype
  18835. * b'31:16 - peer ID
  18836. *
  18837. * dword1 - b'3:0 - remap TID, as assigned in firmware
  18838. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  18839. * hlos_tid : Common to Lithium and Beryllium
  18840. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  18841. * TCL Data Command : Beryllium
  18842. * b10 - flow_override (FO), as sent by host in
  18843. * TCL Data Command: Beryllium
  18844. * b11:14 - ast_list_idx
  18845. * Array index into the list of extension AST entries
  18846. * (not the actual AST 16-bit index).
  18847. * The ast_list_idx is one-based, with the following
  18848. * range of values:
  18849. * - legacy targets supporting 16 user-defined
  18850. * MSDU queues: 1-2
  18851. * - legacy targets supporting 48 user-defined
  18852. * MSDU queues: 1-6
  18853. * - new targets: 0 (peer_id is used instead)
  18854. * Note that since ast_list_idx is one-based,
  18855. * the host will need to subtract 1 to use it as an
  18856. * index into a list of extension AST entries.
  18857. * b15:31 - reserved
  18858. *
  18859. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  18860. * unique MSDUQ id in firmware
  18861. * b'24:31 - reserved1
  18862. */
  18863. PREPACK struct htt_t2h_sawf_msduq_event {
  18864. A_UINT32 msg_type : 8,
  18865. htt_qtype : 8,
  18866. peer_id :16;
  18867. A_UINT32 remap_tid : 4,
  18868. hlos_tid : 4,
  18869. who_classify_info_sel : 2,
  18870. flow_override : 1,
  18871. ast_list_idx : 4,
  18872. reserved :17;
  18873. A_UINT32 tgt_opaque_id :24,
  18874. reserved1 : 8;
  18875. } POSTPACK;
  18876. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  18877. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  18878. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  18879. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  18880. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  18881. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  18882. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  18883. do { \
  18884. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  18885. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  18886. } while (0)
  18887. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  18888. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  18889. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  18890. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  18891. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  18892. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  18893. do { \
  18894. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  18895. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  18896. } while (0)
  18897. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  18898. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  18899. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  18900. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  18901. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  18902. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  18903. do { \
  18904. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  18905. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  18906. } while (0)
  18907. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  18908. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  18909. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  18910. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  18911. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  18912. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  18913. do { \
  18914. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  18915. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  18916. } while (0)
  18917. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  18918. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  18919. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  18920. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  18921. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  18922. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  18923. do { \
  18924. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  18925. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  18926. } while (0)
  18927. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  18928. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  18929. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  18930. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  18931. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  18932. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  18933. do { \
  18934. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  18935. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  18936. } while (0)
  18937. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  18938. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  18939. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  18940. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  18941. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  18942. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  18943. do { \
  18944. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  18945. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  18946. } while (0)
  18947. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  18948. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  18949. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  18950. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  18951. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  18952. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  18953. do { \
  18954. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  18955. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  18956. } while (0)
  18957. /**
  18958. * @brief target -> PPDU id format indication
  18959. *
  18960. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  18961. *
  18962. * @details
  18963. * The following field definitions describe the format of the HTT target
  18964. * to host PPDU ID format indication message.
  18965. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  18966. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  18967. * seq_idx :- Sequence control index of this PPDU.
  18968. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  18969. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  18970. * tqm_cmd:-
  18971. *
  18972. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  18973. * |--------------------------------------------------+------------------------|
  18974. * | rsvd0 | msg type |
  18975. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18976. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  18977. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18978. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  18979. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18980. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  18981. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18982. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  18983. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18984. * Where: OF = bit offset, NB = number of bits, V = valid
  18985. * The message is interpreted as follows:
  18986. *
  18987. * dword0 - b'7:0 - msg_type: This will be set to
  18988. * HTT_T2H_PPDU_ID_FMT_IND
  18989. * value: 0x30
  18990. *
  18991. * dword0 - b'31:8 - reserved
  18992. *
  18993. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  18994. *
  18995. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  18996. *
  18997. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  18998. *
  18999. * dword1 - b'15:11 - reserved for future use
  19000. *
  19001. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  19002. *
  19003. * dword1 - b'21:17 - number of bits in ring_id
  19004. *
  19005. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  19006. *
  19007. * dword1 - b'31:27 - reserved for future use
  19008. *
  19009. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  19010. *
  19011. * dword2 - b'5:1 - number of bits in sequence index
  19012. *
  19013. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  19014. *
  19015. * dword2 - b'15:11 - reserved for future use
  19016. *
  19017. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  19018. *
  19019. * dword2 - b'21:17 - number of bits in link_id
  19020. *
  19021. * dword2 - b'26:22 - offset of link_id (in number of bits)
  19022. *
  19023. * dword2 - b'31:27 - reserved for future use
  19024. *
  19025. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  19026. *
  19027. * dword3 - b'5:1 - number of bits in seq_cmd_type
  19028. *
  19029. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  19030. *
  19031. * dword3 - b'15:11 - reserved for future use
  19032. *
  19033. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  19034. *
  19035. * dword3 - b'21:17 - number of bits in tqm_cmd
  19036. *
  19037. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  19038. *
  19039. * dword3 - b'31:27 - reserved for future use
  19040. *
  19041. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  19042. *
  19043. * dword4 - b'5:1 - number of bits in mac_id
  19044. *
  19045. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  19046. *
  19047. * dword4 - b'15:11 - reserved for future use
  19048. *
  19049. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  19050. *
  19051. * dword4 - b'21:17 - number of bits in crc
  19052. *
  19053. * dword4 - b'26:22 - offset of crc (in number of bits)
  19054. *
  19055. * dword4 - b'31:27 - reserved for future use
  19056. *
  19057. */
  19058. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  19059. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  19060. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  19061. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  19062. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  19063. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  19064. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  19065. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  19066. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  19067. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  19068. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  19069. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  19070. /* macros for accessing lower 16 bits in dword */
  19071. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  19072. do { \
  19073. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  19074. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  19075. } while (0)
  19076. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  19077. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  19078. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  19079. do { \
  19080. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  19081. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  19082. } while (0)
  19083. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  19084. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  19085. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  19086. do { \
  19087. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  19088. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  19089. } while (0)
  19090. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  19091. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  19092. /* macros for accessing upper 16 bits in dword */
  19093. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  19094. do { \
  19095. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  19096. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  19097. } while (0)
  19098. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  19099. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  19100. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  19101. do { \
  19102. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  19103. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  19104. } while (0)
  19105. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  19106. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  19107. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  19108. do { \
  19109. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  19110. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  19111. } while (0)
  19112. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  19113. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  19114. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  19115. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  19116. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  19117. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  19118. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  19119. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  19120. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  19121. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  19122. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  19123. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  19124. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  19125. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  19126. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  19127. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  19128. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  19129. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  19130. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  19131. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  19132. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  19133. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  19134. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  19135. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  19136. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  19137. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  19138. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  19139. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  19140. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  19141. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  19142. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  19143. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  19144. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  19145. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  19146. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  19147. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  19148. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  19149. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  19150. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  19151. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  19152. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  19153. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  19154. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  19155. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  19156. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  19157. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  19158. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  19159. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  19160. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  19161. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  19162. /* offsets in number dwords */
  19163. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  19164. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  19165. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  19166. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  19167. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  19168. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  19169. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  19170. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  19171. typedef struct {
  19172. A_UINT32 msg_type: 8, /* bits 7:0 */
  19173. rsvd0: 24;/* bits 31:8 */
  19174. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  19175. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  19176. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  19177. rsvd1: 5, /* bits 15:11 */
  19178. ring_id_valid: 1, /* bits 16:16 */
  19179. ring_id_bits: 5, /* bits 21:17 */
  19180. ring_id_offset: 5, /* bits 26:22 */
  19181. rsvd2: 5; /* bits 31:27 */
  19182. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  19183. seq_idx_bits: 5, /* bits 5:1 */
  19184. seq_idx_offset: 5, /* bits 10:6 */
  19185. rsvd3: 5, /* bits 15:11 */
  19186. link_id_valid: 1, /* bits 16:16 */
  19187. link_id_bits: 5, /* bits 21:17 */
  19188. link_id_offset: 5, /* bits 26:22 */
  19189. rsvd4: 5; /* bits 31:27 */
  19190. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  19191. seq_cmd_type_bits: 5, /* bits 5:1 */
  19192. seq_cmd_type_offset: 5, /* bits 10:6 */
  19193. rsvd5: 5, /* bits 15:11 */
  19194. tqm_cmd_valid: 1, /* bits 16:16 */
  19195. tqm_cmd_bits: 5, /* bits 21:17 */
  19196. tqm_cmd_offset: 5, /* bits 26:12 */
  19197. rsvd6: 5; /* bits 31:27 */
  19198. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  19199. mac_id_bits: 5, /* bits 5:1 */
  19200. mac_id_offset: 5, /* bits 10:6 */
  19201. rsvd8: 5, /* bits 15:11 */
  19202. crc_valid: 1, /* bits 16:16 */
  19203. crc_bits: 5, /* bits 21:17 */
  19204. crc_offset: 5, /* bits 26:12 */
  19205. rsvd9: 5; /* bits 31:27 */
  19206. } htt_t2h_ppdu_id_fmt_ind_t;
  19207. /**
  19208. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  19209. *
  19210. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  19211. *
  19212. * @details
  19213. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  19214. * when RX_CCE_SUPER_RULE setup is done
  19215. *
  19216. * This message shows the configuration results after the setup operation.
  19217. * It will always be sent to host.
  19218. * The message would appear as follows:
  19219. *
  19220. * |31 24|23 16|15 8|7 0|
  19221. * |-----------------+-----------------+----------------+----------------|
  19222. * | result | response_type | pdev_id | msg_type |
  19223. * |---------------------------------------------------------------------|
  19224. *
  19225. * The message is interpreted as follows:
  19226. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  19227. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  19228. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is setup on
  19229. * b'16:23 - response_type: Indicate the response type of this setup
  19230. * done msg
  19231. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  19232. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  19233. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  19234. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  19235. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  19236. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  19237. * b'24:31 - result: Indicate result of setup operation
  19238. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  19239. * b'24 - is_rule_enough: indicate if there are
  19240. * enough free cce rule slots
  19241. * 0: not enough
  19242. * 1: enough
  19243. * b'25:31 - avail_rule_num: indicate the number of
  19244. * remaining free cce rule slots, only makes sense
  19245. * when is_rule_enough = 0
  19246. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  19247. * b'24 - cfg_result_0: indicate the config result
  19248. * of RX_CCE_SUPER_RULE_0
  19249. * 0: Install/Uninstall fails
  19250. * 1: Install/Uninstall succeeds
  19251. * b'25 - cfg_result_1: indicate the config result
  19252. * of RX_CCE_SUPER_RULE_1
  19253. * 0: Install/Uninstall fails
  19254. * 1: Install/Uninstall succeeds
  19255. * b'26:31 - reserved
  19256. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  19257. * b'24 - cfg_result_0: indicate the config result
  19258. * of RX_CCE_SUPER_RULE_0
  19259. * 0: Release fails
  19260. * 1: Release succeeds
  19261. * b'25 - cfg_result_1: indicate the config result
  19262. * of RX_CCE_SUPER_RULE_1
  19263. * 0: Release fails
  19264. * 1: Release succeeds
  19265. * b'26:31 - reserved
  19266. */
  19267. enum htt_rx_cce_super_rule_setup_done_response_type {
  19268. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  19269. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  19270. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  19271. /*All reply type should be before this*/
  19272. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  19273. };
  19274. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  19275. A_UINT8 msg_type;
  19276. A_UINT8 pdev_id;
  19277. A_UINT8 response_type;
  19278. union {
  19279. struct {
  19280. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  19281. A_UINT8 is_rule_enough: 1,
  19282. avail_rule_num: 7;
  19283. };
  19284. struct {
  19285. /*
  19286. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  19287. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  19288. */
  19289. A_UINT8 cfg_result_0: 1,
  19290. cfg_result_1: 1,
  19291. rsvd: 6;
  19292. };
  19293. } result;
  19294. } POSTPACK;
  19295. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  19296. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M 0x0000ff00
  19297. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S 8
  19298. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_GET(_var) \
  19299. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M) >> \
  19300. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)
  19301. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  19302. do { \
  19303. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID, _val); \
  19304. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)); \
  19305. } while (0)
  19306. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  19307. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  19308. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  19309. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  19310. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  19311. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  19312. do { \
  19313. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  19314. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  19315. } while (0)
  19316. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  19317. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  19318. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  19319. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  19320. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  19321. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  19322. do { \
  19323. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  19324. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  19325. } while (0)
  19326. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  19327. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  19328. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  19329. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  19330. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  19331. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  19332. do { \
  19333. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  19334. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  19335. } while (0)
  19336. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  19337. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  19338. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  19339. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  19340. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  19341. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  19342. do { \
  19343. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  19344. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  19345. } while (0)
  19346. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  19347. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  19348. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  19349. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  19350. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  19351. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  19352. do { \
  19353. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  19354. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  19355. } while (0)
  19356. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  19357. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  19358. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  19359. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  19360. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  19361. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  19362. do { \
  19363. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  19364. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  19365. } while (0)
  19366. /**
  19367. * THE BELOW MESSAGE HAS BEEN DEPRECATED
  19368. *======================================
  19369. * @brief target -> host CoDel MSDU queue latencies array configuration
  19370. *
  19371. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  19372. *
  19373. * @details
  19374. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  19375. * by the target to inform the host of the location and size of the DDR array of
  19376. * per MSDU queue latency metrics. This array is updated by the host and
  19377. * read by the target. The target uses these metric values to determine
  19378. * which MSDU queues have latencies exceeding their CoDel latency target.
  19379. *
  19380. * |31 16|15 8|7 0|
  19381. * |-------------------------------------------+----------|
  19382. * | number of array elements | reserved | MSG_TYPE |
  19383. * |-------------------------------------------+----------|
  19384. * | array physical address, low bits |
  19385. * |------------------------------------------------------|
  19386. * | array physical address, high bits |
  19387. * |------------------------------------------------------|
  19388. * Header fields:
  19389. * - MSG_TYPE
  19390. * Bits 7:0
  19391. * Purpose: Identifies this as a CoDel MSDU queue latencies
  19392. * array configuration message.
  19393. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  19394. * - NUM_ELEM
  19395. * Bits 31:16
  19396. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  19397. * Value: Specifies the number of elements in the MSDU queue latency
  19398. * metrics array. This value is the same as the maximum number of
  19399. * MSDU queues supported by the target.
  19400. * Since each array element is 16 bits, the size in bytes of the
  19401. * MSDU queue latency metrics array is twice the number of elements.
  19402. * - PADDR_LOW
  19403. * Bits 31:0
  19404. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19405. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  19406. * metrics array.
  19407. * - PADDR_HIGH
  19408. * Bits 31:0
  19409. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19410. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  19411. * metrics array.
  19412. */
  19413. typedef struct {
  19414. A_UINT32 msg_type: 8, /* bits 7:0 */
  19415. reserved: 8, /* bits 15:8 */
  19416. num_elem: 16; /* bits 31:16 */
  19417. A_UINT32 paddr_low;
  19418. A_UINT32 paddr_high;
  19419. } htt_t2h_codel_msduq_latencies_array_cfg_int_t; /* DEPRECATED */
  19420. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  19421. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  19422. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  19423. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  19424. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  19425. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  19426. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  19427. do { \
  19428. HTT_CHECK_SET_VAL( \
  19429. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  19430. ((_var) |= ((_val) << \
  19431. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  19432. } while (0)
  19433. /*
  19434. * This CoDel MSDU queue latencies array whose location and number of
  19435. * elements are specified by this HTT_T2H message consists of 16-bit elements
  19436. * that each specify a statistical summary (min) of a MSDU queue's latency,
  19437. * using milliseconds units.
  19438. */
  19439. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  19440. /**
  19441. * @brief target -> host rx completion indication message definition
  19442. *
  19443. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DATA_IND
  19444. *
  19445. * @details
  19446. * The following diagram shows the format of the Rx completion indication sent
  19447. * from the target to the host
  19448. *
  19449. * |31|29|28 24|23 12|11 9|8| 7|6|5|4|3|2|1|0|
  19450. * |---------------+----------------------------+----------------|
  19451. * | vdev_id | peer_id | msg_type |
  19452. * hdr: |---------------+--------------------------+-+----------------|
  19453. * | rsvd0 |F| msdu_cnt |
  19454. * pyld: |==========================================+=+================|
  19455. * MSDU 0 | buf addr lo (bits 31:0) |
  19456. * |-----+--------------------------------------+----------------|
  19457. * |rsvd1| SW buffer cookie | buf addr hi |
  19458. * |--+--+-----------------------------+--------+--+-+-+-+-+-+-+-|
  19459. * |R2| W| MSDU length | TID |MC|D|S|C|L|F|R|M|
  19460. * |-------------------------------------------------+---------+-|
  19461. * | rsvd3 | err info|E|
  19462. * |=================================================+=========+=|
  19463. * MSDU 1 | buf addr lo (bits 31:0) |
  19464. * : ... :
  19465. * | rsvd3 | err info|E|
  19466. * |-------------------------------------------------------------|
  19467. * Where:
  19468. * F = fragment
  19469. * M = MPDU retry bit
  19470. * R = raw MPDU frame
  19471. * F = first MSDU in MPDU
  19472. * L = last MSDU in MPDU
  19473. * C = MSDU continuation
  19474. * S = Souce Addr is valid
  19475. * D = Dest Addr is valid
  19476. * MC = Dest Addr is multicast / broadcast
  19477. * W = is first MSDU after WoW wakeup
  19478. * R2 = rsvd2
  19479. * E = error valid
  19480. */
  19481. /* htt_t2h_rx_data_msdu_err:
  19482. * To be filled in "htt_t2h_rx_data_msdu_info.error_info" field
  19483. * when FW forwards MSDU to host.
  19484. */
  19485. typedef enum htt_t2h_rx_data_msdu_err {
  19486. /* ERR_DECRYPT:
  19487. * FW sets this when rxdma_error_code = <enum 3 rxdma_decrypt_err>.
  19488. * host maintains error stats, recycles buffer.
  19489. */
  19490. HTT_RXDATA_ERR_DECRYPT = 0,
  19491. /* ERR_TKIP_MIC:
  19492. * FW sets this when rxdma_error_code = <enum 4 rxdma_tkip_mic_err>.
  19493. * Host maintains error stats, recycles buffer, sends notification to
  19494. * middleware.
  19495. */
  19496. HTT_RXDATA_ERR_TKIP_MIC = 1,
  19497. /* ERR_UNENCRYPTED:
  19498. * FW sets this when rxdma_error_code = <enum 5 rxdma_unecrypted_err>.
  19499. * Host maintains error stats, recycles buffer.
  19500. */
  19501. HTT_RXDATA_ERR_UNENCRYPTED = 2,
  19502. /* ERR_MSDU_LIMIT:
  19503. * FW sets this when rxdma_error_code = <enum 7 rxdma_msdu_limit_err>.
  19504. * Host maintains error stats, recycles buffer.
  19505. */
  19506. HTT_RXDATA_ERR_MSDU_LIMIT = 3,
  19507. /* ERR_FLUSH_REQUEST:
  19508. * FW sets this when rxdma_error_code = <enum 13 rxdma_flush_request>.
  19509. * Host maintains error stats, recycles buffer.
  19510. */
  19511. HTT_RXDATA_ERR_FLUSH_REQUEST = 4,
  19512. /* ERR_OOR:
  19513. * FW full reorder layer maps this error to <enum 7 regular_frame_OOR>.
  19514. * Host maintains error stats, recycles buffer mainly for low
  19515. * TCP KPI debugging.
  19516. */
  19517. HTT_RXDATA_ERR_OOR = 5,
  19518. /* ERR_2K_JUMP:
  19519. * FW full reorder layer maps this error to <enum 5 regular_frame_2k_jump>.
  19520. * Host maintains error stats, recycles buffer mainly for low
  19521. * TCP KPI debugging.
  19522. */
  19523. HTT_RXDATA_ERR_2K_JUMP = 6,
  19524. /* ERR_ZERO_LEN_MSDU:
  19525. * FW sets this error flag for a 0 length MSDU.
  19526. * Host maintains error stats, recycles buffer.
  19527. */
  19528. HTT_RXDATA_ERR_ZERO_LEN_MSDU = 7,
  19529. /* ERR_INVALID_PEER:
  19530. * FW sets this error flag when MSDU is recived from invalid PEER
  19531. * HOST decides to send DEAUTH or not, recyles buffer.
  19532. */
  19533. HTT_RXDATA_ERR_INVALID_PEER = 8,
  19534. /* add new error codes here */
  19535. HTT_RXDATA_ERR_MAX = 32
  19536. } htt_t2h_rx_data_msdu_err_e;
  19537. struct htt_t2h_rx_data_ind_t
  19538. {
  19539. A_UINT32 /* word 0 */
  19540. /* msg_type:
  19541. * Set to Rx data indication i.e. HTT_T2H_MSG_TYPE_RX_DATA_IND.
  19542. */
  19543. msg_type: 8,
  19544. peer_id: 16, /* This will provide peer data */
  19545. vdev_id: 8; /* This will provide vdev id info */
  19546. A_UINT32 /* word 1 */
  19547. /* msdu_cnt:
  19548. * Total number of MSDUs (htt_t2h_rx_data_msdu_info items) in message.
  19549. */
  19550. msdu_cnt: 8,
  19551. frag: 1, /* this bit will be set for 802.11 frag MPDU */
  19552. rsvd0: 23;
  19553. /* NOTE:
  19554. * To preserve backwards compatibility,
  19555. * no new fields can be added in this struct.
  19556. */
  19557. };
  19558. struct htt_t2h_rx_data_msdu_info
  19559. {
  19560. A_UINT32 /* word 0 */
  19561. buffer_addr_low : 32;
  19562. A_UINT32 /* word 1 */
  19563. buffer_addr_high : 8,
  19564. sw_buffer_cookie : 21,
  19565. /* fw_offloads_inspected:
  19566. * When reo_destination_indication is 6 in reo_entrance_ring
  19567. * of the RXDMA2REO MPDU upload, all the MSDUs that are part
  19568. * of the MPDU are inspected by FW offloads layer, subsequently
  19569. * the MSDUs are qualified to be host interested.
  19570. * In such case the fw_offloads_inspected is set to 1, else 0.
  19571. * This will assist host to not consider such MSDUs for FISA
  19572. * flow addition.
  19573. */
  19574. fw_offloads_inspected : 1,
  19575. rsvd1 : 2;
  19576. A_UINT32 /* word 2 */
  19577. mpdu_retry_bit : 1, /* used for stats maintenance */
  19578. raw_mpdu_frame : 1, /* used for pkt drop and processing */
  19579. first_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19580. last_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19581. msdu_continuation : 1, /* used for MSDU scatter/gather support */
  19582. sa_is_valid : 1, /* used for HW issue check in
  19583. * is_sa_da_idx_valid() */
  19584. da_is_valid : 1, /* used for HW issue check and
  19585. * intra-BSS forwarding */
  19586. da_is_mcbc : 1,
  19587. tid_info : 8, /* used for stats maintenance */
  19588. msdu_length : 14,
  19589. is_first_pkt_after_wkp : 1, /* indicates this is the first rx MSDU
  19590. * provided by fw after WoW exit */
  19591. rsvd2 : 1;
  19592. A_UINT32 /* word 3 */
  19593. error_valid : 1, /* Set if the MSDU has any error */
  19594. error_info : 5, /* If error_valid is TRUE, then refer to
  19595. * "htt_t2h_rx_data_msdu_err_e" for
  19596. * checking error reason. */
  19597. rsvd3 : 26;
  19598. /* NOTE:
  19599. * To preserve backwards compatibility,
  19600. * no new fields can be added in this struct.
  19601. */
  19602. };
  19603. /* HTT_RX_DATA_IND_HDR_SIZE: 2 4-byte words
  19604. * This is the size of htt_t2h_rx_data_ind_t alone which is fixed overhead
  19605. * for every Rx DATA IND sent by FW to host.
  19606. */
  19607. #define HTT_RX_DATA_IND_HDR_SIZE (2*4)
  19608. /* HTT_RX_DATA_MSDU_INFO_SIZE: 4 4-bytes words
  19609. * This is the size of each MSDU detail that will be piggybacked with the
  19610. * RX IND header.
  19611. */
  19612. #define HTT_RX_DATA_MSDU_INFO_SIZE (4*4)
  19613. /* member definitions of htt_t2h_rx_data_ind_t */
  19614. #define HTT_RX_DATA_IND_PEER_ID_M 0x00ffff00
  19615. #define HTT_RX_DATA_IND_PEER_ID_S 8
  19616. #define HTT_RX_DATA_IND_PEER_ID_SET(word, value) \
  19617. do { \
  19618. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_PEER_ID, value); \
  19619. (word) |= (value) << HTT_RX_DATA_IND_PEER_ID_S; \
  19620. } while (0)
  19621. #define HTT_RX_DATA_IND_PEER_ID_GET(word) \
  19622. (((word) & HTT_RX_DATA_IND_PEER_ID_M) >> HTT_RX_DATA_IND_PEER_ID_S)
  19623. #define HTT_RX_DATA_IND_VDEV_ID_M 0xff000000
  19624. #define HTT_RX_DATA_IND_VDEV_ID_S 24
  19625. #define HTT_RX_DATA_IND_VDEV_ID_SET(word, value) \
  19626. do { \
  19627. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_VDEV_ID, value); \
  19628. (word) |= (value) << HTT_RX_DATA_IND_VDEV_ID_S; \
  19629. } while (0)
  19630. #define HTT_RX_DATA_IND_VDEV_ID_GET(word) \
  19631. (((word) & HTT_RX_DATA_IND_VDEV_ID_M) >> HTT_RX_DATA_IND_VDEV_ID_S)
  19632. #define HTT_RX_DATA_IND_MSDU_CNT_M 0x000000ff
  19633. #define HTT_RX_DATA_IND_MSDU_CNT_S 0
  19634. #define HTT_RX_DATA_IND_MSDU_CNT_SET(word, value) \
  19635. do { \
  19636. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_MSDU_CNT, value); \
  19637. (word) |= (value) << HTT_RX_DATA_IND_MSDU_CNT_S; \
  19638. } while (0)
  19639. #define HTT_RX_DATA_IND_MSDU_CNT_GET(word) \
  19640. (((word) & HTT_RX_DATA_IND_MSDU_CNT_M) >> HTT_RX_DATA_IND_MSDU_CNT_S)
  19641. #define HTT_RX_DATA_IND_FRAG_M 0x00000100
  19642. #define HTT_RX_DATA_IND_FRAG_S 8
  19643. #define HTT_RX_DATA_IND_FRAG_SET(word, value) \
  19644. do { \
  19645. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_FRAG, value); \
  19646. (word) |= (value) << HTT_RX_DATA_IND_FRAG_S; \
  19647. } while (0)
  19648. #define HTT_RX_DATA_IND_FRAG_GET(word) \
  19649. (((word) & HTT_RX_DATA_IND_FRAG_M) >> HTT_RX_DATA_IND_FRAG_S)
  19650. /* member definitions of htt_t2h_rx_data_msdu_info */
  19651. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M 0xFFFFFFFF
  19652. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S 0
  19653. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M 0x000000FF
  19654. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S 0
  19655. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_SET(word, value) \
  19656. do { \
  19657. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW, value); \
  19658. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S; \
  19659. } while (0)
  19660. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_GET(word) \
  19661. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S)
  19662. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_SET(word, value) \
  19663. do { \
  19664. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH, value); \
  19665. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S; \
  19666. } while (0)
  19667. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_GET(word) \
  19668. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S)
  19669. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M 0x1FFFFF00
  19670. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S 8
  19671. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  19672. do { \
  19673. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE, value); \
  19674. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S; \
  19675. } while (0)
  19676. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_GET(word) \
  19677. (((word) & HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M) >> HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S)
  19678. #define HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_M 0x20000000
  19679. #define HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_S 29
  19680. #define HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_SET(word, value) \
  19681. do { \
  19682. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED, value); \
  19683. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_S; \
  19684. } while (0)
  19685. #define HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_GET(word) \
  19686. (((word) & HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_M) >> HTT_RX_DATA_MSDU_INFO_FW_OFFLOADS_INSPECTED_S)
  19687. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M 0x00000001
  19688. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S 0
  19689. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_SET(word, value) \
  19690. do { \
  19691. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT, value); \
  19692. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S; \
  19693. } while (0)
  19694. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_GET(word) \
  19695. (((word) & HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M) >> HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S)
  19696. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M 0x00000002
  19697. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S 1
  19698. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_SET(word, value) \
  19699. do { \
  19700. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME, value); \
  19701. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S; \
  19702. } while (0)
  19703. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_GET(word) \
  19704. (((word) & HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M) >> HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S)
  19705. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M 0x00000004
  19706. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S 2
  19707. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_SET(word, value) \
  19708. do { \
  19709. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU, value); \
  19710. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S; \
  19711. } while (0)
  19712. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_GET(word) \
  19713. (((word) & HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S)
  19714. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M 0x00000008
  19715. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S 3
  19716. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_SET(word, value) \
  19717. do { \
  19718. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU, value); \
  19719. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S; \
  19720. } while (0)
  19721. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_GET(word) \
  19722. (((word) & HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S)
  19723. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M 0x00000010
  19724. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S 4
  19725. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_SET(word, value) \
  19726. do { \
  19727. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION, value); \
  19728. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S; \
  19729. } while (0)
  19730. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_GET(word) \
  19731. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S)
  19732. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M 0x00000020
  19733. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S 5
  19734. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_SET(word, value) \
  19735. do { \
  19736. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SA_IS_VALID, value); \
  19737. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S; \
  19738. } while (0)
  19739. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_GET(word) \
  19740. (((word) & HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S)
  19741. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M 0x00000040
  19742. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S 6
  19743. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_SET(word, value) \
  19744. do { \
  19745. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_VALID, value); \
  19746. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S; \
  19747. } while (0)
  19748. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_GET(word) \
  19749. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S)
  19750. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M 0x00000080
  19751. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S 7
  19752. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_SET(word, value) \
  19753. do { \
  19754. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC, value); \
  19755. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S; \
  19756. } while (0)
  19757. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_GET(word) \
  19758. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S)
  19759. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_M 0x0000FF00
  19760. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_S 8
  19761. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_SET(word, value) \
  19762. do { \
  19763. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_TID_INFO, value); \
  19764. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_TID_INFO_S; \
  19765. } while (0)
  19766. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_GET(word) \
  19767. (((word) & HTT_RX_DATA_MSDU_INFO_TID_INFO_M) >> HTT_RX_DATA_MSDU_INFO_TID_INFO_S)
  19768. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M 0x3FFF0000
  19769. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S 16
  19770. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_SET(word, value) \
  19771. do { \
  19772. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH, value); \
  19773. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S; \
  19774. } while (0)
  19775. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_GET(word) \
  19776. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S)
  19777. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M 0x40000000
  19778. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S 30
  19779. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_SET(word, value) \
  19780. do { \
  19781. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP, value); \
  19782. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S; \
  19783. } while (0)
  19784. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_GET(word) \
  19785. (((word) & HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M) >> HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S)
  19786. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M 0x00000001
  19787. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S 0
  19788. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_SET(word, value) \
  19789. do { \
  19790. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_VALID, value); \
  19791. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S; \
  19792. } while (0)
  19793. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_GET(word) \
  19794. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S)
  19795. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M 0x0000001E
  19796. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S 1
  19797. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_SET(word, value) \
  19798. do { \
  19799. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_INFO, value); \
  19800. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S; \
  19801. } while (0)
  19802. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_GET(word) \
  19803. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S)
  19804. /**
  19805. * @brief target -> Primary peer migration message to host
  19806. *
  19807. * MSG_TYPE => HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  19808. *
  19809. * @details
  19810. * HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND message is sent by target
  19811. * to host to flush & set-up the RX rings to new primary peer
  19812. *
  19813. * The message would appear as follows:
  19814. *
  19815. * |31 16|15 12|11 8|7 0|
  19816. * |-------------------------------+---------+---------+--------------|
  19817. * | vdev ID | pdev ID | chip ID | msg type |
  19818. * |-------------------------------+---------+---------+--------------|
  19819. * | ML peer ID | SW peer ID |
  19820. * |-------------------------------+----------------------------------|
  19821. *
  19822. * The message is interpreted as follows:
  19823. * dword0 - b'0:7 - msg_type: This will be set to 0x37
  19824. * (HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND)
  19825. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  19826. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  19827. * as primary
  19828. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  19829. * as primary
  19830. *
  19831. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  19832. * chosen as primary
  19833. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  19834. * primary peer belongs.
  19835. */
  19836. typedef struct {
  19837. A_UINT32 msg_type: 8, /* bits 7:0 */
  19838. chip_id: 4, /* bits 11:8 */
  19839. pdev_id: 4, /* bits 15:12 */
  19840. vdev_id: 16; /* bits 31:16 */
  19841. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  19842. ml_peer_id: 16; /* bits 31:16 */
  19843. } htt_t2h_primary_link_peer_migrate_ind_t;
  19844. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  19845. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  19846. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  19847. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  19848. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  19849. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  19850. do { \
  19851. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  19852. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  19853. } while (0)
  19854. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  19855. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  19856. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  19857. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  19858. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  19859. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  19860. do { \
  19861. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  19862. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  19863. } while (0)
  19864. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  19865. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  19866. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  19867. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  19868. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  19869. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  19870. do { \
  19871. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  19872. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  19873. } while (0)
  19874. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  19875. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  19876. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  19877. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  19878. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  19879. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  19880. do { \
  19881. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  19882. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  19883. } while (0)
  19884. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  19885. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  19886. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  19887. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  19888. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  19889. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  19890. do { \
  19891. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  19892. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  19893. } while (0)
  19894. /**
  19895. * @brief target -> host rx peer AST override message defenition
  19896. *
  19897. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND
  19898. *
  19899. * @details
  19900. * Format inherits parts of the HTT_T2H_MSG_TYPE_PEER_MAP_V3 published above
  19901. * where in the dummy ast index is provided to the host.
  19902. * This new message below is sent to the host at run time from the TX_DE
  19903. * exception path when a SAWF flow is detected for a peer.
  19904. * This is sent up once per SAWF peer.
  19905. * This layout assumes the target operates as little-endian.
  19906. *
  19907. * |31 24|23 16|15 8|7 0|
  19908. * |--------------------------------------+-----------------+-----------------|
  19909. * | SW peer ID | vdev ID | msg type |
  19910. * |-----------------+--------------------+-----------------+-----------------|
  19911. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  19912. * |-----------------+--------------------+-----------------+-----------------|
  19913. * | dummy AST Index #1 | MAC addr 5 | MAC addr 4 |
  19914. * |--------------------------------------+-----------------+-----------------|
  19915. * | reserved | dummy AST Index #2 |
  19916. * |--------------------------------------+-----------------------------------|
  19917. *
  19918. * The following field definitions describe the format of the peer ast override
  19919. * index messages sent from the target to the host.
  19920. * - MSG_TYPE
  19921. * Bits 7:0
  19922. * Purpose: identifies this as a peer map v3 message
  19923. * Value: 0x38 (HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND)
  19924. * - VDEV_ID
  19925. * Bits 15:8
  19926. * Purpose: Indicates which virtual device the peer is associated with.
  19927. * - SW_PEER_ID
  19928. * Bits 31:16
  19929. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  19930. * - MAC_ADDR_L32
  19931. * Bits 31:0
  19932. * Purpose: Identifies which peer node the peer ID is for.
  19933. * Value: lower 4 bytes of peer node's MAC address
  19934. * - MAC_ADDR_U16
  19935. * Bits 15:0
  19936. * Purpose: Identifies which peer node the peer ID is for.
  19937. * Value: upper 2 bytes of peer node's MAC address
  19938. * - AST_INDEX1
  19939. * Bits 31:16
  19940. * Purpose: The 1st extra AST index used to identify user defined MSDUQ
  19941. * - AST_INDEX2
  19942. * Bits 15:0
  19943. * Purpose: The 2nd extra AST index used to identify user defined MSDUQ
  19944. */
  19945. /* dword 0 */
  19946. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M 0xffff0000
  19947. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S 16
  19948. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_M 0x0000ff00
  19949. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_S 8
  19950. /* dword 1 */
  19951. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M 0xffffffff
  19952. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S 0
  19953. /* dword 2 */
  19954. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M 0x0000ffff
  19955. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S 0
  19956. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_M 0xffff0000
  19957. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_S 16
  19958. /* dword 3 */
  19959. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_M 0x0000ffff
  19960. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_S 0
  19961. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_SET(word, value) \
  19962. do { \
  19963. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_VDEV_ID, value); \
  19964. (word) |= (value) << HTT_PEER_AST_OVERRIDE_VDEV_ID_S; \
  19965. } while (0)
  19966. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_GET(word) \
  19967. (((word) & HTT_PEER_AST_OVERRIDE_VDEV_ID_M) >> HTT_PEER_AST_OVERRIDE_VDEV_ID_S)
  19968. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_SET(word, value) \
  19969. do { \
  19970. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_SW_PEER_ID, value); \
  19971. (word) |= (value) << HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S; \
  19972. } while (0)
  19973. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_GET(word) \
  19974. (((word) & HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M) >> HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S)
  19975. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_SET(word, value) \
  19976. do { \
  19977. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32, value); \
  19978. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S; \
  19979. } while (0)
  19980. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_GET(word) \
  19981. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S)
  19982. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_SET(word, value) \
  19983. do { \
  19984. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16, value); \
  19985. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S; \
  19986. } while (0)
  19987. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_GET(word) \
  19988. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S)
  19989. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_SET(word, value) \
  19990. do { \
  19991. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX1, value); \
  19992. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX1_S; \
  19993. } while (0)
  19994. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_GET(word) \
  19995. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX1_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX1_S)
  19996. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_SET(word, value) \
  19997. do { \
  19998. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX2, value); \
  19999. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX2_S; \
  20000. } while (0)
  20001. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_GET(word) \
  20002. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX2_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX2_S)
  20003. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_WORD_BASE_OFFSET 4 /* bytes */
  20004. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST1_WORD_BASE_OFFSET 8 /* bytes */
  20005. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST2_WORD_BASE_OFFSET 12 /* bytes */
  20006. #define HTT_PEER_AST_OVERRIDE_INDEX_IND_BYTES 16
  20007. /**
  20008. * @brief target -> periodic report of tx latency to host
  20009. *
  20010. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_LATENCY_STATS_PERIODIC_IND
  20011. *
  20012. * @details
  20013. * The message starts with a message header followed by one or more
  20014. * htt_t2h_peer_tx_latency_stats structs, one for each peer within the vdev.
  20015. * After each upload, these tx latency stats will be reset.
  20016. *
  20017. * |31 24|23 16|15 14|13 10|9 8|7 0|
  20018. * +-------------------------+-----+-----+---+----------|
  20019. * hdr | |pyld elem sz| | GR | P | msg type |
  20020. *- -|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
  20021. * pyld | peer ID |
  20022. * |----------------------------------------------------|
  20023. * | peer_tx_latency[0] |
  20024. * |----------------------------------------------------|
  20025. * 1st | peer_tx_latency[1] |
  20026. * peer |----------------------------------------------------|
  20027. * | peer_tx_latency[2] |
  20028. * |----------------------------------------------------|
  20029. * | peer_tx_latency[3] |
  20030. * |----------------------------------------------------|
  20031. * | avg latency |
  20032. * |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
  20033. * | peer ID |
  20034. * |----------------------------------------------------|
  20035. * | peer_tx_latency[0] |
  20036. * |----------------------------------------------------|
  20037. * 2nd | peer_tx_latency[1] |
  20038. * peer |----------------------------------------------------|
  20039. * | peer_tx_latency[2] |
  20040. * |----------------------------------------------------|
  20041. * | peer_tx_latency[3] |
  20042. * |----------------------------------------------------|
  20043. * | avg latency |
  20044. * |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
  20045. * Where:
  20046. * P = pdev ID
  20047. * GR = granularity
  20048. *
  20049. * @details
  20050. * htt_t2h_tx_latency_stats_periodic_hdr_t:
  20051. * - msg_type
  20052. * Bits 7:0
  20053. * Purpose: identifies this as a tx latency report message
  20054. * Value: 0x3a (HTT_T2H_MSG_TYPE_TX_LATENCY_STATS_PERIODIC_IND)
  20055. * - pdev_id
  20056. * Bits 9:8
  20057. * Purpose: Indicates which pdev this message is associated with.
  20058. * - granularity
  20059. * Bits 13:10
  20060. * Purpose: specifies the granulairty of each tx latency bucket in MS.
  20061. * There are 4 buckets in total. E.g. if granularity is set to 5 ms,
  20062. * then the ranges for the 4 latency histogram buckets will be
  20063. * 0-5ms, 5ms-10ms, 10ms-15ms, 15ms-max, respectively.
  20064. * - payload_elem_size
  20065. * Bits 23:16
  20066. * Purpose: specifies the size of each element within the msg's payload
  20067. * In other words, this field specified the value of
  20068. * sizeof(htt_t2h_peer_tx_latency_stats) based on the target's
  20069. * revision of the htt_t2h_peer_tx_latency_stats definition.
  20070. * If the payload_elem_size reported in the message exceeds the
  20071. * sizeof(htt_t2h_peer_tx_latency_stats) based on the host's
  20072. * revision of the htt_t2h_peer_tx_latency_stats definition,
  20073. * the host shall ignore the excess data.
  20074. * Conversely, if the payload_elem_size reported in the message is
  20075. * less than sizeof(htt_t2h_peer_tx_latency_stats) based on the host's
  20076. * revision of the htt_t2h_peer_tx_latency_stats definition,
  20077. * the host shall use 0x0 values for the portion of the data not
  20078. * provided by the target.
  20079. * The host can compare the payload_elem_size to the total size of
  20080. * the message minus the size of the message header to determine
  20081. * how many peer payload elements are present in the message.
  20082. * - sw_peer_id
  20083. * Purpose: The peer to which the following stats belong
  20084. * - peer_tx_latency
  20085. * Purpose: tx latency histogram for this peer, with 4 buckets whose
  20086. * size (in milliseconds) is specified by the granularity field
  20087. * - avg_latency
  20088. * Purpose: average tx latency (in ms) for this peer in this report interval
  20089. */
  20090. typedef struct {
  20091. A_UINT32 msg_type: 8,
  20092. pdev_id: 2,
  20093. granularity: 4,
  20094. reserved1: 2,
  20095. payload_elem_size: 8,
  20096. reserved2: 8;
  20097. } htt_t2h_tx_latency_stats_periodic_hdr_t;
  20098. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_HDR_SIZE \
  20099. (sizeof(htt_t2h_tx_latency_stats_periodic_hdr_t))
  20100. #define HTT_PEER_TX_LATENCY_REPORT_BINS 4
  20101. typedef struct _htt_tx_latency_stats {
  20102. A_UINT32 peer_id;
  20103. A_UINT32 peer_tx_latency[HTT_PEER_TX_LATENCY_REPORT_BINS];
  20104. A_UINT32 avg_latency;
  20105. } htt_t2h_peer_tx_latency_stats;
  20106. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_M 0x00000300
  20107. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_S 8
  20108. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  20109. (((_var) & HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_S)
  20110. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  20111. do { \
  20112. HTT_CHECK_SET_VAL(HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID, _val); \
  20113. ((_var) |= ((_val) << HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PDEV_ID_S)); \
  20114. } while (0)
  20115. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_M 0x00003C00
  20116. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_S 10
  20117. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_GET(_var) \
  20118. (((_var) & HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_M) >> HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_S)
  20119. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_SET(_var, _val) \
  20120. do { \
  20121. HTT_CHECK_SET_VAL(HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY, _val); \
  20122. ((_var) |= ((_val) << HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_GRANULARITY_S)); \
  20123. } while (0)
  20124. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_M 0x00FF0000
  20125. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_S 16
  20126. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_GET(_var) \
  20127. (((_var) & HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_M) >> HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_S)
  20128. #define HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_SET(_var, _val) \
  20129. do { \
  20130. HTT_CHECK_SET_VAL(HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE, _val); \
  20131. ((_var) |= ((_val) << HTT_T2H_TX_LATENCY_STATS_PERIODIC_IND_PAYLOAD_ELEM_SIZE_S)); \
  20132. } while (0)
  20133. #endif