htt.h 900 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. */
  236. #define HTT_CURRENT_VERSION_MAJOR 3
  237. #define HTT_CURRENT_VERSION_MINOR 114
  238. #define HTT_NUM_TX_FRAG_DESC 1024
  239. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  240. #define HTT_CHECK_SET_VAL(field, val) \
  241. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  242. /* macros to assist in sign-extending fields from HTT messages */
  243. #define HTT_SIGN_BIT_MASK(field) \
  244. ((field ## _M + (1 << field ## _S)) >> 1)
  245. #define HTT_SIGN_BIT(_val, field) \
  246. (_val & HTT_SIGN_BIT_MASK(field))
  247. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  248. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  249. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  250. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  251. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  252. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  253. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  254. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  255. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  256. /*
  257. * TEMPORARY:
  258. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  259. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  260. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  261. * updated.
  262. */
  263. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  264. /*
  265. * TEMPORARY:
  266. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  267. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  268. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  269. * updated.
  270. */
  271. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  272. /**
  273. * htt_dbg_stats_type -
  274. * bit positions for each stats type within a stats type bitmask
  275. * The bitmask contains 24 bits.
  276. */
  277. enum htt_dbg_stats_type {
  278. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  279. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  280. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  281. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  282. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  283. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  284. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  285. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  286. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  287. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  288. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  289. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  290. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  291. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  292. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  293. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  294. /* bits 16-23 currently reserved */
  295. /* keep this last */
  296. HTT_DBG_NUM_STATS
  297. };
  298. /*=== HTT option selection TLVs ===
  299. * Certain HTT messages have alternatives or options.
  300. * For such cases, the host and target need to agree on which option to use.
  301. * Option specification TLVs can be appended to the VERSION_REQ and
  302. * VERSION_CONF messages to select options other than the default.
  303. * These TLVs are entirely optional - if they are not provided, there is a
  304. * well-defined default for each option. If they are provided, they can be
  305. * provided in any order. Each TLV can be present or absent independent of
  306. * the presence / absence of other TLVs.
  307. *
  308. * The HTT option selection TLVs use the following format:
  309. * |31 16|15 8|7 0|
  310. * |---------------------------------+----------------+----------------|
  311. * | value (payload) | length | tag |
  312. * |-------------------------------------------------------------------|
  313. * The value portion need not be only 2 bytes; it can be extended by any
  314. * integer number of 4-byte units. The total length of the TLV, including
  315. * the tag and length fields, must be a multiple of 4 bytes. The length
  316. * field specifies the total TLV size in 4-byte units. Thus, the typical
  317. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  318. * field, would store 0x1 in its length field, to show that the TLV occupies
  319. * a single 4-byte unit.
  320. */
  321. /*--- TLV header format - applies to all HTT option TLVs ---*/
  322. enum HTT_OPTION_TLV_TAGS {
  323. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  324. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  325. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  326. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  327. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  328. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  329. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  330. };
  331. #define HTT_TCL_METADATA_VER_SZ 4
  332. PREPACK struct htt_option_tlv_header_t {
  333. A_UINT8 tag;
  334. A_UINT8 length;
  335. } POSTPACK;
  336. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  337. #define HTT_OPTION_TLV_TAG_S 0
  338. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  339. #define HTT_OPTION_TLV_LENGTH_S 8
  340. /*
  341. * value0 - 16 bit value field stored in word0
  342. * The TLV's value field may be longer than 2 bytes, in which case
  343. * the remainder of the value is stored in word1, word2, etc.
  344. */
  345. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  346. #define HTT_OPTION_TLV_VALUE0_S 16
  347. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_TAG_GET(word) \
  353. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  354. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  355. do { \
  356. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  357. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  358. } while (0)
  359. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  360. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  361. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  362. do { \
  363. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  364. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  365. } while (0)
  366. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  367. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  368. /*--- format of specific HTT option TLVs ---*/
  369. /*
  370. * HTT option TLV for specifying LL bus address size
  371. * Some chips require bus addresses used by the target to access buffers
  372. * within the host's memory to be 32 bits; others require bus addresses
  373. * used by the target to access buffers within the host's memory to be
  374. * 64 bits.
  375. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  376. * a suffix to the VERSION_CONF message to specify which bus address format
  377. * the target requires.
  378. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  379. * default to providing bus addresses to the target in 32-bit format.
  380. */
  381. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  382. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  383. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  384. };
  385. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  386. struct htt_option_tlv_header_t hdr;
  387. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  388. } POSTPACK;
  389. /*
  390. * HTT option TLV for specifying whether HL systems should indicate
  391. * over-the-air tx completion for individual frames, or should instead
  392. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  393. * requests an OTA tx completion for a particular tx frame.
  394. * This option does not apply to LL systems, where the TX_COMPL_IND
  395. * is mandatory.
  396. * This option is primarily intended for HL systems in which the tx frame
  397. * downloads over the host --> target bus are as slow as or slower than
  398. * the transmissions over the WLAN PHY. For cases where the bus is faster
  399. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  400. * and consequently will send one TX_COMPL_IND message that covers several
  401. * tx frames. For cases where the WLAN PHY is faster than the bus,
  402. * the target will end up transmitting very short A-MPDUs, and consequently
  403. * sending many TX_COMPL_IND messages, which each cover a very small number
  404. * of tx frames.
  405. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  406. * a suffix to the VERSION_REQ message to request whether the host desires to
  407. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  408. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  409. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  410. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  411. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  412. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  413. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  414. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  415. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  416. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  417. * TLV.
  418. */
  419. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  420. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  421. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  422. };
  423. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  424. struct htt_option_tlv_header_t hdr;
  425. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  426. } POSTPACK;
  427. /*
  428. * HTT option TLV for specifying how many tx queue groups the target
  429. * may establish.
  430. * This TLV specifies the maximum value the target may send in the
  431. * txq_group_id field of any TXQ_GROUP information elements sent by
  432. * the target to the host. This allows the host to pre-allocate an
  433. * appropriate number of tx queue group structs.
  434. *
  435. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  436. * a suffix to the VERSION_REQ message to specify whether the host supports
  437. * tx queue groups at all, and if so if there is any limit on the number of
  438. * tx queue groups that the host supports.
  439. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  440. * a suffix to the VERSION_CONF message. If the host has specified in the
  441. * VER_REQ message a limit on the number of tx queue groups the host can
  442. * support, the target shall limit its specification of the maximum tx groups
  443. * to be no larger than this host-specified limit.
  444. *
  445. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  446. * shall preallocate 4 tx queue group structs, and the target shall not
  447. * specify a txq_group_id larger than 3.
  448. */
  449. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  451. /*
  452. * values 1 through N specify the max number of tx queue groups
  453. * the sender supports
  454. */
  455. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  456. };
  457. /* TEMPORARY backwards-compatibility alias for a typo fix -
  458. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  459. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  460. * to support the old name (with the typo) until all references to the
  461. * old name are replaced with the new name.
  462. */
  463. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  464. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  465. struct htt_option_tlv_header_t hdr;
  466. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  467. } POSTPACK;
  468. /*
  469. * HTT option TLV for specifying whether the target supports an extended
  470. * version of the HTT tx descriptor. If the target provides this TLV
  471. * and specifies in the TLV that the target supports an extended version
  472. * of the HTT tx descriptor, the target must check the "extension" bit in
  473. * the HTT tx descriptor, and if the extension bit is set, to expect a
  474. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  475. * descriptor. Furthermore, the target must provide room for the HTT
  476. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  477. * This option is intended for systems where the host needs to explicitly
  478. * control the transmission parameters such as tx power for individual
  479. * tx frames.
  480. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  481. * as a suffix to the VERSION_CONF message to explicitly specify whether
  482. * the target supports the HTT tx MSDU extension descriptor.
  483. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  484. * by the host as lack of target support for the HTT tx MSDU extension
  485. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  486. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  487. * the HTT tx MSDU extension descriptor.
  488. * The host is not required to provide the HTT tx MSDU extension descriptor
  489. * just because the target supports it; the target must check the
  490. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  491. * extension descriptor is present.
  492. */
  493. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  494. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  495. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  496. };
  497. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  498. struct htt_option_tlv_header_t hdr;
  499. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  500. } POSTPACK;
  501. /*
  502. * For the tcl data command V2 and higher support added a new
  503. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  504. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  505. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  506. * HTT option TLV for specifying which version of the TCL metadata struct
  507. * should be used:
  508. * V1 -> use htt_tx_tcl_metadata struct
  509. * V2 -> use htt_tx_tcl_metadata_v2 struct
  510. * Old FW will only support V1.
  511. * New FW will support V2. New FW will still support V1, at least during
  512. * a transition period.
  513. * Similarly, old host will only support V1, and new host will support V1 + V2.
  514. *
  515. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  517. * of TCL metadata the host supports. If the host doesn't provide a
  518. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  519. * is implicitly understood that the host only supports V1.
  520. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  521. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  522. * the host shall use. The target shall only select one of the versions
  523. * supported by the host. If the target doesn't provide a
  524. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  525. * is implicitly understood that the V1 TCL metadata shall be used.
  526. */
  527. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  528. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  529. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  530. };
  531. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  532. struct htt_option_tlv_header_t hdr;
  533. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  534. } POSTPACK;
  535. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  536. HTT_OPTION_TLV_VALUE0_SET(word, value)
  537. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  538. HTT_OPTION_TLV_VALUE0_GET(word)
  539. typedef struct {
  540. union {
  541. /* BIT [11 : 0] :- tag
  542. * BIT [23 : 12] :- length
  543. * BIT [31 : 24] :- reserved
  544. */
  545. A_UINT32 tag__length;
  546. /*
  547. * The following struct is not endian-portable.
  548. * It is suitable for use within the target, which is known to be
  549. * little-endian.
  550. * The host should use the above endian-portable macros to access
  551. * the tag and length bitfields in an endian-neutral manner.
  552. */
  553. struct {
  554. A_UINT32 tag : 12, /* BIT [11 : 0] */
  555. length : 12, /* BIT [23 : 12] */
  556. reserved : 8; /* BIT [31 : 24] */
  557. };
  558. };
  559. } htt_tlv_hdr_t;
  560. /** HTT stats TLV tag values */
  561. typedef enum {
  562. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  563. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  564. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  565. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  566. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  567. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  568. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  569. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  570. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  571. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  572. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  573. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  574. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  575. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  576. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  577. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  578. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  579. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  580. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  581. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  582. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  583. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  584. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  585. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  586. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  587. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  588. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  589. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  590. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  591. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  592. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  593. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  594. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  595. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  596. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  597. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  598. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  599. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  600. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  602. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  603. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  604. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  605. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  606. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  607. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  608. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  609. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  610. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  612. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  613. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  614. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  615. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  616. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  617. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  618. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  619. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  620. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  621. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  622. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  623. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  624. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  625. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  626. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  627. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  628. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  629. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  630. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  631. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  632. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  633. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  634. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  635. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  636. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  637. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  638. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  639. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  640. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  641. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  642. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  643. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  644. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  645. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  646. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  647. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  648. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  649. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  650. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  651. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  652. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  653. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  654. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  655. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  656. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  657. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  658. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  659. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  660. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  661. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  662. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  663. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  664. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  665. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  666. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  667. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  668. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  669. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  670. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  671. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  672. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  673. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  674. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  675. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  676. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  677. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  678. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  679. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  680. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  681. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  682. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  683. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  684. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  685. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  686. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  687. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  688. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  689. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  690. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  691. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  692. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  693. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  694. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  695. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  696. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  697. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  698. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  699. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  700. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  701. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  702. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  703. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  704. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  705. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  706. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  707. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  708. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  709. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  717. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  718. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  719. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  720. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  721. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  722. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  723. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  724. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  725. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  726. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  727. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  728. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  729. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  730. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  731. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  732. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  733. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  734. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  735. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  736. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  737. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  738. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  739. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  740. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  741. HTT_STATS_MAX_TAG,
  742. } htt_stats_tlv_tag_t;
  743. /* retain deprecated enum name as an alias for the current enum name */
  744. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  745. #define HTT_STATS_TLV_TAG_M 0x00000fff
  746. #define HTT_STATS_TLV_TAG_S 0
  747. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  748. #define HTT_STATS_TLV_LENGTH_S 12
  749. #define HTT_STATS_TLV_TAG_GET(_var) \
  750. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  751. HTT_STATS_TLV_TAG_S)
  752. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  753. do { \
  754. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  755. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  756. } while (0)
  757. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  758. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  759. HTT_STATS_TLV_LENGTH_S)
  760. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  761. do { \
  762. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  763. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  764. } while (0)
  765. /*=== host -> target messages ===============================================*/
  766. enum htt_h2t_msg_type {
  767. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  768. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  769. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  770. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  771. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  772. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  773. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  774. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  775. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  776. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  777. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  778. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  779. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  780. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  781. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  782. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  783. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  784. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  785. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  786. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  787. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  788. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  789. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  790. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  791. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  792. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  793. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  794. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  795. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  796. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  797. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  798. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  799. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  800. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  801. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  802. /* keep this last */
  803. HTT_H2T_NUM_MSGS
  804. };
  805. /*
  806. * HTT host to target message type -
  807. * stored in bits 7:0 of the first word of the message
  808. */
  809. #define HTT_H2T_MSG_TYPE_M 0xff
  810. #define HTT_H2T_MSG_TYPE_S 0
  811. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  812. do { \
  813. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  814. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  815. } while (0)
  816. #define HTT_H2T_MSG_TYPE_GET(word) \
  817. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  818. /**
  819. * @brief host -> target version number request message definition
  820. *
  821. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  822. *
  823. *
  824. * |31 24|23 16|15 8|7 0|
  825. * |----------------+----------------+----------------+----------------|
  826. * | reserved | msg type |
  827. * |-------------------------------------------------------------------|
  828. * : option request TLV (optional) |
  829. * :...................................................................:
  830. *
  831. * The VER_REQ message may consist of a single 4-byte word, or may be
  832. * extended with TLVs that specify which HTT options the host is requesting
  833. * from the target.
  834. * The following option TLVs may be appended to the VER_REQ message:
  835. * - HL_SUPPRESS_TX_COMPL_IND
  836. * - HL_MAX_TX_QUEUE_GROUPS
  837. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  838. * may be appended to the VER_REQ message (but only one TLV of each type).
  839. *
  840. * Header fields:
  841. * - MSG_TYPE
  842. * Bits 7:0
  843. * Purpose: identifies this as a version number request message
  844. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  845. */
  846. #define HTT_VER_REQ_BYTES 4
  847. /* TBDXXX: figure out a reasonable number */
  848. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  849. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  850. /**
  851. * @brief HTT tx MSDU descriptor
  852. *
  853. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  854. *
  855. * @details
  856. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  857. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  858. * the target firmware needs for the FW's tx processing, particularly
  859. * for creating the HW msdu descriptor.
  860. * The same HTT tx descriptor is used for HL and LL systems, though
  861. * a few fields within the tx descriptor are used only by LL or
  862. * only by HL.
  863. * The HTT tx descriptor is defined in two manners: by a struct with
  864. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  865. * definitions.
  866. * The target should use the struct def, for simplicitly and clarity,
  867. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  868. * neutral. Specifically, the host shall use the get/set macros built
  869. * around the mask + shift defs.
  870. */
  871. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  872. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  873. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  874. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  875. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  876. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  877. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  879. #define HTT_TX_VDEV_ID_WORD 0
  880. #define HTT_TX_VDEV_ID_MASK 0x3f
  881. #define HTT_TX_VDEV_ID_SHIFT 16
  882. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  883. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  884. #define HTT_TX_MSDU_LEN_DWORD 1
  885. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  886. /*
  887. * HTT_VAR_PADDR macros
  888. * Allow physical / bus addresses to be either a single 32-bit value,
  889. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  890. */
  891. #define HTT_VAR_PADDR32(var_name) \
  892. A_UINT32 var_name
  893. #define HTT_VAR_PADDR64_LE(var_name) \
  894. struct { \
  895. /* little-endian: lo precedes hi */ \
  896. A_UINT32 lo; \
  897. A_UINT32 hi; \
  898. } var_name
  899. /*
  900. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  901. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  902. * addresses are stored in a XXX-bit field.
  903. * This macro is used to define both htt_tx_msdu_desc32_t and
  904. * htt_tx_msdu_desc64_t structs.
  905. */
  906. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  907. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  908. { \
  909. /* DWORD 0: flags and meta-data */ \
  910. A_UINT32 \
  911. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  912. \
  913. /* pkt_subtype - \
  914. * Detailed specification of the tx frame contents, extending the \
  915. * general specification provided by pkt_type. \
  916. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  917. * pkt_type | pkt_subtype \
  918. * ============================================================== \
  919. * 802.3 | bit 0:3 - Reserved \
  920. * | bit 4: 0x0 - Copy-Engine Classification Results \
  921. * | not appended to the HTT message \
  922. * | 0x1 - Copy-Engine Classification Results \
  923. * | appended to the HTT message in the \
  924. * | format: \
  925. * | [HTT tx desc, frame header, \
  926. * | CE classification results] \
  927. * | The CE classification results begin \
  928. * | at the next 4-byte boundary after \
  929. * | the frame header. \
  930. * ------------+------------------------------------------------- \
  931. * Eth2 | bit 0:3 - Reserved \
  932. * | bit 4: 0x0 - Copy-Engine Classification Results \
  933. * | not appended to the HTT message \
  934. * | 0x1 - Copy-Engine Classification Results \
  935. * | appended to the HTT message. \
  936. * | See the above specification of the \
  937. * | CE classification results location. \
  938. * ------------+------------------------------------------------- \
  939. * native WiFi | bit 0:3 - Reserved \
  940. * | bit 4: 0x0 - Copy-Engine Classification Results \
  941. * | not appended to the HTT message \
  942. * | 0x1 - Copy-Engine Classification Results \
  943. * | appended to the HTT message. \
  944. * | See the above specification of the \
  945. * | CE classification results location. \
  946. * ------------+------------------------------------------------- \
  947. * mgmt | 0x0 - 802.11 MAC header absent \
  948. * | 0x1 - 802.11 MAC header present \
  949. * ------------+------------------------------------------------- \
  950. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  951. * | 0x1 - 802.11 MAC header present \
  952. * | bit 1: 0x0 - allow aggregation \
  953. * | 0x1 - don't allow aggregation \
  954. * | bit 2: 0x0 - perform encryption \
  955. * | 0x1 - don't perform encryption \
  956. * | bit 3: 0x0 - perform tx classification / queuing \
  957. * | 0x1 - don't perform tx classification; \
  958. * | insert the frame into the "misc" \
  959. * | tx queue \
  960. * | bit 4: 0x0 - Copy-Engine Classification Results \
  961. * | not appended to the HTT message \
  962. * | 0x1 - Copy-Engine Classification Results \
  963. * | appended to the HTT message. \
  964. * | See the above specification of the \
  965. * | CE classification results location. \
  966. */ \
  967. pkt_subtype: 5, \
  968. \
  969. /* pkt_type - \
  970. * General specification of the tx frame contents. \
  971. * The htt_pkt_type enum should be used to specify and check the \
  972. * value of this field. \
  973. */ \
  974. pkt_type: 3, \
  975. \
  976. /* vdev_id - \
  977. * ID for the vdev that is sending this tx frame. \
  978. * For certain non-standard packet types, e.g. pkt_type == raw \
  979. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  980. * This field is used primarily for determining where to queue \
  981. * broadcast and multicast frames. \
  982. */ \
  983. vdev_id: 6, \
  984. /* ext_tid - \
  985. * The extended traffic ID. \
  986. * If the TID is unknown, the extended TID is set to \
  987. * HTT_TX_EXT_TID_INVALID. \
  988. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  989. * value of the QoS TID. \
  990. * If the tx frame is non-QoS data, then the extended TID is set to \
  991. * HTT_TX_EXT_TID_NON_QOS. \
  992. * If the tx frame is multicast or broadcast, then the extended TID \
  993. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  994. */ \
  995. ext_tid: 5, \
  996. \
  997. /* postponed - \
  998. * This flag indicates whether the tx frame has been downloaded to \
  999. * the target before but discarded by the target, and now is being \
  1000. * downloaded again; or if this is a new frame that is being \
  1001. * downloaded for the first time. \
  1002. * This flag allows the target to determine the correct order for \
  1003. * transmitting new vs. old frames. \
  1004. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1005. * This flag only applies to HL systems, since in LL systems, \
  1006. * the tx flow control is handled entirely within the target. \
  1007. */ \
  1008. postponed: 1, \
  1009. \
  1010. /* extension - \
  1011. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1012. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1013. * \
  1014. * 0x0 - no extension MSDU descriptor is present \
  1015. * 0x1 - an extension MSDU descriptor immediately follows the \
  1016. * regular MSDU descriptor \
  1017. */ \
  1018. extension: 1, \
  1019. \
  1020. /* cksum_offload - \
  1021. * This flag indicates whether checksum offload is enabled or not \
  1022. * for this frame. Target FW use this flag to turn on HW checksumming \
  1023. * 0x0 - No checksum offload \
  1024. * 0x1 - L3 header checksum only \
  1025. * 0x2 - L4 checksum only \
  1026. * 0x3 - L3 header checksum + L4 checksum \
  1027. */ \
  1028. cksum_offload: 2, \
  1029. \
  1030. /* tx_comp_req - \
  1031. * This flag indicates whether Tx Completion \
  1032. * from fw is required or not. \
  1033. * This flag is only relevant if tx completion is not \
  1034. * universally enabled. \
  1035. * For all LL systems, tx completion is mandatory, \
  1036. * so this flag will be irrelevant. \
  1037. * For HL systems tx completion is optional, but HL systems in which \
  1038. * the bus throughput exceeds the WLAN throughput will \
  1039. * probably want to always use tx completion, and thus \
  1040. * would not check this flag. \
  1041. * This flag is required when tx completions are not used universally, \
  1042. * but are still required for certain tx frames for which \
  1043. * an OTA delivery acknowledgment is needed by the host. \
  1044. * In practice, this would be for HL systems in which the \
  1045. * bus throughput is less than the WLAN throughput. \
  1046. * \
  1047. * 0x0 - Tx Completion Indication from Fw not required \
  1048. * 0x1 - Tx Completion Indication from Fw is required \
  1049. */ \
  1050. tx_compl_req: 1; \
  1051. \
  1052. \
  1053. /* DWORD 1: MSDU length and ID */ \
  1054. A_UINT32 \
  1055. len: 16, /* MSDU length, in bytes */ \
  1056. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1057. * and this id is used to calculate fragmentation \
  1058. * descriptor pointer inside the target based on \
  1059. * the base address, configured inside the target. \
  1060. */ \
  1061. \
  1062. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1063. /* frags_desc_ptr - \
  1064. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1065. * where the tx frame's fragments reside in memory. \
  1066. * This field only applies to LL systems, since in HL systems the \
  1067. * (degenerate single-fragment) fragmentation descriptor is created \
  1068. * within the target. \
  1069. */ \
  1070. _paddr__frags_desc_ptr_; \
  1071. \
  1072. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1073. /* \
  1074. * Peer ID : Target can use this value to know which peer-id packet \
  1075. * destined to. \
  1076. * It's intended to be specified by host in case of NAWDS. \
  1077. */ \
  1078. A_UINT16 peerid; \
  1079. \
  1080. /* \
  1081. * Channel frequency: This identifies the desired channel \
  1082. * frequency (in mhz) for tx frames. This is used by FW to help \
  1083. * determine when it is safe to transmit or drop frames for \
  1084. * off-channel operation. \
  1085. * The default value of zero indicates to FW that the corresponding \
  1086. * VDEV's home channel (if there is one) is the desired channel \
  1087. * frequency. \
  1088. */ \
  1089. A_UINT16 chanfreq; \
  1090. \
  1091. /* Reason reserved is commented is increasing the htt structure size \
  1092. * leads to some weird issues. \
  1093. * A_UINT32 reserved_dword3_bits0_31; \
  1094. */ \
  1095. } POSTPACK
  1096. /* define a htt_tx_msdu_desc32_t type */
  1097. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1098. /* define a htt_tx_msdu_desc64_t type */
  1099. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1100. /*
  1101. * Make htt_tx_msdu_desc_t be an alias for either
  1102. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1103. */
  1104. #if HTT_PADDR64
  1105. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1106. #else
  1107. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1108. #endif
  1109. /* decriptor information for Management frame*/
  1110. /*
  1111. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1112. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1113. */
  1114. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1115. extern A_UINT32 mgmt_hdr_len;
  1116. PREPACK struct htt_mgmt_tx_desc_t {
  1117. A_UINT32 msg_type;
  1118. #if HTT_PADDR64
  1119. A_UINT64 frag_paddr; /* DMAble address of the data */
  1120. #else
  1121. A_UINT32 frag_paddr; /* DMAble address of the data */
  1122. #endif
  1123. A_UINT32 desc_id; /* returned to host during completion
  1124. * to free the meory*/
  1125. A_UINT32 len; /* Fragment length */
  1126. A_UINT32 vdev_id; /* virtual device ID*/
  1127. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1128. } POSTPACK;
  1129. PREPACK struct htt_mgmt_tx_compl_ind {
  1130. A_UINT32 desc_id;
  1131. A_UINT32 status;
  1132. } POSTPACK;
  1133. /*
  1134. * This SDU header size comes from the summation of the following:
  1135. * 1. Max of:
  1136. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1137. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1138. * b. 802.11 header, for raw frames: 36 bytes
  1139. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1140. * QoS header, HT header)
  1141. * c. 802.3 header, for ethernet frames: 14 bytes
  1142. * (destination address, source address, ethertype / length)
  1143. * 2. Max of:
  1144. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1145. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1146. * 3. 802.1Q VLAN header: 4 bytes
  1147. * 4. LLC/SNAP header: 8 bytes
  1148. */
  1149. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1150. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1151. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1152. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1153. A_COMPILE_TIME_ASSERT(
  1154. htt_encap_hdr_size_max_check_nwifi,
  1155. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1156. A_COMPILE_TIME_ASSERT(
  1157. htt_encap_hdr_size_max_check_enet,
  1158. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1159. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1160. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1161. #define HTT_TX_HDR_SIZE_802_1Q 4
  1162. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1163. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1164. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1165. HTT_TX_HDR_SIZE_802_1Q + \
  1166. HTT_TX_HDR_SIZE_LLC_SNAP)
  1167. #define HTT_HL_TX_FRM_HDR_LEN \
  1168. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1169. #define HTT_LL_TX_FRM_HDR_LEN \
  1170. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1171. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1172. /* dword 0 */
  1173. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1174. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1175. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1176. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1177. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1178. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1179. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1180. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1181. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1182. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1183. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1184. #define HTT_TX_DESC_PKT_TYPE_S 13
  1185. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1186. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1187. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1188. #define HTT_TX_DESC_VDEV_ID_S 16
  1189. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1190. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1191. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1192. #define HTT_TX_DESC_EXT_TID_S 22
  1193. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1194. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1195. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1196. #define HTT_TX_DESC_POSTPONED_S 27
  1197. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1198. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1199. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1200. #define HTT_TX_DESC_EXTENSION_S 28
  1201. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1202. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1203. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1204. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1205. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1206. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1207. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1208. #define HTT_TX_DESC_TX_COMP_S 31
  1209. /* dword 1 */
  1210. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1211. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1212. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1213. #define HTT_TX_DESC_FRM_LEN_S 0
  1214. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1215. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1216. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1217. #define HTT_TX_DESC_FRM_ID_S 16
  1218. /* dword 2 */
  1219. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1220. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1221. /* for systems using 64-bit format for bus addresses */
  1222. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1223. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1224. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1226. /* for systems using 32-bit format for bus addresses */
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1229. /* dword 3 */
  1230. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1231. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1232. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1233. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1234. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1235. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1236. #if HTT_PADDR64
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1239. #else
  1240. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1241. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1242. #endif
  1243. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1244. #define HTT_TX_DESC_PEER_ID_S 0
  1245. /*
  1246. * TEMPORARY:
  1247. * The original definitions for the PEER_ID fields contained typos
  1248. * (with _DESC_PADDR appended to this PEER_ID field name).
  1249. * Retain deprecated original names for PEER_ID fields until all code that
  1250. * refers to them has been updated.
  1251. */
  1252. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1253. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1254. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1255. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1256. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1257. HTT_TX_DESC_PEER_ID_M
  1258. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1259. HTT_TX_DESC_PEER_ID_S
  1260. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1261. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1262. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1263. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1264. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1265. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1266. #if HTT_PADDR64
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1269. #else
  1270. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1271. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1272. #endif
  1273. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1274. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1275. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1276. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1277. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1280. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1281. } while (0)
  1282. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1283. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1284. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1288. } while (0)
  1289. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1290. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1291. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1295. } while (0)
  1296. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1297. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1298. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1302. } while (0)
  1303. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1304. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1305. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1309. } while (0)
  1310. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1311. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1312. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1316. } while (0)
  1317. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1318. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1319. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1323. } while (0)
  1324. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1325. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1326. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1330. } while (0)
  1331. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1332. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1333. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1337. } while (0)
  1338. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1339. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1340. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1344. } while (0)
  1345. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1346. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1347. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1348. do { \
  1349. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1350. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1351. } while (0)
  1352. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1353. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1354. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1357. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1358. } while (0)
  1359. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1360. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1361. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1365. } while (0)
  1366. /* enums used in the HTT tx MSDU extension descriptor */
  1367. enum {
  1368. htt_tx_guard_interval_regular = 0,
  1369. htt_tx_guard_interval_short = 1,
  1370. };
  1371. enum {
  1372. htt_tx_preamble_type_ofdm = 0,
  1373. htt_tx_preamble_type_cck = 1,
  1374. htt_tx_preamble_type_ht = 2,
  1375. htt_tx_preamble_type_vht = 3,
  1376. };
  1377. enum {
  1378. htt_tx_bandwidth_5MHz = 0,
  1379. htt_tx_bandwidth_10MHz = 1,
  1380. htt_tx_bandwidth_20MHz = 2,
  1381. htt_tx_bandwidth_40MHz = 3,
  1382. htt_tx_bandwidth_80MHz = 4,
  1383. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1384. };
  1385. /**
  1386. * @brief HTT tx MSDU extension descriptor
  1387. * @details
  1388. * If the target supports HTT tx MSDU extension descriptors, the host has
  1389. * the option of appending the following struct following the regular
  1390. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1391. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1392. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1393. * tx specs for each frame.
  1394. */
  1395. PREPACK struct htt_tx_msdu_desc_ext_t {
  1396. /* DWORD 0: flags */
  1397. A_UINT32
  1398. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1399. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1400. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1401. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1402. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1403. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1404. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1405. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1406. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1407. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1408. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1409. /* DWORD 1: tx power, tx rate, tx BW */
  1410. A_UINT32
  1411. /* pwr -
  1412. * Specify what power the tx frame needs to be transmitted at.
  1413. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1414. * The value needs to be appropriately sign-extended when extracting
  1415. * the value from the message and storing it in a variable that is
  1416. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1417. * automatically handles this sign-extension.)
  1418. * If the transmission uses multiple tx chains, this power spec is
  1419. * the total transmit power, assuming incoherent combination of
  1420. * per-chain power to produce the total power.
  1421. */
  1422. pwr: 8,
  1423. /* mcs_mask -
  1424. * Specify the allowable values for MCS index (modulation and coding)
  1425. * to use for transmitting the frame.
  1426. *
  1427. * For HT / VHT preamble types, this mask directly corresponds to
  1428. * the HT or VHT MCS indices that are allowed. For each bit N set
  1429. * within the mask, MCS index N is allowed for transmitting the frame.
  1430. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1431. * rates versus OFDM rates, so the host has the option of specifying
  1432. * that the target must transmit the frame with CCK or OFDM rates
  1433. * (not HT or VHT), but leaving the decision to the target whether
  1434. * to use CCK or OFDM.
  1435. *
  1436. * For CCK and OFDM, the bits within this mask are interpreted as
  1437. * follows:
  1438. * bit 0 -> CCK 1 Mbps rate is allowed
  1439. * bit 1 -> CCK 2 Mbps rate is allowed
  1440. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1441. * bit 3 -> CCK 11 Mbps rate is allowed
  1442. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1443. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1444. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1445. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1446. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1447. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1448. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1449. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1450. *
  1451. * The MCS index specification needs to be compatible with the
  1452. * bandwidth mask specification. For example, a MCS index == 9
  1453. * specification is inconsistent with a preamble type == VHT,
  1454. * Nss == 1, and channel bandwidth == 20 MHz.
  1455. *
  1456. * Furthermore, the host has only a limited ability to specify to
  1457. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1458. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1459. */
  1460. mcs_mask: 12,
  1461. /* nss_mask -
  1462. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1463. * Each bit in this mask corresponds to a Nss value:
  1464. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1465. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1466. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1467. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1468. * The values in the Nss mask must be suitable for the recipient, e.g.
  1469. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1470. * recipient which only supports 2x2 MIMO.
  1471. */
  1472. nss_mask: 4,
  1473. /* guard_interval -
  1474. * Specify a htt_tx_guard_interval enum value to indicate whether
  1475. * the transmission should use a regular guard interval or a
  1476. * short guard interval.
  1477. */
  1478. guard_interval: 1,
  1479. /* preamble_type_mask -
  1480. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1481. * may choose from for transmitting this frame.
  1482. * The bits in this mask correspond to the values in the
  1483. * htt_tx_preamble_type enum. For example, to allow the target
  1484. * to transmit the frame as either CCK or OFDM, this field would
  1485. * be set to
  1486. * (1 << htt_tx_preamble_type_ofdm) |
  1487. * (1 << htt_tx_preamble_type_cck)
  1488. */
  1489. preamble_type_mask: 4,
  1490. reserved1_31_29: 3; /* unused, set to 0x0 */
  1491. /* DWORD 2: tx chain mask, tx retries */
  1492. A_UINT32
  1493. /* chain_mask - specify which chains to transmit from */
  1494. chain_mask: 4,
  1495. /* retry_limit -
  1496. * Specify the maximum number of transmissions, including the
  1497. * initial transmission, to attempt before giving up if no ack
  1498. * is received.
  1499. * If the tx rate is specified, then all retries shall use the
  1500. * same rate as the initial transmission.
  1501. * If no tx rate is specified, the target can choose whether to
  1502. * retain the original rate during the retransmissions, or to
  1503. * fall back to a more robust rate.
  1504. */
  1505. retry_limit: 4,
  1506. /* bandwidth_mask -
  1507. * Specify what channel widths may be used for the transmission.
  1508. * A value of zero indicates "don't care" - the target may choose
  1509. * the transmission bandwidth.
  1510. * The bits within this mask correspond to the htt_tx_bandwidth
  1511. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1512. * The bandwidth_mask must be consistent with the preamble_type_mask
  1513. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1514. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1515. */
  1516. bandwidth_mask: 6,
  1517. reserved2_31_14: 18; /* unused, set to 0x0 */
  1518. /* DWORD 3: tx expiry time (TSF) LSBs */
  1519. A_UINT32 expire_tsf_lo;
  1520. /* DWORD 4: tx expiry time (TSF) MSBs */
  1521. A_UINT32 expire_tsf_hi;
  1522. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1523. } POSTPACK;
  1524. /* DWORD 0 */
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1545. /* DWORD 1 */
  1546. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1547. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1548. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1549. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1550. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1551. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1552. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1553. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1554. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1555. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1556. /* DWORD 2 */
  1557. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1558. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1559. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1560. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1561. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1562. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1563. /* DWORD 0 */
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1565. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1566. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1568. do { \
  1569. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1570. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1571. } while (0)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL( \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1587. ((_var) |= ((_val) \
  1588. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1589. } while (0)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1591. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1592. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1594. do { \
  1595. HTT_CHECK_SET_VAL( \
  1596. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1597. ((_var) |= ((_val) \
  1598. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1599. } while (0)
  1600. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1601. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1602. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1603. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1604. do { \
  1605. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1606. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1607. } while (0)
  1608. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1610. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1612. do { \
  1613. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1614. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1615. } while (0)
  1616. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1617. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1618. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1619. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1620. do { \
  1621. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1622. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1623. } while (0)
  1624. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1626. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1627. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1628. do { \
  1629. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1630. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1634. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1635. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1639. } while (0)
  1640. /* DWORD 1 */
  1641. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1645. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1646. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1647. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1648. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1649. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1650. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1651. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1652. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1653. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1654. do { \
  1655. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1656. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1657. } while (0)
  1658. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1659. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1660. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1661. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1668. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1669. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1676. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1677. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1681. } while (0)
  1682. /* DWORD 2 */
  1683. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1685. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1686. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1693. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1694. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1701. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1702. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1706. } while (0)
  1707. typedef enum {
  1708. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1709. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1710. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1711. } htt_11ax_ltf_subtype_t;
  1712. typedef enum {
  1713. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1714. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1715. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1716. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1717. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1718. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1719. } htt_tx_ext2_preamble_type_t;
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1722. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1732. /**
  1733. * @brief HTT tx MSDU extension descriptor v2
  1734. * @details
  1735. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1736. * is received as tcl_exit_base->host_meta_info in firmware.
  1737. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1738. * are already part of tcl_exit_base.
  1739. */
  1740. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1741. /* DWORD 0: flags */
  1742. A_UINT32
  1743. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1744. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1745. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1746. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1747. valid_retries : 1, /* if set, tx retries spec is valid */
  1748. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1749. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1750. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1751. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1752. valid_key_flags : 1, /* if set, key flags is valid */
  1753. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1754. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1755. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1756. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1757. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1758. 1 = ENCRYPT,
  1759. 2 ~ 3 - Reserved */
  1760. /* retry_limit -
  1761. * Specify the maximum number of transmissions, including the
  1762. * initial transmission, to attempt before giving up if no ack
  1763. * is received.
  1764. * If the tx rate is specified, then all retries shall use the
  1765. * same rate as the initial transmission.
  1766. * If no tx rate is specified, the target can choose whether to
  1767. * retain the original rate during the retransmissions, or to
  1768. * fall back to a more robust rate.
  1769. */
  1770. retry_limit : 4,
  1771. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1772. * Valid only for 11ax preamble types HE_SU
  1773. * and HE_EXT_SU
  1774. */
  1775. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1776. * Valid only for 11ax preamble types HE_SU
  1777. * and HE_EXT_SU
  1778. */
  1779. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1780. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1781. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1782. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1783. */
  1784. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1785. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1786. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1787. * Use cases:
  1788. * Any time firmware uses TQM-BYPASS for Data
  1789. * TID, firmware expect host to set this bit.
  1790. */
  1791. /* DWORD 1: tx power, tx rate */
  1792. A_UINT32
  1793. power : 8, /* unit of the power field is 0.5 dbm
  1794. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1795. * signed value ranging from -64dbm to 63.5 dbm
  1796. */
  1797. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1798. * Setting more than one MCS isn't currently
  1799. * supported by the target (but is supported
  1800. * in the interface in case in the future
  1801. * the target supports specifications of
  1802. * a limited set of MCS values.
  1803. */
  1804. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1805. * Setting more than one Nss isn't currently
  1806. * supported by the target (but is supported
  1807. * in the interface in case in the future
  1808. * the target supports specifications of
  1809. * a limited set of Nss values.
  1810. */
  1811. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1812. update_peer_cache : 1; /* When set these custom values will be
  1813. * used for all packets, until the next
  1814. * update via this ext header.
  1815. * This is to make sure not all packets
  1816. * need to include this header.
  1817. */
  1818. /* DWORD 2: tx chain mask, tx retries */
  1819. A_UINT32
  1820. /* chain_mask - specify which chains to transmit from */
  1821. chain_mask : 8,
  1822. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1823. * TODO: Update Enum values for key_flags
  1824. */
  1825. /*
  1826. * Channel frequency: This identifies the desired channel
  1827. * frequency (in MHz) for tx frames. This is used by FW to help
  1828. * determine when it is safe to transmit or drop frames for
  1829. * off-channel operation.
  1830. * The default value of zero indicates to FW that the corresponding
  1831. * VDEV's home channel (if there is one) is the desired channel
  1832. * frequency.
  1833. */
  1834. chanfreq : 16;
  1835. /* DWORD 3: tx expiry time (TSF) LSBs */
  1836. A_UINT32 expire_tsf_lo;
  1837. /* DWORD 4: tx expiry time (TSF) MSBs */
  1838. A_UINT32 expire_tsf_hi;
  1839. /* DWORD 5: flags to control routing / processing of the MSDU */
  1840. A_UINT32
  1841. /* learning_frame
  1842. * When this flag is set, this frame will be dropped by FW
  1843. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1844. */
  1845. learning_frame : 1,
  1846. /* send_as_standalone
  1847. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1848. * i.e. with no A-MSDU or A-MPDU aggregation.
  1849. * The scope is extended to other use-cases.
  1850. */
  1851. send_as_standalone : 1,
  1852. /* is_host_opaque_valid
  1853. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1854. * with valid information.
  1855. */
  1856. is_host_opaque_valid : 1,
  1857. traffic_end_indication: 1,
  1858. rsvd0 : 28;
  1859. /* DWORD 6 : Host opaque cookie for special frames */
  1860. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1861. rsvd1 : 16;
  1862. /*
  1863. * This structure can be expanded further up to 40 bytes
  1864. * by adding further DWORDs as needed.
  1865. */
  1866. } POSTPACK;
  1867. /* DWORD 0 */
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1894. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1895. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1896. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1897. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1898. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1899. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1900. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1901. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1902. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1903. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1904. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1905. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1906. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1907. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1908. /* DWORD 1 */
  1909. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1910. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1911. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1912. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1913. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1914. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1915. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1916. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1917. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1918. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1919. /* DWORD 2 */
  1920. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1921. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1922. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1923. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1924. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1925. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1926. /* DWORD 5 */
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1933. /* DWORD 6 */
  1934. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1935. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1936. /* DWORD 0 */
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1938. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1939. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1941. do { \
  1942. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1943. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1944. } while (0)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1946. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1947. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1952. } while (0)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1954. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1955. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1960. } while (0)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1962. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1963. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL( \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1968. ((_var) |= ((_val) \
  1969. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1970. } while (0)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1972. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1973. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1978. } while (0)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1980. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1981. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1986. } while (0)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL( \
  1993. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1994. ((_var) |= ((_val) \
  1995. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1996. } while (0)
  1997. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1998. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1999. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2000. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2052. } while (0)
  2053. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2057. do { \
  2058. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2059. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2060. } while (0)
  2061. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2062. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2063. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2064. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2065. do { \
  2066. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2067. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2068. } while (0)
  2069. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2070. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2071. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2072. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2073. do { \
  2074. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2075. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2076. } while (0)
  2077. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2078. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2079. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2080. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2081. do { \
  2082. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2083. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2084. } while (0)
  2085. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2092. } while (0)
  2093. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2100. } while (0)
  2101. /* DWORD 1 */
  2102. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2103. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2104. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2105. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2106. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2107. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2108. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2109. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2110. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2111. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2112. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2113. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2114. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2115. do { \
  2116. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2117. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2118. } while (0)
  2119. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2120. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2121. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2122. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2123. do { \
  2124. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2125. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2126. } while (0)
  2127. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2128. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2129. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2130. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2131. do { \
  2132. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2133. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2134. } while (0)
  2135. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2136. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2137. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2138. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2139. do { \
  2140. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2141. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2142. } while (0)
  2143. /* DWORD 2 */
  2144. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2145. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2146. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2147. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2151. } while (0)
  2152. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2153. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2154. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2155. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2159. } while (0)
  2160. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2162. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2163. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2167. } while (0)
  2168. /* DWORD 5 */
  2169. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2170. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2171. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2172. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2173. do { \
  2174. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2175. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2176. } while (0)
  2177. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2178. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2179. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2180. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2184. } while (0)
  2185. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2186. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2187. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2188. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2189. do { \
  2190. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2191. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2192. } while (0)
  2193. /* DWORD 6 */
  2194. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2195. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2196. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2197. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2198. do { \
  2199. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2200. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2201. } while (0)
  2202. typedef enum {
  2203. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2204. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2205. } htt_tcl_metadata_type;
  2206. /**
  2207. * @brief HTT TCL command number format
  2208. * @details
  2209. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2210. * available to firmware as tcl_exit_base->tcl_status_number.
  2211. * For regular / multicast packets host will send vdev and mac id and for
  2212. * NAWDS packets, host will send peer id.
  2213. * A_UINT32 is used to avoid endianness conversion problems.
  2214. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2215. */
  2216. typedef struct {
  2217. A_UINT32
  2218. type: 1, /* vdev_id based or peer_id based */
  2219. rsvd: 31;
  2220. } htt_tx_tcl_vdev_or_peer_t;
  2221. typedef struct {
  2222. A_UINT32
  2223. type: 1, /* vdev_id based or peer_id based */
  2224. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2225. vdev_id: 8,
  2226. pdev_id: 2,
  2227. host_inspected:1,
  2228. rsvd: 19;
  2229. } htt_tx_tcl_vdev_metadata;
  2230. typedef struct {
  2231. A_UINT32
  2232. type: 1, /* vdev_id based or peer_id based */
  2233. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2234. peer_id: 14,
  2235. rsvd: 16;
  2236. } htt_tx_tcl_peer_metadata;
  2237. PREPACK struct htt_tx_tcl_metadata {
  2238. union {
  2239. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2240. htt_tx_tcl_vdev_metadata vdev_meta;
  2241. htt_tx_tcl_peer_metadata peer_meta;
  2242. };
  2243. } POSTPACK;
  2244. /* DWORD 0 */
  2245. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2246. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2247. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2248. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2249. /* VDEV metadata */
  2250. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2251. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2252. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2253. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2254. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2255. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2256. /* PEER metadata */
  2257. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2258. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2259. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2260. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2261. HTT_TX_TCL_METADATA_TYPE_S)
  2262. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2266. } while (0)
  2267. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2268. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2269. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2270. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2274. } while (0)
  2275. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2276. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2277. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2278. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2282. } while (0)
  2283. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2284. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2285. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2286. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2290. } while (0)
  2291. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2292. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2293. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2294. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2298. } while (0)
  2299. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2300. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2301. HTT_TX_TCL_METADATA_PEER_ID_S)
  2302. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2303. do { \
  2304. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2305. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2306. } while (0)
  2307. /*------------------------------------------------------------------
  2308. * V2 Version of TCL Data Command
  2309. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2310. * MLO global_seq all flavours of TCL Data Cmd.
  2311. *-----------------------------------------------------------------*/
  2312. typedef enum {
  2313. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2314. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2315. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2316. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2317. } htt_tcl_metadata_type_v2;
  2318. /**
  2319. * @brief HTT TCL command number format
  2320. * @details
  2321. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2322. * available to firmware as tcl_exit_base->tcl_status_number.
  2323. * A_UINT32 is used to avoid endianness conversion problems.
  2324. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2325. */
  2326. typedef struct {
  2327. A_UINT32
  2328. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2329. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2330. vdev_id: 8,
  2331. pdev_id: 2,
  2332. host_inspected:1,
  2333. rsvd: 2,
  2334. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2335. } htt_tx_tcl_vdev_metadata_v2;
  2336. typedef struct {
  2337. A_UINT32
  2338. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2339. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2340. peer_id: 13,
  2341. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2342. } htt_tx_tcl_peer_metadata_v2;
  2343. typedef struct {
  2344. A_UINT32
  2345. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2346. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2347. svc_class_id: 8,
  2348. rsvd: 5,
  2349. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2350. } htt_tx_tcl_svc_class_id_metadata;
  2351. typedef struct {
  2352. A_UINT32
  2353. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2354. host_inspected: 1,
  2355. global_seq_no: 12,
  2356. rsvd: 1,
  2357. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2358. } htt_tx_tcl_global_seq_metadata;
  2359. PREPACK struct htt_tx_tcl_metadata_v2 {
  2360. union {
  2361. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2362. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2363. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2364. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2365. };
  2366. } POSTPACK;
  2367. /* DWORD 0 */
  2368. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2369. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2370. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2371. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2372. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2373. /* VDEV V2 metadata */
  2374. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2375. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2376. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2377. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2378. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2379. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2380. /* PEER V2 metadata */
  2381. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2382. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2383. /* SVC_CLASS_ID metadata */
  2384. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2385. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2386. /* Global Seq no metadata */
  2387. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2388. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2389. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2390. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2391. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2392. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2393. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2394. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2395. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2396. do { \
  2397. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2398. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2399. } while (0)
  2400. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2401. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2402. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2403. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2406. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2407. } while (0)
  2408. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2409. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2410. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2411. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2412. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2413. do { \
  2414. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2415. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2416. } while (0)
  2417. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2418. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2419. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2420. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2424. } while (0)
  2425. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2426. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2427. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2428. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2432. } while (0)
  2433. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2434. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2435. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2436. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2437. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2440. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2441. } while (0)
  2442. /*----- Get and Set V2 type field in Service Class fields ----*/
  2443. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2444. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2445. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2446. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2450. } while (0)
  2451. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2452. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2453. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2454. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2455. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2459. } while (0)
  2460. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2461. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2462. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2463. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2466. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2467. } while (0)
  2468. /*------------------------------------------------------------------
  2469. * End V2 Version of TCL Data Command
  2470. *-----------------------------------------------------------------*/
  2471. typedef enum {
  2472. HTT_TX_FW2WBM_TX_STATUS_OK,
  2473. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2474. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2475. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2476. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2477. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2478. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2479. HTT_TX_FW2WBM_TX_STATUS_MAX
  2480. } htt_tx_fw2wbm_tx_status_t;
  2481. typedef enum {
  2482. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2483. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2484. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2485. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2486. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2487. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2488. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2489. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2490. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2491. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2492. } htt_tx_fw2wbm_reinject_reason_t;
  2493. /**
  2494. * @brief HTT TX WBM Completion from firmware to host
  2495. * @details
  2496. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2497. * DWORD 3 and 4 for software based completions (Exception frames and
  2498. * TQM bypass frames)
  2499. * For software based completions, wbm_release_ring->release_source_module will
  2500. * be set to release_source_fw
  2501. */
  2502. PREPACK struct htt_tx_wbm_completion {
  2503. A_UINT32
  2504. sch_cmd_id: 24,
  2505. exception_frame: 1, /* If set, this packet was queued via exception path */
  2506. rsvd0_31_25: 7;
  2507. A_UINT32
  2508. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2509. * reception of an ACK or BA, this field indicates
  2510. * the RSSI of the received ACK or BA frame.
  2511. * When the frame is removed as result of a direct
  2512. * remove command from the SW, this field is set
  2513. * to 0x0 (which is never a valid value when real
  2514. * RSSI is available).
  2515. * Units: dB w.r.t noise floor
  2516. */
  2517. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2518. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2519. rsvd1_31_16: 16;
  2520. } POSTPACK;
  2521. /* DWORD 0 */
  2522. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2523. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2524. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2525. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2526. /* DWORD 1 */
  2527. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2528. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2529. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2530. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2531. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2532. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2533. /* DWORD 0 */
  2534. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2535. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2536. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2537. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2540. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2541. } while (0)
  2542. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2543. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2544. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2545. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2548. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2549. } while (0)
  2550. /* DWORD 1 */
  2551. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2552. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2553. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2554. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2555. do { \
  2556. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2557. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2558. } while (0)
  2559. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2560. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2561. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2562. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2563. do { \
  2564. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2565. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2566. } while (0)
  2567. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2568. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2569. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2570. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2571. do { \
  2572. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2573. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2574. } while (0)
  2575. /**
  2576. * @brief HTT TX WBM Completion from firmware to host
  2577. * @details
  2578. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2579. * (WBM) offload HW.
  2580. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2581. * For software based completions, release_source_module will
  2582. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2583. * struct wbm_release_ring and then switch to this after looking at
  2584. * release_source_module.
  2585. */
  2586. PREPACK struct htt_tx_wbm_completion_v2 {
  2587. A_UINT32
  2588. used_by_hw0; /* Refer to struct wbm_release_ring */
  2589. A_UINT32
  2590. used_by_hw1; /* Refer to struct wbm_release_ring */
  2591. A_UINT32
  2592. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2593. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2594. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2595. exception_frame: 1,
  2596. rsvd0: 12, /* For future use */
  2597. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2598. rsvd1: 1; /* For future use */
  2599. A_UINT32
  2600. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2601. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2602. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2603. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2604. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2605. */
  2606. A_UINT32
  2607. data1: 32;
  2608. A_UINT32
  2609. data2: 32;
  2610. A_UINT32
  2611. used_by_hw3; /* Refer to struct wbm_release_ring */
  2612. } POSTPACK;
  2613. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2614. /* DWORD 3 */
  2615. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2616. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2617. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2618. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2619. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2620. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2621. /* DWORD 3 */
  2622. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2623. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2624. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2625. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2626. do { \
  2627. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2628. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2629. } while (0)
  2630. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2631. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2632. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2633. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2634. do { \
  2635. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2636. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2637. } while (0)
  2638. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2639. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2640. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2641. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2642. do { \
  2643. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2644. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2645. } while (0)
  2646. /**
  2647. * @brief HTT TX WBM Completion from firmware to host (V3)
  2648. * @details
  2649. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2650. * (WBM) offload HW.
  2651. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2652. * For software based completions, release_source_module will
  2653. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2654. * struct wbm_release_ring and then switch to this after looking at
  2655. * release_source_module.
  2656. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2657. * by new generations of targets.
  2658. */
  2659. PREPACK struct htt_tx_wbm_completion_v3 {
  2660. A_UINT32
  2661. used_by_hw0; /* Refer to struct wbm_release_ring */
  2662. A_UINT32
  2663. used_by_hw1; /* Refer to struct wbm_release_ring */
  2664. A_UINT32
  2665. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2666. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2667. used_by_hw3: 15;
  2668. A_UINT32
  2669. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2670. exception_frame: 1,
  2671. rsvd0: 27; /* For future use */
  2672. A_UINT32
  2673. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2674. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2675. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2676. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2677. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2678. */
  2679. A_UINT32
  2680. data1: 32;
  2681. A_UINT32
  2682. data2: 32;
  2683. A_UINT32
  2684. rsvd1: 20,
  2685. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2686. } POSTPACK;
  2687. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2688. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2689. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2690. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2691. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2692. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2693. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2694. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2695. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2696. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2697. do { \
  2698. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2699. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2700. } while (0)
  2701. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2702. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2703. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2704. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2705. do { \
  2706. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2707. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2708. } while (0)
  2709. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2710. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2711. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2712. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2713. do { \
  2714. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2715. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2716. } while (0)
  2717. typedef enum {
  2718. TX_FRAME_TYPE_UNDEFINED = 0,
  2719. TX_FRAME_TYPE_EAPOL = 1,
  2720. } htt_tx_wbm_status_frame_type;
  2721. /**
  2722. * @brief HTT TX WBM transmit status from firmware to host
  2723. * @details
  2724. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2725. * (WBM) offload HW.
  2726. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2727. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2728. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2729. */
  2730. PREPACK struct htt_tx_wbm_transmit_status {
  2731. A_UINT32
  2732. sch_cmd_id: 24,
  2733. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2734. * reception of an ACK or BA, this field indicates
  2735. * the RSSI of the received ACK or BA frame.
  2736. * When the frame is removed as result of a direct
  2737. * remove command from the SW, this field is set
  2738. * to 0x0 (which is never a valid value when real
  2739. * RSSI is available).
  2740. * Units: dB w.r.t noise floor
  2741. */
  2742. A_UINT32
  2743. sw_peer_id: 16,
  2744. tid_num: 5,
  2745. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2746. * and tid_num fields contain valid data.
  2747. * If this "valid" flag is not set, the
  2748. * sw_peer_id and tid_num fields must be ignored.
  2749. */
  2750. mcast: 1,
  2751. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2752. * contains valid data.
  2753. */
  2754. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2755. reserved: 4;
  2756. A_UINT32
  2757. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2758. * packets in the wbm completion path
  2759. */
  2760. } POSTPACK;
  2761. /* DWORD 4 */
  2762. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2763. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2764. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2765. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2766. /* DWORD 5 */
  2767. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2768. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2769. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2770. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2771. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2772. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2774. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2775. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2776. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2777. /* DWORD 4 */
  2778. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2779. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2780. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2781. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2784. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2785. } while (0)
  2786. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2787. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2788. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2789. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2792. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2793. } while (0)
  2794. /* DWORD 5 */
  2795. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2796. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2797. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2798. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2801. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2802. } while (0)
  2803. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2804. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2805. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2806. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2809. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2810. } while (0)
  2811. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2812. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2813. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2814. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2817. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2818. } while (0)
  2819. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2820. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2821. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2822. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2825. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2826. } while (0)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2828. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2829. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2830. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2833. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2834. } while (0)
  2835. /**
  2836. * @brief HTT TX WBM reinject status from firmware to host
  2837. * @details
  2838. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2839. * (WBM) offload HW.
  2840. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2841. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2842. */
  2843. PREPACK struct htt_tx_wbm_reinject_status {
  2844. A_UINT32
  2845. reserved0: 32;
  2846. A_UINT32
  2847. reserved1: 32;
  2848. A_UINT32
  2849. reserved2: 32;
  2850. } POSTPACK;
  2851. /**
  2852. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2853. * @details
  2854. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2855. * (WBM) offload HW.
  2856. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2857. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2858. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2859. * STA side.
  2860. */
  2861. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2862. A_UINT32
  2863. mec_sa_addr_31_0;
  2864. A_UINT32
  2865. mec_sa_addr_47_32: 16,
  2866. sa_ast_index: 16;
  2867. A_UINT32
  2868. vdev_id: 8,
  2869. reserved0: 24;
  2870. } POSTPACK;
  2871. /* DWORD 4 - mec_sa_addr_31_0 */
  2872. /* DWORD 5 */
  2873. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2874. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2875. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2876. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2877. /* DWORD 6 */
  2878. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2879. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2880. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2881. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2882. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2883. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2886. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2887. } while (0)
  2888. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2889. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2890. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2891. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2894. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2895. } while (0)
  2896. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2897. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2898. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2899. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2902. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2903. } while (0)
  2904. typedef enum {
  2905. TX_FLOW_PRIORITY_BE,
  2906. TX_FLOW_PRIORITY_HIGH,
  2907. TX_FLOW_PRIORITY_LOW,
  2908. } htt_tx_flow_priority_t;
  2909. typedef enum {
  2910. TX_FLOW_LATENCY_SENSITIVE,
  2911. TX_FLOW_LATENCY_INSENSITIVE,
  2912. } htt_tx_flow_latency_t;
  2913. typedef enum {
  2914. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2915. TX_FLOW_INTERACTIVE_TRAFFIC,
  2916. TX_FLOW_PERIODIC_TRAFFIC,
  2917. TX_FLOW_BURSTY_TRAFFIC,
  2918. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2919. } htt_tx_flow_traffic_pattern_t;
  2920. /**
  2921. * @brief HTT TX Flow search metadata format
  2922. * @details
  2923. * Host will set this metadata in flow table's flow search entry along with
  2924. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2925. * firmware and TQM ring if the flow search entry wins.
  2926. * This metadata is available to firmware in that first MSDU's
  2927. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2928. * to one of the available flows for specific tid and returns the tqm flow
  2929. * pointer as part of htt_tx_map_flow_info message.
  2930. */
  2931. PREPACK struct htt_tx_flow_metadata {
  2932. A_UINT32
  2933. rsvd0_1_0: 2,
  2934. tid: 4,
  2935. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2936. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2937. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2938. * Else choose final tid based on latency, priority.
  2939. */
  2940. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2941. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2942. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2943. } POSTPACK;
  2944. /* DWORD 0 */
  2945. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2946. #define HTT_TX_FLOW_METADATA_TID_S 2
  2947. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2948. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2949. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2950. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2951. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2952. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2953. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2954. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2955. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2956. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2957. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2958. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2959. /* DWORD 0 */
  2960. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2961. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2962. HTT_TX_FLOW_METADATA_TID_S)
  2963. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2966. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2967. } while (0)
  2968. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2969. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2970. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2971. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2974. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2975. } while (0)
  2976. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2977. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2978. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2979. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2982. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2983. } while (0)
  2984. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2985. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2986. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2987. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2990. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2991. } while (0)
  2992. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2993. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2994. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2995. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2998. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2999. } while (0)
  3000. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3001. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3002. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3003. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3006. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3007. } while (0)
  3008. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3009. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3010. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3011. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3014. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3015. } while (0)
  3016. /**
  3017. * @brief host -> target ADD WDS Entry
  3018. *
  3019. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3020. *
  3021. * @brief host -> target DELETE WDS Entry
  3022. *
  3023. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3024. *
  3025. * @details
  3026. * HTT wds entry from source port learning
  3027. * Host will learn wds entries from rx and send this message to firmware
  3028. * to enable firmware to configure/delete AST entries for wds clients.
  3029. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3030. * and when SA's entry is deleted, firmware removes this AST entry
  3031. *
  3032. * The message would appear as follows:
  3033. *
  3034. * |31 30|29 |17 16|15 8|7 0|
  3035. * |----------------+----------------+----------------+----------------|
  3036. * | rsvd0 |PDVID| vdev_id | msg_type |
  3037. * |-------------------------------------------------------------------|
  3038. * | sa_addr_31_0 |
  3039. * |-------------------------------------------------------------------|
  3040. * | | ta_peer_id | sa_addr_47_32 |
  3041. * |-------------------------------------------------------------------|
  3042. * Where PDVID = pdev_id
  3043. *
  3044. * The message is interpreted as follows:
  3045. *
  3046. * dword0 - b'0:7 - msg_type: This will be set to
  3047. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3048. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3049. *
  3050. * dword0 - b'8:15 - vdev_id
  3051. *
  3052. * dword0 - b'16:17 - pdev_id
  3053. *
  3054. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3055. *
  3056. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3057. *
  3058. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3059. *
  3060. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3061. */
  3062. PREPACK struct htt_wds_entry {
  3063. A_UINT32
  3064. msg_type: 8,
  3065. vdev_id: 8,
  3066. pdev_id: 2,
  3067. rsvd0: 14;
  3068. A_UINT32 sa_addr_31_0;
  3069. A_UINT32
  3070. sa_addr_47_32: 16,
  3071. ta_peer_id: 14,
  3072. rsvd2: 2;
  3073. } POSTPACK;
  3074. /* DWORD 0 */
  3075. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3076. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3077. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3078. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3079. /* DWORD 2 */
  3080. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3081. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3082. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3083. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3084. /* DWORD 0 */
  3085. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3086. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3087. HTT_WDS_ENTRY_VDEV_ID_S)
  3088. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3089. do { \
  3090. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3091. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3092. } while (0)
  3093. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3094. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3095. HTT_WDS_ENTRY_PDEV_ID_S)
  3096. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3099. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3100. } while (0)
  3101. /* DWORD 2 */
  3102. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3103. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3104. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3105. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3106. do { \
  3107. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3108. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3109. } while (0)
  3110. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3111. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3112. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3113. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3114. do { \
  3115. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3116. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3117. } while (0)
  3118. /**
  3119. * @brief MAC DMA rx ring setup specification
  3120. *
  3121. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3122. *
  3123. * @details
  3124. * To allow for dynamic rx ring reconfiguration and to avoid race
  3125. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3126. * it uses. Instead, it sends this message to the target, indicating how
  3127. * the rx ring used by the host should be set up and maintained.
  3128. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3129. * specifications.
  3130. *
  3131. * |31 16|15 8|7 0|
  3132. * |---------------------------------------------------------------|
  3133. * header: | reserved | num rings | msg type |
  3134. * |---------------------------------------------------------------|
  3135. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3136. #if HTT_PADDR64
  3137. * | FW_IDX shadow register physical address (bits 63:32) |
  3138. #endif
  3139. * |---------------------------------------------------------------|
  3140. * | rx ring base physical address (bits 31:0) |
  3141. #if HTT_PADDR64
  3142. * | rx ring base physical address (bits 63:32) |
  3143. #endif
  3144. * |---------------------------------------------------------------|
  3145. * | rx ring buffer size | rx ring length |
  3146. * |---------------------------------------------------------------|
  3147. * | FW_IDX initial value | enabled flags |
  3148. * |---------------------------------------------------------------|
  3149. * | MSDU payload offset | 802.11 header offset |
  3150. * |---------------------------------------------------------------|
  3151. * | PPDU end offset | PPDU start offset |
  3152. * |---------------------------------------------------------------|
  3153. * | MPDU end offset | MPDU start offset |
  3154. * |---------------------------------------------------------------|
  3155. * | MSDU end offset | MSDU start offset |
  3156. * |---------------------------------------------------------------|
  3157. * | frag info offset | rx attention offset |
  3158. * |---------------------------------------------------------------|
  3159. * payload 2, if present, has the same format as payload 1
  3160. * Header fields:
  3161. * - MSG_TYPE
  3162. * Bits 7:0
  3163. * Purpose: identifies this as an rx ring configuration message
  3164. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3165. * - NUM_RINGS
  3166. * Bits 15:8
  3167. * Purpose: indicates whether the host is setting up one rx ring or two
  3168. * Value: 1 or 2
  3169. * Payload:
  3170. * for systems using 64-bit format for bus addresses:
  3171. * - IDX_SHADOW_REG_PADDR_LO
  3172. * Bits 31:0
  3173. * Value: lower 4 bytes of physical address of the host's
  3174. * FW_IDX shadow register
  3175. * - IDX_SHADOW_REG_PADDR_HI
  3176. * Bits 31:0
  3177. * Value: upper 4 bytes of physical address of the host's
  3178. * FW_IDX shadow register
  3179. * - RING_BASE_PADDR_LO
  3180. * Bits 31:0
  3181. * Value: lower 4 bytes of physical address of the host's rx ring
  3182. * - RING_BASE_PADDR_HI
  3183. * Bits 31:0
  3184. * Value: uppper 4 bytes of physical address of the host's rx ring
  3185. * for systems using 32-bit format for bus addresses:
  3186. * - IDX_SHADOW_REG_PADDR
  3187. * Bits 31:0
  3188. * Value: physical address of the host's FW_IDX shadow register
  3189. * - RING_BASE_PADDR
  3190. * Bits 31:0
  3191. * Value: physical address of the host's rx ring
  3192. * - RING_LEN
  3193. * Bits 15:0
  3194. * Value: number of elements in the rx ring
  3195. * - RING_BUF_SZ
  3196. * Bits 31:16
  3197. * Value: size of the buffers referenced by the rx ring, in byte units
  3198. * - ENABLED_FLAGS
  3199. * Bits 15:0
  3200. * Value: 1-bit flags to show whether different rx fields are enabled
  3201. * bit 0: 802.11 header enabled (1) or disabled (0)
  3202. * bit 1: MSDU payload enabled (1) or disabled (0)
  3203. * bit 2: PPDU start enabled (1) or disabled (0)
  3204. * bit 3: PPDU end enabled (1) or disabled (0)
  3205. * bit 4: MPDU start enabled (1) or disabled (0)
  3206. * bit 5: MPDU end enabled (1) or disabled (0)
  3207. * bit 6: MSDU start enabled (1) or disabled (0)
  3208. * bit 7: MSDU end enabled (1) or disabled (0)
  3209. * bit 8: rx attention enabled (1) or disabled (0)
  3210. * bit 9: frag info enabled (1) or disabled (0)
  3211. * bit 10: unicast rx enabled (1) or disabled (0)
  3212. * bit 11: multicast rx enabled (1) or disabled (0)
  3213. * bit 12: ctrl rx enabled (1) or disabled (0)
  3214. * bit 13: mgmt rx enabled (1) or disabled (0)
  3215. * bit 14: null rx enabled (1) or disabled (0)
  3216. * bit 15: phy data rx enabled (1) or disabled (0)
  3217. * - IDX_INIT_VAL
  3218. * Bits 31:16
  3219. * Purpose: Specify the initial value for the FW_IDX.
  3220. * Value: the number of buffers initially present in the host's rx ring
  3221. * - OFFSET_802_11_HDR
  3222. * Bits 15:0
  3223. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3224. * - OFFSET_MSDU_PAYLOAD
  3225. * Bits 31:16
  3226. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3227. * - OFFSET_PPDU_START
  3228. * Bits 15:0
  3229. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3230. * - OFFSET_PPDU_END
  3231. * Bits 31:16
  3232. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3233. * - OFFSET_MPDU_START
  3234. * Bits 15:0
  3235. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3236. * - OFFSET_MPDU_END
  3237. * Bits 31:16
  3238. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3239. * - OFFSET_MSDU_START
  3240. * Bits 15:0
  3241. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3242. * - OFFSET_MSDU_END
  3243. * Bits 31:16
  3244. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3245. * - OFFSET_RX_ATTN
  3246. * Bits 15:0
  3247. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3248. * - OFFSET_FRAG_INFO
  3249. * Bits 31:16
  3250. * Value: offset in QUAD-bytes of frag info table
  3251. */
  3252. /* header fields */
  3253. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3254. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3255. /* payload fields */
  3256. /* for systems using a 64-bit format for bus addresses */
  3257. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3258. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3259. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3260. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3261. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3262. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3263. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3264. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3265. /* for systems using a 32-bit format for bus addresses */
  3266. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3267. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3268. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3269. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3270. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3271. #define HTT_RX_RING_CFG_LEN_S 0
  3272. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3273. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3274. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3275. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3276. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3277. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3278. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3279. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3280. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3281. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3282. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3283. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3284. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3285. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3286. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3287. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3288. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3289. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3290. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3291. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3292. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3293. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3294. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3295. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3296. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3297. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3298. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3299. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3300. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3301. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3302. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3303. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3304. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3305. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3306. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3307. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3308. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3309. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3310. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3311. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3312. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3313. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3314. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3315. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3316. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3317. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3318. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3319. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3320. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3321. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3322. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3323. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3324. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3325. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3326. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3327. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3328. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3329. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3330. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3331. #if HTT_PADDR64
  3332. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3333. #else
  3334. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3335. #endif
  3336. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3337. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3338. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3339. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3340. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3341. do { \
  3342. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3343. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3344. } while (0)
  3345. /* degenerate case for 32-bit fields */
  3346. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3347. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3348. ((_var) = (_val))
  3349. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3351. ((_var) = (_val))
  3352. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3353. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3354. ((_var) = (_val))
  3355. /* degenerate case for 32-bit fields */
  3356. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3357. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3358. ((_var) = (_val))
  3359. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3360. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3361. ((_var) = (_val))
  3362. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3363. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3364. ((_var) = (_val))
  3365. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3366. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3367. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3368. do { \
  3369. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3370. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3371. } while (0)
  3372. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3373. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3374. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3381. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3382. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3389. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3390. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3461. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3462. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3469. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3470. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3477. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3478. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3485. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3486. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3493. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3494. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3501. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3502. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3509. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3510. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3517. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3518. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3538. } while (0)
  3539. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3540. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3541. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3542. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3545. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3546. } while (0)
  3547. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3548. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3549. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3550. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3553. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3554. } while (0)
  3555. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3556. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3557. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3558. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3559. do { \
  3560. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3561. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3562. } while (0)
  3563. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3564. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3565. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3566. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3567. do { \
  3568. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3569. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3570. } while (0)
  3571. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3572. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3573. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3574. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3577. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3578. } while (0)
  3579. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3580. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3581. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3582. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3585. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3586. } while (0)
  3587. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3588. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3589. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3590. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3593. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3594. } while (0)
  3595. /**
  3596. * @brief host -> target FW statistics retrieve
  3597. *
  3598. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3599. *
  3600. * @details
  3601. * The following field definitions describe the format of the HTT host
  3602. * to target FW stats retrieve message. The message specifies the type of
  3603. * stats host wants to retrieve.
  3604. *
  3605. * |31 24|23 16|15 8|7 0|
  3606. * |-----------------------------------------------------------|
  3607. * | stats types request bitmask | msg type |
  3608. * |-----------------------------------------------------------|
  3609. * | stats types reset bitmask | reserved |
  3610. * |-----------------------------------------------------------|
  3611. * | stats type | config value |
  3612. * |-----------------------------------------------------------|
  3613. * | cookie LSBs |
  3614. * |-----------------------------------------------------------|
  3615. * | cookie MSBs |
  3616. * |-----------------------------------------------------------|
  3617. * Header fields:
  3618. * - MSG_TYPE
  3619. * Bits 7:0
  3620. * Purpose: identifies this is a stats upload request message
  3621. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3622. * - UPLOAD_TYPES
  3623. * Bits 31:8
  3624. * Purpose: identifies which types of FW statistics to upload
  3625. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3626. * - RESET_TYPES
  3627. * Bits 31:8
  3628. * Purpose: identifies which types of FW statistics to reset
  3629. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3630. * - CFG_VAL
  3631. * Bits 23:0
  3632. * Purpose: give an opaque configuration value to the specified stats type
  3633. * Value: stats-type specific configuration value
  3634. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3635. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3636. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3637. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3638. * - CFG_STAT_TYPE
  3639. * Bits 31:24
  3640. * Purpose: specify which stats type (if any) the config value applies to
  3641. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3642. * a valid configuration specification
  3643. * - COOKIE_LSBS
  3644. * Bits 31:0
  3645. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3646. * message with its preceding host->target stats request message.
  3647. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3648. * - COOKIE_MSBS
  3649. * Bits 31:0
  3650. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3651. * message with its preceding host->target stats request message.
  3652. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3653. */
  3654. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3655. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3656. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3657. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3658. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3659. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3660. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3661. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3662. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3663. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3664. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3665. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3666. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3667. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3670. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3671. } while (0)
  3672. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3673. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3674. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3675. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3678. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3679. } while (0)
  3680. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3681. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3682. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3683. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3686. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3687. } while (0)
  3688. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3689. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3690. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3691. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3694. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3695. } while (0)
  3696. /**
  3697. * @brief host -> target HTT out-of-band sync request
  3698. *
  3699. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3700. *
  3701. * @details
  3702. * The HTT SYNC tells the target to suspend processing of subsequent
  3703. * HTT host-to-target messages until some other target agent locally
  3704. * informs the target HTT FW that the current sync counter is equal to
  3705. * or greater than (in a modulo sense) the sync counter specified in
  3706. * the SYNC message.
  3707. * This allows other host-target components to synchronize their operation
  3708. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3709. * security key has been downloaded to and activated by the target.
  3710. * In the absence of any explicit synchronization counter value
  3711. * specification, the target HTT FW will use zero as the default current
  3712. * sync value.
  3713. *
  3714. * |31 24|23 16|15 8|7 0|
  3715. * |-----------------------------------------------------------|
  3716. * | reserved | sync count | msg type |
  3717. * |-----------------------------------------------------------|
  3718. * Header fields:
  3719. * - MSG_TYPE
  3720. * Bits 7:0
  3721. * Purpose: identifies this as a sync message
  3722. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3723. * - SYNC_COUNT
  3724. * Bits 15:8
  3725. * Purpose: specifies what sync value the HTT FW will wait for from
  3726. * an out-of-band specification to resume its operation
  3727. * Value: in-band sync counter value to compare against the out-of-band
  3728. * counter spec.
  3729. * The HTT target FW will suspend its host->target message processing
  3730. * as long as
  3731. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3732. */
  3733. #define HTT_H2T_SYNC_MSG_SZ 4
  3734. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3735. #define HTT_H2T_SYNC_COUNT_S 8
  3736. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3737. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3738. HTT_H2T_SYNC_COUNT_S)
  3739. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3740. do { \
  3741. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3742. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3743. } while (0)
  3744. /**
  3745. * @brief host -> target HTT aggregation configuration
  3746. *
  3747. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3748. */
  3749. #define HTT_AGGR_CFG_MSG_SZ 4
  3750. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3751. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3752. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3753. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3754. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3755. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3756. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3760. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3761. } while (0)
  3762. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3763. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3764. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3765. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3768. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3769. } while (0)
  3770. /**
  3771. * @brief host -> target HTT configure max amsdu info per vdev
  3772. *
  3773. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3774. *
  3775. * @details
  3776. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3777. *
  3778. * |31 21|20 16|15 8|7 0|
  3779. * |-----------------------------------------------------------|
  3780. * | reserved | vdev id | max amsdu | msg type |
  3781. * |-----------------------------------------------------------|
  3782. * Header fields:
  3783. * - MSG_TYPE
  3784. * Bits 7:0
  3785. * Purpose: identifies this as a aggr cfg ex message
  3786. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3787. * - MAX_NUM_AMSDU_SUBFRM
  3788. * Bits 15:8
  3789. * Purpose: max MSDUs per A-MSDU
  3790. * - VDEV_ID
  3791. * Bits 20:16
  3792. * Purpose: ID of the vdev to which this limit is applied
  3793. */
  3794. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3795. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3796. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3797. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3798. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3799. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3800. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3801. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3802. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3803. do { \
  3804. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3805. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3806. } while (0)
  3807. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3808. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3809. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3810. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3811. do { \
  3812. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3813. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3814. } while (0)
  3815. /**
  3816. * @brief HTT WDI_IPA Config Message
  3817. *
  3818. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3819. *
  3820. * @details
  3821. * The HTT WDI_IPA config message is created/sent by host at driver
  3822. * init time. It contains information about data structures used on
  3823. * WDI_IPA TX and RX path.
  3824. * TX CE ring is used for pushing packet metadata from IPA uC
  3825. * to WLAN FW
  3826. * TX Completion ring is used for generating TX completions from
  3827. * WLAN FW to IPA uC
  3828. * RX Indication ring is used for indicating RX packets from FW
  3829. * to IPA uC
  3830. * RX Ring2 is used as either completion ring or as second
  3831. * indication ring. when Ring2 is used as completion ring, IPA uC
  3832. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3833. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3834. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3835. * indicated in RX Indication ring. Please see WDI_IPA specification
  3836. * for more details.
  3837. * |31 24|23 16|15 8|7 0|
  3838. * |----------------+----------------+----------------+----------------|
  3839. * | tx pkt pool size | Rsvd | msg_type |
  3840. * |-------------------------------------------------------------------|
  3841. * | tx comp ring base (bits 31:0) |
  3842. #if HTT_PADDR64
  3843. * | tx comp ring base (bits 63:32) |
  3844. #endif
  3845. * |-------------------------------------------------------------------|
  3846. * | tx comp ring size |
  3847. * |-------------------------------------------------------------------|
  3848. * | tx comp WR_IDX physical address (bits 31:0) |
  3849. #if HTT_PADDR64
  3850. * | tx comp WR_IDX physical address (bits 63:32) |
  3851. #endif
  3852. * |-------------------------------------------------------------------|
  3853. * | tx CE WR_IDX physical address (bits 31:0) |
  3854. #if HTT_PADDR64
  3855. * | tx CE WR_IDX physical address (bits 63:32) |
  3856. #endif
  3857. * |-------------------------------------------------------------------|
  3858. * | rx indication ring base (bits 31:0) |
  3859. #if HTT_PADDR64
  3860. * | rx indication ring base (bits 63:32) |
  3861. #endif
  3862. * |-------------------------------------------------------------------|
  3863. * | rx indication ring size |
  3864. * |-------------------------------------------------------------------|
  3865. * | rx ind RD_IDX physical address (bits 31:0) |
  3866. #if HTT_PADDR64
  3867. * | rx ind RD_IDX physical address (bits 63:32) |
  3868. #endif
  3869. * |-------------------------------------------------------------------|
  3870. * | rx ind WR_IDX physical address (bits 31:0) |
  3871. #if HTT_PADDR64
  3872. * | rx ind WR_IDX physical address (bits 63:32) |
  3873. #endif
  3874. * |-------------------------------------------------------------------|
  3875. * |-------------------------------------------------------------------|
  3876. * | rx ring2 base (bits 31:0) |
  3877. #if HTT_PADDR64
  3878. * | rx ring2 base (bits 63:32) |
  3879. #endif
  3880. * |-------------------------------------------------------------------|
  3881. * | rx ring2 size |
  3882. * |-------------------------------------------------------------------|
  3883. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3884. #if HTT_PADDR64
  3885. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3886. #endif
  3887. * |-------------------------------------------------------------------|
  3888. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3889. #if HTT_PADDR64
  3890. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3891. #endif
  3892. * |-------------------------------------------------------------------|
  3893. *
  3894. * Header fields:
  3895. * Header fields:
  3896. * - MSG_TYPE
  3897. * Bits 7:0
  3898. * Purpose: Identifies this as WDI_IPA config message
  3899. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3900. * - TX_PKT_POOL_SIZE
  3901. * Bits 15:0
  3902. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3903. * WDI_IPA TX path
  3904. * For systems using 32-bit format for bus addresses:
  3905. * - TX_COMP_RING_BASE_ADDR
  3906. * Bits 31:0
  3907. * Purpose: TX Completion Ring base address in DDR
  3908. * - TX_COMP_RING_SIZE
  3909. * Bits 31:0
  3910. * Purpose: TX Completion Ring size (must be power of 2)
  3911. * - TX_COMP_WR_IDX_ADDR
  3912. * Bits 31:0
  3913. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3914. * updates the Write Index for WDI_IPA TX completion ring
  3915. * - TX_CE_WR_IDX_ADDR
  3916. * Bits 31:0
  3917. * Purpose: DDR address where IPA uC
  3918. * updates the WR Index for TX CE ring
  3919. * (needed for fusion platforms)
  3920. * - RX_IND_RING_BASE_ADDR
  3921. * Bits 31:0
  3922. * Purpose: RX Indication Ring base address in DDR
  3923. * - RX_IND_RING_SIZE
  3924. * Bits 31:0
  3925. * Purpose: RX Indication Ring size
  3926. * - RX_IND_RD_IDX_ADDR
  3927. * Bits 31:0
  3928. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3929. * RX indication ring
  3930. * - RX_IND_WR_IDX_ADDR
  3931. * Bits 31:0
  3932. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3933. * updates the Write Index for WDI_IPA RX indication ring
  3934. * - RX_RING2_BASE_ADDR
  3935. * Bits 31:0
  3936. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3937. * - RX_RING2_SIZE
  3938. * Bits 31:0
  3939. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3940. * - RX_RING2_RD_IDX_ADDR
  3941. * Bits 31:0
  3942. * Purpose: If Second RX ring is Indication ring, DDR address where
  3943. * IPA uC updates the Read Index for Ring2.
  3944. * If Second RX ring is completion ring, this is NOT used
  3945. * - RX_RING2_WR_IDX_ADDR
  3946. * Bits 31:0
  3947. * Purpose: If Second RX ring is Indication ring, DDR address where
  3948. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3949. * If second RX ring is completion ring, DDR address where
  3950. * IPA uC updates the Write Index for Ring 2.
  3951. * For systems using 64-bit format for bus addresses:
  3952. * - TX_COMP_RING_BASE_ADDR_LO
  3953. * Bits 31:0
  3954. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3955. * - TX_COMP_RING_BASE_ADDR_HI
  3956. * Bits 31:0
  3957. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3958. * - TX_COMP_RING_SIZE
  3959. * Bits 31:0
  3960. * Purpose: TX Completion Ring size (must be power of 2)
  3961. * - TX_COMP_WR_IDX_ADDR_LO
  3962. * Bits 31:0
  3963. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3964. * Lower 4 bytes of DDR address where WIFI FW
  3965. * updates the Write Index for WDI_IPA TX completion ring
  3966. * - TX_COMP_WR_IDX_ADDR_HI
  3967. * Bits 31:0
  3968. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3969. * Higher 4 bytes of DDR address where WIFI FW
  3970. * updates the Write Index for WDI_IPA TX completion ring
  3971. * - TX_CE_WR_IDX_ADDR_LO
  3972. * Bits 31:0
  3973. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3974. * updates the WR Index for TX CE ring
  3975. * (needed for fusion platforms)
  3976. * - TX_CE_WR_IDX_ADDR_HI
  3977. * Bits 31:0
  3978. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3979. * updates the WR Index for TX CE ring
  3980. * (needed for fusion platforms)
  3981. * - RX_IND_RING_BASE_ADDR_LO
  3982. * Bits 31:0
  3983. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3984. * - RX_IND_RING_BASE_ADDR_HI
  3985. * Bits 31:0
  3986. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3987. * - RX_IND_RING_SIZE
  3988. * Bits 31:0
  3989. * Purpose: RX Indication Ring size
  3990. * - RX_IND_RD_IDX_ADDR_LO
  3991. * Bits 31:0
  3992. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3993. * for WDI_IPA RX indication ring
  3994. * - RX_IND_RD_IDX_ADDR_HI
  3995. * Bits 31:0
  3996. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3997. * for WDI_IPA RX indication ring
  3998. * - RX_IND_WR_IDX_ADDR_LO
  3999. * Bits 31:0
  4000. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4001. * Lower 4 bytes of DDR address where WIFI FW
  4002. * updates the Write Index for WDI_IPA RX indication ring
  4003. * - RX_IND_WR_IDX_ADDR_HI
  4004. * Bits 31:0
  4005. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4006. * Higher 4 bytes of DDR address where WIFI FW
  4007. * updates the Write Index for WDI_IPA RX indication ring
  4008. * - RX_RING2_BASE_ADDR_LO
  4009. * Bits 31:0
  4010. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4011. * - RX_RING2_BASE_ADDR_HI
  4012. * Bits 31:0
  4013. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4014. * - RX_RING2_SIZE
  4015. * Bits 31:0
  4016. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4017. * - RX_RING2_RD_IDX_ADDR_LO
  4018. * Bits 31:0
  4019. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4020. * DDR address where IPA uC updates the Read Index for Ring2.
  4021. * If Second RX ring is completion ring, this is NOT used
  4022. * - RX_RING2_RD_IDX_ADDR_HI
  4023. * Bits 31:0
  4024. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4025. * DDR address where IPA uC updates the Read Index for Ring2.
  4026. * If Second RX ring is completion ring, this is NOT used
  4027. * - RX_RING2_WR_IDX_ADDR_LO
  4028. * Bits 31:0
  4029. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4030. * DDR address where WIFI FW updates the Write Index
  4031. * for WDI_IPA RX ring2
  4032. * If second RX ring is completion ring, lower 4 bytes of
  4033. * DDR address where IPA uC updates the Write Index for Ring 2.
  4034. * - RX_RING2_WR_IDX_ADDR_HI
  4035. * Bits 31:0
  4036. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4037. * DDR address where WIFI FW updates the Write Index
  4038. * for WDI_IPA RX ring2
  4039. * If second RX ring is completion ring, higher 4 bytes of
  4040. * DDR address where IPA uC updates the Write Index for Ring 2.
  4041. */
  4042. #if HTT_PADDR64
  4043. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4044. #else
  4045. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4046. #endif
  4047. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4048. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4109. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4110. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4111. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4114. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4115. } while (0)
  4116. /* for systems using 32-bit format for bus addr */
  4117. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4118. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4119. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4122. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4123. } while (0)
  4124. /* for systems using 64-bit format for bus addr */
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4126. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4130. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4131. } while (0)
  4132. /* for systems using 64-bit format for bus addr */
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4134. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4135. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4138. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4139. } while (0)
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4142. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4146. } while (0)
  4147. /* for systems using 32-bit format for bus addr */
  4148. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4150. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4154. } while (0)
  4155. /* for systems using 64-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4158. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4162. } while (0)
  4163. /* for systems using 64-bit format for bus addr */
  4164. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4166. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4170. } while (0)
  4171. /* for systems using 32-bit format for bus addr */
  4172. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4174. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4178. } while (0)
  4179. /* for systems using 64-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4182. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4186. } while (0)
  4187. /* for systems using 64-bit format for bus addr */
  4188. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4189. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4190. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4193. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4194. } while (0)
  4195. /* for systems using 32-bit format for bus addr */
  4196. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4197. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4198. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4201. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4202. } while (0)
  4203. /* for systems using 64-bit format for bus addr */
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4210. } while (0)
  4211. /* for systems using 64-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4218. } while (0)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4221. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4225. } while (0)
  4226. /* for systems using 32-bit format for bus addr */
  4227. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4229. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4233. } while (0)
  4234. /* for systems using 64-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4237. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4241. } while (0)
  4242. /* for systems using 64-bit format for bus addr */
  4243. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4244. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4245. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4249. } while (0)
  4250. /* for systems using 32-bit format for bus addr */
  4251. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4252. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4253. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4256. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4257. } while (0)
  4258. /* for systems using 64-bit format for bus addr */
  4259. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4260. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4261. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4264. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4265. } while (0)
  4266. /* for systems using 64-bit format for bus addr */
  4267. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4268. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4269. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4272. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4273. } while (0)
  4274. /* for systems using 32-bit format for bus addr */
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4276. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4277. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4278. do { \
  4279. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4280. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4281. } while (0)
  4282. /* for systems using 64-bit format for bus addr */
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4289. } while (0)
  4290. /* for systems using 64-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4297. } while (0)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4299. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4303. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4304. } while (0)
  4305. /* for systems using 32-bit format for bus addr */
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4307. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4311. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4312. } while (0)
  4313. /* for systems using 64-bit format for bus addr */
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4315. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4319. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4320. } while (0)
  4321. /* for systems using 64-bit format for bus addr */
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4323. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4324. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4325. do { \
  4326. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4327. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4328. } while (0)
  4329. /* for systems using 32-bit format for bus addr */
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4331. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4335. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4336. } while (0)
  4337. /* for systems using 64-bit format for bus addr */
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4339. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4340. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4343. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4344. } while (0)
  4345. /* for systems using 64-bit format for bus addr */
  4346. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4347. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4348. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4351. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4352. } while (0)
  4353. /*
  4354. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4355. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4356. * addresses are stored in a XXX-bit field.
  4357. * This macro is used to define both htt_wdi_ipa_config32_t and
  4358. * htt_wdi_ipa_config64_t structs.
  4359. */
  4360. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4361. _paddr__tx_comp_ring_base_addr_, \
  4362. _paddr__tx_comp_wr_idx_addr_, \
  4363. _paddr__tx_ce_wr_idx_addr_, \
  4364. _paddr__rx_ind_ring_base_addr_, \
  4365. _paddr__rx_ind_rd_idx_addr_, \
  4366. _paddr__rx_ind_wr_idx_addr_, \
  4367. _paddr__rx_ring2_base_addr_,\
  4368. _paddr__rx_ring2_rd_idx_addr_,\
  4369. _paddr__rx_ring2_wr_idx_addr_) \
  4370. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4371. { \
  4372. /* DWORD 0: flags and meta-data */ \
  4373. A_UINT32 \
  4374. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4375. reserved: 8, \
  4376. tx_pkt_pool_size: 16;\
  4377. /* DWORD 1 */\
  4378. _paddr__tx_comp_ring_base_addr_;\
  4379. /* DWORD 2 (or 3)*/\
  4380. A_UINT32 tx_comp_ring_size;\
  4381. /* DWORD 3 (or 4)*/\
  4382. _paddr__tx_comp_wr_idx_addr_;\
  4383. /* DWORD 4 (or 6)*/\
  4384. _paddr__tx_ce_wr_idx_addr_;\
  4385. /* DWORD 5 (or 8)*/\
  4386. _paddr__rx_ind_ring_base_addr_;\
  4387. /* DWORD 6 (or 10)*/\
  4388. A_UINT32 rx_ind_ring_size;\
  4389. /* DWORD 7 (or 11)*/\
  4390. _paddr__rx_ind_rd_idx_addr_;\
  4391. /* DWORD 8 (or 13)*/\
  4392. _paddr__rx_ind_wr_idx_addr_;\
  4393. /* DWORD 9 (or 15)*/\
  4394. _paddr__rx_ring2_base_addr_;\
  4395. /* DWORD 10 (or 17) */\
  4396. A_UINT32 rx_ring2_size;\
  4397. /* DWORD 11 (or 18) */\
  4398. _paddr__rx_ring2_rd_idx_addr_;\
  4399. /* DWORD 12 (or 20) */\
  4400. _paddr__rx_ring2_wr_idx_addr_;\
  4401. } POSTPACK
  4402. /* define a htt_wdi_ipa_config32_t type */
  4403. 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));
  4404. /* define a htt_wdi_ipa_config64_t type */
  4405. 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));
  4406. #if HTT_PADDR64
  4407. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4408. #else
  4409. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4410. #endif
  4411. enum htt_wdi_ipa_op_code {
  4412. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4413. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4414. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4415. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4416. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4417. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4418. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4419. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4420. /* keep this last */
  4421. HTT_WDI_IPA_OPCODE_MAX
  4422. };
  4423. /**
  4424. * @brief HTT WDI_IPA Operation Request Message
  4425. *
  4426. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4427. *
  4428. * @details
  4429. * HTT WDI_IPA Operation Request message is sent by host
  4430. * to either suspend or resume WDI_IPA TX or RX path.
  4431. * |31 24|23 16|15 8|7 0|
  4432. * |----------------+----------------+----------------+----------------|
  4433. * | op_code | Rsvd | msg_type |
  4434. * |-------------------------------------------------------------------|
  4435. *
  4436. * Header fields:
  4437. * - MSG_TYPE
  4438. * Bits 7:0
  4439. * Purpose: Identifies this as WDI_IPA Operation Request message
  4440. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4441. * - OP_CODE
  4442. * Bits 31:16
  4443. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4444. * value: = enum htt_wdi_ipa_op_code
  4445. */
  4446. PREPACK struct htt_wdi_ipa_op_request_t
  4447. {
  4448. /* DWORD 0: flags and meta-data */
  4449. A_UINT32
  4450. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4451. reserved: 8,
  4452. op_code: 16;
  4453. } POSTPACK;
  4454. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4455. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4456. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4457. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4458. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4459. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4460. do { \
  4461. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4462. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4463. } while (0)
  4464. /*
  4465. * @brief host -> target HTT_MSI_SETUP message
  4466. *
  4467. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4468. *
  4469. * @details
  4470. * After target is booted up, host can send MSI setup message so that
  4471. * target sets up HW registers based on setup message.
  4472. *
  4473. * The message would appear as follows:
  4474. * |31 24|23 16|15|14 8|7 0|
  4475. * |---------------+-----------------+-----------------+-----------------|
  4476. * | reserved | msi_type | pdev_id | msg_type |
  4477. * |---------------------------------------------------------------------|
  4478. * | msi_addr_lo |
  4479. * |---------------------------------------------------------------------|
  4480. * | msi_addr_hi |
  4481. * |---------------------------------------------------------------------|
  4482. * | msi_data |
  4483. * |---------------------------------------------------------------------|
  4484. *
  4485. * The message is interpreted as follows:
  4486. * dword0 - b'0:7 - msg_type: This will be set to
  4487. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4488. * b'8:15 - pdev_id:
  4489. * 0 (for rings at SOC/UMAC level),
  4490. * 1/2/3 mac id (for rings at LMAC level)
  4491. * b'16:23 - msi_type: identify which msi registers need to be setup
  4492. * more details can be got from enum htt_msi_setup_type
  4493. * b'24:31 - reserved
  4494. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4495. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4496. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4497. */
  4498. PREPACK struct htt_msi_setup_t {
  4499. A_UINT32 msg_type: 8,
  4500. pdev_id: 8,
  4501. msi_type: 8,
  4502. reserved: 8;
  4503. A_UINT32 msi_addr_lo;
  4504. A_UINT32 msi_addr_hi;
  4505. A_UINT32 msi_data;
  4506. } POSTPACK;
  4507. enum htt_msi_setup_type {
  4508. HTT_PPDU_END_MSI_SETUP_TYPE,
  4509. /* Insert new types here*/
  4510. };
  4511. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4512. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4513. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4514. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4515. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4516. HTT_MSI_SETUP_PDEV_ID_S)
  4517. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4518. do { \
  4519. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4520. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4521. } while (0)
  4522. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4523. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4524. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4525. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4526. HTT_MSI_SETUP_MSI_TYPE_S)
  4527. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4528. do { \
  4529. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4530. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4531. } while (0)
  4532. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4533. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4534. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4535. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4536. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4537. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4538. do { \
  4539. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4540. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4541. } while (0)
  4542. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4543. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4544. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4545. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4546. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4547. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4548. do { \
  4549. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4550. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4551. } while (0)
  4552. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4553. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4554. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4555. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4556. HTT_MSI_SETUP_MSI_DATA_S)
  4557. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4558. do { \
  4559. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4560. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4561. } while (0)
  4562. /*
  4563. * @brief host -> target HTT_SRING_SETUP message
  4564. *
  4565. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4566. *
  4567. * @details
  4568. * After target is booted up, Host can send SRING setup message for
  4569. * each host facing LMAC SRING. Target setups up HW registers based
  4570. * on setup message and confirms back to Host if response_required is set.
  4571. * Host should wait for confirmation message before sending new SRING
  4572. * setup message
  4573. *
  4574. * The message would appear as follows:
  4575. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4576. * |--------------- +-----------------+-----------------+-----------------|
  4577. * | ring_type | ring_id | pdev_id | msg_type |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_base_addr_lo |
  4580. * |----------------------------------------------------------------------|
  4581. * | ring_base_addr_hi |
  4582. * |----------------------------------------------------------------------|
  4583. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_head_offset32_remote_addr_lo |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_head_offset32_remote_addr_hi |
  4588. * |----------------------------------------------------------------------|
  4589. * | ring_tail_offset32_remote_addr_lo |
  4590. * |----------------------------------------------------------------------|
  4591. * | ring_tail_offset32_remote_addr_hi |
  4592. * |----------------------------------------------------------------------|
  4593. * | ring_msi_addr_lo |
  4594. * |----------------------------------------------------------------------|
  4595. * | ring_msi_addr_hi |
  4596. * |----------------------------------------------------------------------|
  4597. * | ring_msi_data |
  4598. * |----------------------------------------------------------------------|
  4599. * | intr_timer_th |IM| intr_batch_counter_th |
  4600. * |----------------------------------------------------------------------|
  4601. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4602. * |----------------------------------------------------------------------|
  4603. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4604. * |----------------------------------------------------------------------|
  4605. * Where
  4606. * IM = sw_intr_mode
  4607. * RR = response_required
  4608. * PTCF = prefetch_timer_cfg
  4609. * IP = IPA drop flag
  4610. *
  4611. * The message is interpreted as follows:
  4612. * dword0 - b'0:7 - msg_type: This will be set to
  4613. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4614. * b'8:15 - pdev_id:
  4615. * 0 (for rings at SOC/UMAC level),
  4616. * 1/2/3 mac id (for rings at LMAC level)
  4617. * b'16:23 - ring_id: identify which ring is to setup,
  4618. * more details can be got from enum htt_srng_ring_id
  4619. * b'24:31 - ring_type: identify type of host rings,
  4620. * more details can be got from enum htt_srng_ring_type
  4621. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4622. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4623. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4624. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4625. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4626. * SW_TO_HW_RING.
  4627. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4628. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4629. * Lower 32 bits of memory address of the remote variable
  4630. * storing the 4-byte word offset that identifies the head
  4631. * element within the ring.
  4632. * (The head offset variable has type A_UINT32.)
  4633. * Valid for HW_TO_SW and SW_TO_SW rings.
  4634. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4635. * Upper 32 bits of memory address of the remote variable
  4636. * storing the 4-byte word offset that identifies the head
  4637. * element within the ring.
  4638. * (The head offset variable has type A_UINT32.)
  4639. * Valid for HW_TO_SW and SW_TO_SW rings.
  4640. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4641. * Lower 32 bits of memory address of the remote variable
  4642. * storing the 4-byte word offset that identifies the tail
  4643. * element within the ring.
  4644. * (The tail offset variable has type A_UINT32.)
  4645. * Valid for HW_TO_SW and SW_TO_SW rings.
  4646. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4647. * Upper 32 bits of memory address of the remote variable
  4648. * storing the 4-byte word offset that identifies the tail
  4649. * element within the ring.
  4650. * (The tail offset variable has type A_UINT32.)
  4651. * Valid for HW_TO_SW and SW_TO_SW rings.
  4652. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4653. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4654. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4655. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4656. * dword10 - b'0:31 - ring_msi_data: MSI data
  4657. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4658. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4659. * dword11 - b'0:14 - intr_batch_counter_th:
  4660. * batch counter threshold is in units of 4-byte words.
  4661. * HW internally maintains and increments batch count.
  4662. * (see SRING spec for detail description).
  4663. * When batch count reaches threshold value, an interrupt
  4664. * is generated by HW.
  4665. * b'15 - sw_intr_mode:
  4666. * This configuration shall be static.
  4667. * Only programmed at power up.
  4668. * 0: generate pulse style sw interrupts
  4669. * 1: generate level style sw interrupts
  4670. * b'16:31 - intr_timer_th:
  4671. * The timer init value when timer is idle or is
  4672. * initialized to start downcounting.
  4673. * In 8us units (to cover a range of 0 to 524 ms)
  4674. * dword12 - b'0:15 - intr_low_threshold:
  4675. * Used only by Consumer ring to generate ring_sw_int_p.
  4676. * Ring entries low threshold water mark, that is used
  4677. * in combination with the interrupt timer as well as
  4678. * the the clearing of the level interrupt.
  4679. * b'16:18 - prefetch_timer_cfg:
  4680. * Used only by Consumer ring to set timer mode to
  4681. * support Application prefetch handling.
  4682. * The external tail offset/pointer will be updated
  4683. * at following intervals:
  4684. * 3'b000: (Prefetch feature disabled; used only for debug)
  4685. * 3'b001: 1 usec
  4686. * 3'b010: 4 usec
  4687. * 3'b011: 8 usec (default)
  4688. * 3'b100: 16 usec
  4689. * Others: Reserved
  4690. * b'19 - response_required:
  4691. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4692. * b'20 - ipa_drop_flag:
  4693. Indicates that host will config ipa drop threshold percentage
  4694. * b'21:31 - reserved: reserved for future use
  4695. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4696. * b'8:15 - ipa drop high threshold percentage:
  4697. * b'16:31 - Reserved
  4698. */
  4699. PREPACK struct htt_sring_setup_t {
  4700. A_UINT32 msg_type: 8,
  4701. pdev_id: 8,
  4702. ring_id: 8,
  4703. ring_type: 8;
  4704. A_UINT32 ring_base_addr_lo;
  4705. A_UINT32 ring_base_addr_hi;
  4706. A_UINT32 ring_size: 16,
  4707. ring_entry_size: 8,
  4708. ring_misc_cfg_flag: 8;
  4709. A_UINT32 ring_head_offset32_remote_addr_lo;
  4710. A_UINT32 ring_head_offset32_remote_addr_hi;
  4711. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4712. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4713. A_UINT32 ring_msi_addr_lo;
  4714. A_UINT32 ring_msi_addr_hi;
  4715. A_UINT32 ring_msi_data;
  4716. A_UINT32 intr_batch_counter_th: 15,
  4717. sw_intr_mode: 1,
  4718. intr_timer_th: 16;
  4719. A_UINT32 intr_low_threshold: 16,
  4720. prefetch_timer_cfg: 3,
  4721. response_required: 1,
  4722. ipa_drop_flag: 1,
  4723. reserved1: 11;
  4724. A_UINT32 ipa_drop_low_threshold: 8,
  4725. ipa_drop_high_threshold: 8,
  4726. reserved: 16;
  4727. } POSTPACK;
  4728. enum htt_srng_ring_type {
  4729. HTT_HW_TO_SW_RING = 0,
  4730. HTT_SW_TO_HW_RING,
  4731. HTT_SW_TO_SW_RING,
  4732. /* Insert new ring types above this line */
  4733. };
  4734. enum htt_srng_ring_id {
  4735. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4736. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4737. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4738. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4739. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4740. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4741. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4742. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4743. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4744. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4745. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4746. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4747. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4748. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4749. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4750. /* Add Other SRING which can't be directly configured by host software above this line */
  4751. };
  4752. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4753. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4754. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4755. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4756. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4757. HTT_SRING_SETUP_PDEV_ID_S)
  4758. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4761. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4762. } while (0)
  4763. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4764. #define HTT_SRING_SETUP_RING_ID_S 16
  4765. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4766. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4767. HTT_SRING_SETUP_RING_ID_S)
  4768. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4771. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4772. } while (0)
  4773. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4774. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4775. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4776. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4777. HTT_SRING_SETUP_RING_TYPE_S)
  4778. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4781. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4782. } while (0)
  4783. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4784. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4785. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4786. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4787. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4789. do { \
  4790. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4791. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4792. } while (0)
  4793. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4794. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4795. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4796. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4797. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4798. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4801. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4802. } while (0)
  4803. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4804. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4805. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4806. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4807. HTT_SRING_SETUP_RING_SIZE_S)
  4808. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4809. do { \
  4810. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4811. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4812. } while (0)
  4813. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4814. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4815. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4816. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4817. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4818. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4819. do { \
  4820. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4821. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4822. } while (0)
  4823. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4824. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4825. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4826. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4827. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4828. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4829. do { \
  4830. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4831. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4832. } while (0)
  4833. /* This control bit is applicable to only Producer, which updates Ring ID field
  4834. * of each descriptor before pushing into the ring.
  4835. * 0: updates ring_id(default)
  4836. * 1: ring_id updating disabled */
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4840. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4841. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4843. do { \
  4844. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4845. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4846. } while (0)
  4847. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4848. * of each descriptor before pushing into the ring.
  4849. * 0: updates Loopcnt(default)
  4850. * 1: Loopcnt updating disabled */
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4854. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4855. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4857. do { \
  4858. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4859. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4860. } while (0)
  4861. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4862. * into security_id port of GXI/AXI. */
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4867. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4872. } while (0)
  4873. /* During MSI write operation, SRNG drives value of this register bit into
  4874. * swap bit of GXI/AXI. */
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4876. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4878. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4879. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4883. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4884. } while (0)
  4885. /* During Pointer write operation, SRNG drives value of this register bit into
  4886. * swap bit of GXI/AXI. */
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4890. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4891. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4893. do { \
  4894. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4895. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4896. } while (0)
  4897. /* During any data or TLV write operation, SRNG drives value of this register
  4898. * bit into swap bit of GXI/AXI. */
  4899. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4901. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4902. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4903. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4904. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4905. do { \
  4906. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4907. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4908. } while (0)
  4909. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4910. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4911. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4912. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4913. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4914. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4915. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4919. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4920. } while (0)
  4921. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4922. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4923. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4924. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4925. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4926. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4927. do { \
  4928. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4929. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4930. } while (0)
  4931. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4932. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4933. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4934. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4935. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4939. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4940. } while (0)
  4941. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4942. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4943. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4944. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4945. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4946. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4949. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4950. } while (0)
  4951. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4952. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4953. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4954. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4955. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4957. do { \
  4958. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4959. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4960. } while (0)
  4961. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4962. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4963. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4964. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4965. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4966. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4969. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4970. } while (0)
  4971. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4972. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4973. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4974. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4975. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4976. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4979. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4980. } while (0)
  4981. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4982. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4983. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4984. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4985. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4986. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4987. do { \
  4988. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4989. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4990. } while (0)
  4991. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4992. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4993. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4994. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4995. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4996. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4997. do { \
  4998. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4999. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5000. } while (0)
  5001. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5002. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5003. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5004. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5005. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5006. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5007. do { \
  5008. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5009. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5010. } while (0)
  5011. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5012. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5013. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5014. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5015. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5016. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5017. do { \
  5018. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5019. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5020. } while (0)
  5021. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5022. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5023. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5024. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5025. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5026. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5027. do { \
  5028. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5029. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5030. } while (0)
  5031. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5032. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5033. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5034. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5035. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5036. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5037. do { \
  5038. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5039. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5040. } while (0)
  5041. /**
  5042. * @brief host -> target RX ring selection config message
  5043. *
  5044. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5045. *
  5046. * @details
  5047. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5048. * configure RXDMA rings.
  5049. * The configuration is per ring based and includes both packet subtypes
  5050. * and PPDU/MPDU TLVs.
  5051. *
  5052. * The message would appear as follows:
  5053. *
  5054. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5055. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5056. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5057. * |-----------------------+-----+-----+--------------------------------|
  5058. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5059. * |--------------------------------------------------------------------|
  5060. * | packet_type_enable_flags_0 |
  5061. * |--------------------------------------------------------------------|
  5062. * | packet_type_enable_flags_1 |
  5063. * |--------------------------------------------------------------------|
  5064. * | packet_type_enable_flags_2 |
  5065. * |--------------------------------------------------------------------|
  5066. * | packet_type_enable_flags_3 |
  5067. * |--------------------------------------------------------------------|
  5068. * | tlv_filter_in_flags |
  5069. * |-----------------------------------+--------------------------------|
  5070. * | rx_header_offset | rx_packet_offset |
  5071. * |-----------------------------------+--------------------------------|
  5072. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5073. * |-----------------------------------+--------------------------------|
  5074. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5075. * |-----------------------------------+--------------------------------|
  5076. * | rsvd3 | rx_attention_offset |
  5077. * |--------------------------------------------------------------------|
  5078. * | rsvd4 | mo| fp| rx_drop_threshold |
  5079. * | |ndp|ndp| |
  5080. * |--------------------------------------------------------------------|
  5081. * Where:
  5082. * PS = pkt_swap
  5083. * SS = status_swap
  5084. * OV = rx_offsets_valid
  5085. * DT = drop_thresh_valid
  5086. * CLM = config_length_mgmt
  5087. * CLC = config_length_ctrl
  5088. * CLD = config_length_data
  5089. * RXHDL = rx_hdr_len
  5090. * RX = rxpcu_filter_enable_flag
  5091. * The message is interpreted as follows:
  5092. * dword0 - b'0:7 - msg_type: This will be set to
  5093. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5094. * b'8:15 - pdev_id:
  5095. * 0 (for rings at SOC/UMAC level),
  5096. * 1/2/3 mac id (for rings at LMAC level)
  5097. * b'16:23 - ring_id : Identify the ring to configure.
  5098. * More details can be got from enum htt_srng_ring_id
  5099. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5100. * BUF_RING_CFG_0 defs within HW .h files,
  5101. * e.g. wmac_top_reg_seq_hwioreg.h
  5102. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5103. * BUF_RING_CFG_0 defs within HW .h files,
  5104. * e.g. wmac_top_reg_seq_hwioreg.h
  5105. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5106. * configuration fields are valid
  5107. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5108. * rx_drop_threshold field is valid
  5109. * b'28 - rx_mon_global_en: Enable/Disable global register
  5110. 8 configuration in Rx monitor module.
  5111. * b'29:31 - rsvd1: reserved for future use
  5112. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5113. * in byte units.
  5114. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5115. * b'16:18 - config_length_mgmt (MGMT):
  5116. * Represents the length of mpdu bytes for mgmt pkt.
  5117. * valid values:
  5118. * 001 - 64bytes
  5119. * 010 - 128bytes
  5120. * 100 - 256bytes
  5121. * 111 - Full mpdu bytes
  5122. * b'19:21 - config_length_ctrl (CTRL):
  5123. * Represents the length of mpdu bytes for ctrl pkt.
  5124. * valid values:
  5125. * 001 - 64bytes
  5126. * 010 - 128bytes
  5127. * 100 - 256bytes
  5128. * 111 - Full mpdu bytes
  5129. * b'22:24 - config_length_data (DATA):
  5130. * Represents the length of mpdu bytes for data pkt.
  5131. * valid values:
  5132. * 001 - 64bytes
  5133. * 010 - 128bytes
  5134. * 100 - 256bytes
  5135. * 111 - Full mpdu bytes
  5136. * b'25:26 - rx_hdr_len:
  5137. * Specifies the number of bytes of recvd packet to copy
  5138. * into the rx_hdr tlv.
  5139. * supported values for now by host:
  5140. * 01 - 64bytes
  5141. * 10 - 128bytes
  5142. * 11 - 256bytes
  5143. * default - 128 bytes
  5144. * b'27 - rxpcu_filter_enable_flag
  5145. * For Scan Radio Host CPU utilization is very high.
  5146. * In order to reduce CPU utilization we need to filter out
  5147. * certain configured MAC frames.
  5148. * To filter out configured MAC address frames, RxPCU should
  5149. * be zero which means allow all frames for MD at RxOLE
  5150. * host wil fiter out frames.
  5151. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5152. * b'28:31 - rsvd2: Reserved for future use
  5153. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5154. * Enable MGMT packet from 0b0000 to 0b1001
  5155. * bits from low to high: FP, MD, MO - 3 bits
  5156. * FP: Filter_Pass
  5157. * MD: Monitor_Direct
  5158. * MO: Monitor_Other
  5159. * 10 mgmt subtypes * 3 bits -> 30 bits
  5160. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5161. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5162. * Enable MGMT packet from 0b1010 to 0b1111
  5163. * bits from low to high: FP, MD, MO - 3 bits
  5164. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5165. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5166. * Enable CTRL packet from 0b0000 to 0b1001
  5167. * bits from low to high: FP, MD, MO - 3 bits
  5168. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5169. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5170. * Enable CTRL packet from 0b1010 to 0b1111,
  5171. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5172. * bits from low to high: FP, MD, MO - 3 bits
  5173. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5174. * dword6 - b'0:31 - tlv_filter_in_flags:
  5175. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5176. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5177. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5178. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5179. * A value of 0 will be considered as ignore this config.
  5180. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5181. * e.g. wmac_top_reg_seq_hwioreg.h
  5182. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5183. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5184. * A value of 0 will be considered as ignore this config.
  5185. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5186. * e.g. wmac_top_reg_seq_hwioreg.h
  5187. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5188. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5189. * A value of 0 will be considered as ignore this config.
  5190. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5191. * e.g. wmac_top_reg_seq_hwioreg.h
  5192. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5193. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5194. * A value of 0 will be considered as ignore this config.
  5195. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5196. * e.g. wmac_top_reg_seq_hwioreg.h
  5197. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5198. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5199. * A value of 0 will be considered as ignore this config.
  5200. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5201. * e.g. wmac_top_reg_seq_hwioreg.h
  5202. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5203. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5204. * A value of 0 will be considered as ignore this config.
  5205. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5206. * e.g. wmac_top_reg_seq_hwioreg.h
  5207. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5208. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5209. * A value of 0 will be considered as ignore this config.
  5210. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5211. * e.g. wmac_top_reg_seq_hwioreg.h
  5212. * - b'16:31 - rsvd3 for future use
  5213. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5214. * to source rings. Consumer drops packets if the available
  5215. * words in the ring falls below the configured threshold
  5216. * value.
  5217. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5218. * by host. 1 -> subscribed
  5219. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5220. * by host. 1 -> subscribed
  5221. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5222. * subscribed by host. 1 -> subscribed
  5223. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5224. * selection for the FP PHY ERR status tlv.
  5225. * 0 - wbm2rxdma_buf_source_ring
  5226. * 1 - fw2rxdma_buf_source_ring
  5227. * 2 - sw2rxdma_buf_source_ring
  5228. * 3 - no_buffer_ring
  5229. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5230. * selection for the FP PHY ERR status tlv.
  5231. * 0 - rxdma_release_ring
  5232. * 1 - rxdma2fw_ring
  5233. * 2 - rxdma2sw_ring
  5234. * 3 - rxdma2reo_ring
  5235. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5236. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5237. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5238. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5239. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5240. * 0: MSDU level logging
  5241. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5242. * 0: MSDU level logging
  5243. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5244. * 0: MSDU level logging
  5245. * - b'23 - word_mask_compaction: enable/disable word mask for
  5246. * mpdu/msdu start/end tlvs
  5247. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5248. * manager override
  5249. * - b'25:28 - rbm_override_val: return buffer manager override value
  5250. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5251. * which have to be posted to host from phy.
  5252. * Corresponding to errors defined in
  5253. * phyrx_abort_request_reason enums 0 to 31.
  5254. * Refer to RXPCU register definition header files for the
  5255. * phyrx_abort_request_reason enum definition.
  5256. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5257. * errors which have to be posted to host from phy.
  5258. * Corresponding to errors defined in
  5259. * phyrx_abort_request_reason enums 32 to 63.
  5260. * Refer to RXPCU register definition header files for the
  5261. * phyrx_abort_request_reason enum definition.
  5262. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5263. * applicable if word mask enabled
  5264. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5265. * applicable if word mask enabled
  5266. * - b'19:31 - rsvd7
  5267. * dword15- b'0:16 - rx_msdu_end_word_mask
  5268. * - b'17:31 - rsvd5
  5269. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5270. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5271. * buffer
  5272. * 1: RX_PKT TLV logging at specified offset for the
  5273. * subsequent buffer
  5274. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5275. */
  5276. PREPACK struct htt_rx_ring_selection_cfg_t {
  5277. A_UINT32 msg_type: 8,
  5278. pdev_id: 8,
  5279. ring_id: 8,
  5280. status_swap: 1,
  5281. pkt_swap: 1,
  5282. rx_offsets_valid: 1,
  5283. drop_thresh_valid: 1,
  5284. rx_mon_global_en: 1,
  5285. rsvd1: 3;
  5286. A_UINT32 ring_buffer_size: 16,
  5287. config_length_mgmt:3,
  5288. config_length_ctrl:3,
  5289. config_length_data:3,
  5290. rx_hdr_len: 2,
  5291. rxpcu_filter_enable_flag:1,
  5292. rsvd2: 4;
  5293. A_UINT32 packet_type_enable_flags_0;
  5294. A_UINT32 packet_type_enable_flags_1;
  5295. A_UINT32 packet_type_enable_flags_2;
  5296. A_UINT32 packet_type_enable_flags_3;
  5297. A_UINT32 tlv_filter_in_flags;
  5298. A_UINT32 rx_packet_offset: 16,
  5299. rx_header_offset: 16;
  5300. A_UINT32 rx_mpdu_end_offset: 16,
  5301. rx_mpdu_start_offset: 16;
  5302. A_UINT32 rx_msdu_end_offset: 16,
  5303. rx_msdu_start_offset: 16;
  5304. A_UINT32 rx_attn_offset: 16,
  5305. rsvd3: 16;
  5306. A_UINT32 rx_drop_threshold: 10,
  5307. fp_ndp: 1,
  5308. mo_ndp: 1,
  5309. fp_phy_err: 1,
  5310. fp_phy_err_buf_src: 2,
  5311. fp_phy_err_buf_dest: 2,
  5312. pkt_type_enable_msdu_or_mpdu_logging:3,
  5313. dma_mpdu_mgmt: 1,
  5314. dma_mpdu_ctrl: 1,
  5315. dma_mpdu_data: 1,
  5316. word_mask_compaction_enable:1,
  5317. rbm_override_enable: 1,
  5318. rbm_override_val: 4,
  5319. rsvd4: 3;
  5320. A_UINT32 phy_err_mask;
  5321. A_UINT32 phy_err_mask_cont;
  5322. A_UINT32 rx_mpdu_start_word_mask:16,
  5323. rx_mpdu_end_word_mask: 3,
  5324. rsvd7: 13;
  5325. A_UINT32 rx_msdu_end_word_mask: 17,
  5326. rsvd5: 15;
  5327. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5328. rx_pkt_tlv_offset: 15,
  5329. rsvd6: 16;
  5330. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5331. rx_mpdu_end_word_mask_v2: 8,
  5332. rsvd8: 4;
  5333. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5334. rsvd9: 12;
  5335. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5336. rsvd10: 12;
  5337. A_UINT32 packet_type_enable_fpmo_flags0;
  5338. A_UINT32 packet_type_enable_fpmo_flags1;
  5339. } POSTPACK;
  5340. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5341. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5342. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5343. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5344. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5345. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5346. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5347. do { \
  5348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5350. } while (0)
  5351. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5352. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5353. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5354. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5355. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5357. do { \
  5358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5360. } while (0)
  5361. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5362. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5363. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5364. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5365. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5366. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5367. do { \
  5368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5370. } while (0)
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5372. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5374. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5375. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5377. do { \
  5378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5380. } while (0)
  5381. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5382. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5383. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5384. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5385. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5386. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5390. } while (0)
  5391. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5392. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5393. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5394. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5395. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5396. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5397. do { \
  5398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5400. } while (0)
  5401. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5402. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5404. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5405. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5406. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5407. do { \
  5408. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5410. } while (0)
  5411. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5412. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5413. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5414. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5415. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5417. do { \
  5418. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5420. } while (0)
  5421. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5422. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5423. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5424. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5425. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5426. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5427. do { \
  5428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5430. } while (0)
  5431. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5432. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5433. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5434. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5435. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5436. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5440. } while (0)
  5441. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5442. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5443. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5444. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5445. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5446. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5447. do { \
  5448. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5449. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5450. } while (0)
  5451. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5452. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5453. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5454. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5455. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5457. do { \
  5458. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5459. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5460. } while(0)
  5461. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5462. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5463. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5464. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5465. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5466. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5467. do { \
  5468. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5469. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5470. } while(0)
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5474. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5475. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5477. do { \
  5478. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5479. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5480. } while (0)
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5484. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5485. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5489. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5490. } while (0)
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5494. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5495. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5497. do { \
  5498. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5499. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5500. } while (0)
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5504. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5505. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5509. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5510. } while (0)
  5511. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5512. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5513. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5514. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5515. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5516. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5517. do { \
  5518. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5519. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5520. } while (0)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5522. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5524. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5525. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5527. do { \
  5528. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5529. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5530. } while (0)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5532. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5534. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5535. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5537. do { \
  5538. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5539. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5540. } while (0)
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5542. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5544. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5545. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5550. } while (0)
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5552. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5554. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5555. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5556. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5557. do { \
  5558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5560. } while (0)
  5561. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5562. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5563. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5564. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5565. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5566. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5570. } while (0)
  5571. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5572. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5573. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5574. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5575. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5576. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5577. do { \
  5578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5580. } while (0)
  5581. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5582. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5583. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5584. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5585. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5586. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5587. do { \
  5588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5590. } while (0)
  5591. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5592. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5593. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5594. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5595. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5596. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5597. do { \
  5598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5600. } while (0)
  5601. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5602. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5603. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5604. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5605. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5606. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5610. } while (0)
  5611. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5612. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5613. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5614. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5615. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5616. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5617. do { \
  5618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5620. } while (0)
  5621. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5622. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5623. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5624. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5625. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5626. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5627. do { \
  5628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5630. } while (0)
  5631. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5632. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5633. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5634. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5635. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5636. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5637. do { \
  5638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5640. } while (0)
  5641. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5642. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5643. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5644. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5645. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5646. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5647. do { \
  5648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5650. } while (0)
  5651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5654. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5655. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5657. do { \
  5658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5660. } while (0)
  5661. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5662. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5663. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5664. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5665. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5666. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5667. do { \
  5668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5670. } while (0)
  5671. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5672. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5673. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5674. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5675. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5676. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5677. do { \
  5678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5680. } while (0)
  5681. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5682. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5683. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5684. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5685. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5686. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5687. do { \
  5688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5690. } while (0)
  5691. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5692. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5693. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5694. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5695. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5696. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5697. do { \
  5698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5700. } while (0)
  5701. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5702. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5703. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5704. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5705. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5706. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5707. do { \
  5708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5710. } while (0)
  5711. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5712. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5713. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5714. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5715. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5716. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5717. do { \
  5718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5720. } while (0)
  5721. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5722. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5723. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5724. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5725. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5726. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5727. do { \
  5728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5730. } while (0)
  5731. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5732. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5733. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5734. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5735. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5736. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5739. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5740. } while (0)
  5741. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5742. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5743. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5744. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5745. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5746. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5747. do { \
  5748. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5749. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5750. } while (0)
  5751. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5752. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5753. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5754. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5755. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5756. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5757. do { \
  5758. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5759. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5760. } while (0)
  5761. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5762. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5763. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5764. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5765. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5766. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5767. do { \
  5768. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5769. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5770. } while (0)
  5771. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5772. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5773. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5774. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5775. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5776. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5777. do { \
  5778. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5779. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5780. } while (0)
  5781. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5782. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5783. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5784. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5785. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5786. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5787. do { \
  5788. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5789. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5790. } while (0)
  5791. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5792. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5793. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5794. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5795. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5796. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5797. do { \
  5798. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5799. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5800. } while (0)
  5801. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5802. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5803. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5804. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5805. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5806. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5809. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5810. } while (0)
  5811. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5812. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5813. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5814. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5815. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5816. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5817. do { \
  5818. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5819. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5820. } while (0)
  5821. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5822. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5823. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5824. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5825. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5826. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5827. do { \
  5828. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5829. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5830. } while (0)
  5831. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5832. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5833. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5834. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5835. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5836. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5837. do { \
  5838. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5839. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5840. } while (0)
  5841. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5842. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5843. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5844. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5845. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5846. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5847. do { \
  5848. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5849. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5850. } while (0)
  5851. /*
  5852. * Subtype based MGMT frames enable bits.
  5853. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5854. */
  5855. /* association request */
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5862. /* association response */
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5869. /* Reassociation request */
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5876. /* Reassociation response */
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5883. /* Probe request */
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5890. /* Probe response */
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5897. /* Timing Advertisement */
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5904. /* Reserved */
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5911. /* Beacon */
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5918. /* ATIM */
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5925. /* Disassociation */
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5932. /* Authentication */
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5939. /* Deauthentication */
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5946. /* Action */
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5953. /* Action No Ack */
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5960. /* Reserved */
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5967. /*
  5968. * Subtype based CTRL frames enable bits.
  5969. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5970. */
  5971. /* Reserved */
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5978. /* Reserved */
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5985. /* Reserved */
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5992. /* Reserved */
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5999. /* Reserved */
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6006. /* Reserved */
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6013. /* Reserved */
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6020. /* Control Wrapper */
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6027. /* Block Ack Request */
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6034. /* Block Ack*/
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6041. /* PS-POLL */
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6048. /* RTS */
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6055. /* CTS */
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6062. /* ACK */
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6069. /* CF-END */
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6076. /* CF-END + CF-ACK */
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6083. /* Multicast data */
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6090. /* Unicast data */
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6097. /* NULL data */
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6104. /* FPMO mode flags */
  6105. /* MGMT */
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6138. /* CTRL */
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6171. /* DATA */
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(httsym, value); \
  6185. (word) |= (value) << httsym##_S; \
  6186. } while (0)
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6188. (((word) & httsym##_M) >> httsym##_S)
  6189. #define htt_rx_ring_pkt_enable_subtype_set( \
  6190. word, flag, mode, type, subtype, val) \
  6191. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6192. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6193. #define htt_rx_ring_pkt_enable_subtype_get( \
  6194. word, flag, mode, type, subtype) \
  6195. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6196. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6197. /* Definition to filter in TLVs */
  6198. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6199. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6200. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6201. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6202. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6226. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(httsym, enable); \
  6229. (word) |= (enable) << httsym##_S; \
  6230. } while (0)
  6231. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6232. (((word) & httsym##_M) >> httsym##_S)
  6233. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6234. HTT_RX_RING_TLV_ENABLE_SET( \
  6235. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6236. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6237. HTT_RX_RING_TLV_ENABLE_GET( \
  6238. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6239. /**
  6240. * @brief host -> target TX monitor config message
  6241. *
  6242. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6243. *
  6244. * @details
  6245. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6246. * configure RXDMA rings.
  6247. * The configuration is per ring based and includes both packet types
  6248. * and PPDU/MPDU TLVs.
  6249. *
  6250. * The message would appear as follows:
  6251. *
  6252. * |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|
  6253. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6254. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6255. * |-----------+--------+--------+-----+------------------------------------|
  6256. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6257. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6258. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6259. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6260. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6261. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6262. * |------------------------------------------------------------------------|
  6263. * | tlv_filter_mask_in0 |
  6264. * |------------------------------------------------------------------------|
  6265. * | tlv_filter_mask_in1 |
  6266. * |------------------------------------------------------------------------|
  6267. * | tlv_filter_mask_in2 |
  6268. * |------------------------------------------------------------------------|
  6269. * | tlv_filter_mask_in3 |
  6270. * |-----------------+-----------------+---------------------+--------------|
  6271. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6272. * |------------------------------------------------------------------------|
  6273. * | pcu_ppdu_setup_word_mask |
  6274. * |--------------------+--+--+--+-----+---------------------+--------------|
  6275. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6276. * |------------------------------------------------------------------------|
  6277. *
  6278. * Where:
  6279. * PS = pkt_swap
  6280. * SS = status_swap
  6281. * The message is interpreted as follows:
  6282. * dword0 - b'0:7 - msg_type: This will be set to
  6283. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6284. * b'8:15 - pdev_id:
  6285. * 0 (for rings at SOC level),
  6286. * 1/2/3 mac id (for rings at LMAC level)
  6287. * b'16:23 - ring_id : Identify the ring to configure.
  6288. * More details can be got from enum htt_srng_ring_id
  6289. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6290. * BUF_RING_CFG_0 defs within HW .h files,
  6291. * e.g. wmac_top_reg_seq_hwioreg.h
  6292. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6293. * BUF_RING_CFG_0 defs within HW .h files,
  6294. * e.g. wmac_top_reg_seq_hwioreg.h
  6295. * b'26 - tx_mon_global_en: Enable/Disable global register
  6296. * configuration in Tx monitor module.
  6297. * b'27:31 - rsvd1: reserved for future use
  6298. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6299. * in byte units.
  6300. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6301. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6302. * 64, 128, 256.
  6303. * If all 3 bits are set config length is > 256.
  6304. * if val is '0', then ignore this field.
  6305. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6306. * 64, 128, 256.
  6307. * If all 3 bits are set config length is > 256.
  6308. * if val is '0', then ignore this field.
  6309. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6310. * 64, 128, 256.
  6311. * If all 3 bits are set config length is > 256.
  6312. * If val is '0', then ignore this field.
  6313. * - b'25:31 - rsvd2: Reserved for future use
  6314. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6315. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6316. * If packet_type_enable_flags is '1' for MGMT type,
  6317. * monitor will ignore this bit and allow this TLV.
  6318. * If packet_type_enable_flags is '0' for MGMT type,
  6319. * monitor will use this bit to enable/disable logging
  6320. * of this TLV.
  6321. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6322. * If packet_type_enable_flags is '1' for CTRL type,
  6323. * monitor will ignore this bit and allow this TLV.
  6324. * If packet_type_enable_flags is '0' for CTRL type,
  6325. * monitor will use this bit to enable/disable logging
  6326. * of this TLV.
  6327. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6328. * If packet_type_enable_flags is '1' for DATA type,
  6329. * monitor will ignore this bit and allow this TLV.
  6330. * If packet_type_enable_flags is '0' for DATA type,
  6331. * monitor will use this bit to enable/disable logging
  6332. * of this TLV.
  6333. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6334. * If packet_type_enable_flags is '1' for MGMT type,
  6335. * monitor will ignore this bit and allow this TLV.
  6336. * If packet_type_enable_flags is '0' for MGMT type,
  6337. * monitor will use this bit to enable/disable logging
  6338. * of this TLV.
  6339. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6340. * If packet_type_enable_flags is '1' for CTRL type,
  6341. * monitor will ignore this bit and allow this TLV.
  6342. * If packet_type_enable_flags is '0' for CTRL type,
  6343. * monitor will use this bit to enable/disable logging
  6344. * of this TLV.
  6345. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6346. * If packet_type_enable_flags is '1' for DATA type,
  6347. * monitor will ignore this bit and allow this TLV.
  6348. * If packet_type_enable_flags is '0' for DATA type,
  6349. * monitor will use this bit to enable/disable logging
  6350. * of this TLV.
  6351. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6352. * If packet_type_enable_flags is '1' for MGMT type,
  6353. * monitor will ignore this bit and allow this TLV.
  6354. * If packet_type_enable_flags is '0' for MGMT type,
  6355. * monitor will use this bit to enable/disable logging
  6356. * of this TLV.
  6357. * If filter_in_TX_MPDU_START = 1 it is recommended
  6358. * to set this bit.
  6359. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6360. * If packet_type_enable_flags is '1' for CTRL type,
  6361. * monitor will ignore this bit and allow this TLV.
  6362. * If packet_type_enable_flags is '0' for CTRL type,
  6363. * monitor will use this bit to enable/disable logging
  6364. * of this TLV.
  6365. * If filter_in_TX_MPDU_START = 1 it is recommended
  6366. * to set this bit.
  6367. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6368. * If packet_type_enable_flags is '1' for DATA type,
  6369. * monitor will ignore this bit and allow this TLV.
  6370. * If packet_type_enable_flags is '0' for DATA type,
  6371. * monitor will use this bit to enable/disable logging
  6372. * of this TLV.
  6373. * If filter_in_TX_MPDU_START = 1 it is recommended
  6374. * to set this bit.
  6375. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6376. * If packet_type_enable_flags is '1' for MGMT type,
  6377. * monitor will ignore this bit and allow this TLV.
  6378. * If packet_type_enable_flags is '0' for MGMT type,
  6379. * monitor will use this bit to enable/disable logging
  6380. * of this TLV.
  6381. * If filter_in_TX_MSDU_START = 1 it is recommended
  6382. * to set this bit.
  6383. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6384. * If packet_type_enable_flags is '1' for CTRL type,
  6385. * monitor will ignore this bit and allow this TLV.
  6386. * If packet_type_enable_flags is '0' for CTRL type,
  6387. * monitor will use this bit to enable/disable logging
  6388. * of this TLV.
  6389. * If filter_in_TX_MSDU_START = 1 it is recommended
  6390. * to set this bit.
  6391. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6392. * If packet_type_enable_flags is '1' for DATA type,
  6393. * monitor will ignore this bit and allow this TLV.
  6394. * If packet_type_enable_flags is '0' for DATA type,
  6395. * monitor will use this bit to enable/disable logging
  6396. * of this TLV.
  6397. * If filter_in_TX_MSDU_START = 1 it is recommended
  6398. * to set this bit.
  6399. * b'15:31 - rsvd3: Reserved for future use
  6400. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6401. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6402. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6403. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6404. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6405. * - b'8:15 - tx_peer_entry_word_mask:
  6406. * - b'16:23 - tx_queue_ext_word_mask:
  6407. * - b'24:31 - tx_msdu_start_word_mask:
  6408. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6409. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6410. * - b'8:15 - rxpcu_user_setup_word_mask:
  6411. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6412. * MGMT, CTRL, DATA
  6413. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6414. * 0 -> MSDU level logging is enabled
  6415. * (valid only if bit is set in
  6416. * pkt_type_enable_msdu_or_mpdu_logging)
  6417. * 1 -> MPDU level logging is enabled
  6418. * (valid only if bit is set in
  6419. * pkt_type_enable_msdu_or_mpdu_logging)
  6420. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6421. * 0 -> MSDU level logging is enabled
  6422. * (valid only if bit is set in
  6423. * pkt_type_enable_msdu_or_mpdu_logging)
  6424. * 1 -> MPDU level logging is enabled
  6425. * (valid only if bit is set in
  6426. * pkt_type_enable_msdu_or_mpdu_logging)
  6427. * - b'21 - dma_mpdu_data(D) : For DATA
  6428. * 0 -> MSDU level logging is enabled
  6429. * (valid only if bit is set in
  6430. * pkt_type_enable_msdu_or_mpdu_logging)
  6431. * 1 -> MPDU level logging is enabled
  6432. * (valid only if bit is set in
  6433. * pkt_type_enable_msdu_or_mpdu_logging)
  6434. * - b'22:31 - rsvd4 for future use
  6435. */
  6436. PREPACK struct htt_tx_monitor_cfg_t {
  6437. A_UINT32 msg_type: 8,
  6438. pdev_id: 8,
  6439. ring_id: 8,
  6440. status_swap: 1,
  6441. pkt_swap: 1,
  6442. tx_mon_global_en: 1,
  6443. rsvd1: 5;
  6444. A_UINT32 ring_buffer_size: 16,
  6445. config_length_mgmt: 3,
  6446. config_length_ctrl: 3,
  6447. config_length_data: 3,
  6448. rsvd2: 7;
  6449. A_UINT32 pkt_type_enable_flags: 3,
  6450. filter_in_tx_mpdu_start_mgmt: 1,
  6451. filter_in_tx_mpdu_start_ctrl: 1,
  6452. filter_in_tx_mpdu_start_data: 1,
  6453. filter_in_tx_msdu_start_mgmt: 1,
  6454. filter_in_tx_msdu_start_ctrl: 1,
  6455. filter_in_tx_msdu_start_data: 1,
  6456. filter_in_tx_mpdu_end_mgmt: 1,
  6457. filter_in_tx_mpdu_end_ctrl: 1,
  6458. filter_in_tx_mpdu_end_data: 1,
  6459. filter_in_tx_msdu_end_mgmt: 1,
  6460. filter_in_tx_msdu_end_ctrl: 1,
  6461. filter_in_tx_msdu_end_data: 1,
  6462. rsvd3: 17;
  6463. A_UINT32 tlv_filter_mask_in0;
  6464. A_UINT32 tlv_filter_mask_in1;
  6465. A_UINT32 tlv_filter_mask_in2;
  6466. A_UINT32 tlv_filter_mask_in3;
  6467. A_UINT32 tx_fes_setup_word_mask: 8,
  6468. tx_peer_entry_word_mask: 8,
  6469. tx_queue_ext_word_mask: 8,
  6470. tx_msdu_start_word_mask: 8;
  6471. A_UINT32 pcu_ppdu_setup_word_mask;
  6472. A_UINT32 tx_mpdu_start_word_mask: 8,
  6473. rxpcu_user_setup_word_mask: 8,
  6474. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6475. dma_mpdu_mgmt: 1,
  6476. dma_mpdu_ctrl: 1,
  6477. dma_mpdu_data: 1,
  6478. rsvd4: 10;
  6479. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6480. tx_peer_entry_v2_word_mask: 12,
  6481. rsvd5: 10;
  6482. A_UINT32 fes_status_end_word_mask: 16,
  6483. response_end_status_word_mask: 16;
  6484. A_UINT32 fes_status_prot_word_mask: 11,
  6485. rsvd6: 21;
  6486. } POSTPACK;
  6487. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6488. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6489. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6490. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6491. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6492. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6493. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6496. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6497. } while (0)
  6498. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6499. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6500. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6501. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6502. HTT_TX_MONITOR_CFG_RING_ID_S)
  6503. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6504. do { \
  6505. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6506. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6507. } while (0)
  6508. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6509. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6510. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6511. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6512. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6513. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6514. do { \
  6515. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6516. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6517. } while (0)
  6518. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6519. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6520. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6521. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6522. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6523. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6526. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6527. } while (0)
  6528. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6529. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6530. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6531. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6532. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6533. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6536. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6537. } while (0)
  6538. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6539. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6540. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6541. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6542. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6543. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6546. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6547. } while (0)
  6548. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6549. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6550. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6551. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6552. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6553. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6554. do { \
  6555. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6556. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6557. } while (0)
  6558. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6559. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6560. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6561. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6562. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6563. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6564. do { \
  6565. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6566. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6567. } while (0)
  6568. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6569. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6570. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6571. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6572. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6573. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6574. do { \
  6575. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6576. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6577. } while (0)
  6578. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6579. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6580. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6581. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6582. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6584. do { \
  6585. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6586. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6587. } while (0)
  6588. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6589. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6590. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6591. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6592. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6593. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6594. do { \
  6595. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6596. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6597. } while (0)
  6598. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6599. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6600. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6601. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6602. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6603. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6604. do { \
  6605. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6606. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6607. } while (0)
  6608. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6609. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6610. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6611. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6612. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6613. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6614. do { \
  6615. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6616. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6617. } while (0)
  6618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6619. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6621. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6622. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6623. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6624. do { \
  6625. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6626. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6627. } while (0)
  6628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6629. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6631. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6632. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6633. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6634. do { \
  6635. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6636. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6637. } while (0)
  6638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6639. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6641. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6642. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6643. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6644. do { \
  6645. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6646. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6647. } while (0)
  6648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6649. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6651. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6652. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6653. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6654. do { \
  6655. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6656. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6657. } while (0)
  6658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6659. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6661. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6662. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6663. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6664. do { \
  6665. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6666. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6667. } while (0)
  6668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6669. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6671. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6672. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6673. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6674. do { \
  6675. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6676. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6677. } while (0)
  6678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6679. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6681. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6682. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6683. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6684. do { \
  6685. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6686. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6687. } while (0)
  6688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6689. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6691. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6692. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6693. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6694. do { \
  6695. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6696. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6697. } while (0)
  6698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6699. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6701. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6702. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6703. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6704. do { \
  6705. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6706. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6707. } while (0)
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6711. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6712. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6716. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6717. } while (0)
  6718. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6719. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6720. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6721. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6722. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6723. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6724. do { \
  6725. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6726. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6727. } while (0)
  6728. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6729. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6730. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6731. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6732. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6733. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6736. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6737. } while (0)
  6738. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6739. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6740. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6741. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6742. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6743. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6744. do { \
  6745. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6746. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6747. } while (0)
  6748. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6749. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6750. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6751. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6752. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6753. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6754. do { \
  6755. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6756. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6757. } while (0)
  6758. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6759. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6760. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6761. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6762. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6763. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6764. do { \
  6765. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6766. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6767. } while (0)
  6768. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6769. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6770. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6771. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6772. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6773. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6774. do { \
  6775. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6776. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6777. } while (0)
  6778. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6779. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6780. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6781. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6782. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6783. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6784. do { \
  6785. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6786. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6787. } while (0)
  6788. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6789. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6790. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6791. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6792. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6793. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6794. do { \
  6795. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6796. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6797. } while (0)
  6798. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6799. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6800. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6801. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6802. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6803. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6804. do { \
  6805. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6806. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6807. } while (0)
  6808. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6809. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6810. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6811. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6812. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6813. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6814. do { \
  6815. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6816. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6817. } while (0)
  6818. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6819. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6820. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6821. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6822. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6823. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6824. do { \
  6825. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6826. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6827. } while (0)
  6828. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6829. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6830. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6831. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6832. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6833. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6834. do { \
  6835. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6836. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6837. } while (0)
  6838. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6839. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6840. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6841. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6842. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6843. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6844. do { \
  6845. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6846. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6847. } while (0)
  6848. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6849. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6850. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6851. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6852. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6853. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6854. do { \
  6855. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6856. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6857. } while (0)
  6858. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6859. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6860. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6861. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6862. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6863. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6864. do { \
  6865. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6866. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6867. } while (0)
  6868. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6869. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6870. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6871. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6872. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6873. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6874. do { \
  6875. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6876. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6877. } while (0)
  6878. /*
  6879. * pkt_type_enable_flags
  6880. */
  6881. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6882. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6883. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6884. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6885. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6886. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6887. /*
  6888. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6889. */
  6890. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6891. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6892. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6893. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6894. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6895. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6896. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6897. do { \
  6898. HTT_CHECK_SET_VAL(httsym, value); \
  6899. (word) |= (value) << httsym##_S; \
  6900. } while (0)
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6902. (((word) & httsym##_M) >> httsym##_S)
  6903. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6904. * type -> MGMT, CTRL, DATA*/
  6905. #define htt_tx_ring_pkt_type_set( \
  6906. word, mode, type, val) \
  6907. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6908. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6909. #define htt_tx_ring_pkt_type_get( \
  6910. word, mode, type) \
  6911. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6912. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6913. /* Definition to filter in TLVs */
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6978. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6979. do { \
  6980. HTT_CHECK_SET_VAL(httsym, enable); \
  6981. (word) |= (enable) << httsym##_S; \
  6982. } while (0)
  6983. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6984. (((word) & httsym##_M) >> httsym##_S)
  6985. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6986. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6987. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6988. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6989. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6990. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7055. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(httsym, enable); \
  7058. (word) |= (enable) << httsym##_S; \
  7059. } while (0)
  7060. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7061. (((word) & httsym##_M) >> httsym##_S)
  7062. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7063. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7064. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7065. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7066. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7067. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7132. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_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_IN2_GET(word, httsym) \
  7138. (((word) & httsym##_M) >> httsym##_S)
  7139. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7140. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7141. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7142. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7143. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7144. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7189. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7190. do { \
  7191. HTT_CHECK_SET_VAL(httsym, enable); \
  7192. (word) |= (enable) << httsym##_S; \
  7193. } while (0)
  7194. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7195. (((word) & httsym##_M) >> httsym##_S)
  7196. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7197. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7198. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7199. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7200. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7201. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7202. /**
  7203. * @brief host --> target Receive Flow Steering configuration message definition
  7204. *
  7205. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7206. *
  7207. * host --> target Receive Flow Steering configuration message definition.
  7208. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7209. * The reason for this is we want RFS to be configured and ready before MAC
  7210. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7211. *
  7212. * |31 24|23 16|15 9|8|7 0|
  7213. * |----------------+----------------+----------------+----------------|
  7214. * | reserved |E| msg type |
  7215. * |-------------------------------------------------------------------|
  7216. * Where E = RFS enable flag
  7217. *
  7218. * The RFS_CONFIG message consists of a single 4-byte word.
  7219. *
  7220. * Header fields:
  7221. * - MSG_TYPE
  7222. * Bits 7:0
  7223. * Purpose: identifies this as a RFS config msg
  7224. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7225. * - RFS_CONFIG
  7226. * Bit 8
  7227. * Purpose: Tells target whether to enable (1) or disable (0)
  7228. * flow steering feature when sending rx indication messages to host
  7229. */
  7230. #define HTT_H2T_RFS_CONFIG_M 0x100
  7231. #define HTT_H2T_RFS_CONFIG_S 8
  7232. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7233. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7234. HTT_H2T_RFS_CONFIG_S)
  7235. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7238. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7239. } while (0)
  7240. #define HTT_RFS_CFG_REQ_BYTES 4
  7241. /**
  7242. * @brief host -> target FW extended statistics request
  7243. *
  7244. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7245. *
  7246. * @details
  7247. * The following field definitions describe the format of the HTT host
  7248. * to target FW extended stats retrieve message.
  7249. * The message specifies the type of stats the host wants to retrieve.
  7250. *
  7251. * |31 24|23 16|15 8|7 0|
  7252. * |-----------------------------------------------------------|
  7253. * | reserved | stats type | pdev_mask | msg type |
  7254. * |-----------------------------------------------------------|
  7255. * | config param [0] |
  7256. * |-----------------------------------------------------------|
  7257. * | config param [1] |
  7258. * |-----------------------------------------------------------|
  7259. * | config param [2] |
  7260. * |-----------------------------------------------------------|
  7261. * | config param [3] |
  7262. * |-----------------------------------------------------------|
  7263. * | reserved |
  7264. * |-----------------------------------------------------------|
  7265. * | cookie LSBs |
  7266. * |-----------------------------------------------------------|
  7267. * | cookie MSBs |
  7268. * |-----------------------------------------------------------|
  7269. * Header fields:
  7270. * - MSG_TYPE
  7271. * Bits 7:0
  7272. * Purpose: identifies this is a extended stats upload request message
  7273. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7274. * - PDEV_MASK
  7275. * Bits 8:15
  7276. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7277. * Value: This is a overloaded field, refer to usage and interpretation of
  7278. * PDEV in interface document.
  7279. * Bit 8 : Reserved for SOC stats
  7280. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7281. * Indicates MACID_MASK in DBS
  7282. * - STATS_TYPE
  7283. * Bits 23:16
  7284. * Purpose: identifies which FW statistics to upload
  7285. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7286. * - Reserved
  7287. * Bits 31:24
  7288. * - CONFIG_PARAM [0]
  7289. * Bits 31:0
  7290. * Purpose: give an opaque configuration value to the specified stats type
  7291. * Value: stats-type specific configuration value
  7292. * Refer to htt_stats.h for interpretation for each stats sub_type
  7293. * - CONFIG_PARAM [1]
  7294. * Bits 31:0
  7295. * Purpose: give an opaque configuration value to the specified stats type
  7296. * Value: stats-type specific configuration value
  7297. * Refer to htt_stats.h for interpretation for each stats sub_type
  7298. * - CONFIG_PARAM [2]
  7299. * Bits 31:0
  7300. * Purpose: give an opaque configuration value to the specified stats type
  7301. * Value: stats-type specific configuration value
  7302. * Refer to htt_stats.h for interpretation for each stats sub_type
  7303. * - CONFIG_PARAM [3]
  7304. * Bits 31:0
  7305. * Purpose: give an opaque configuration value to the specified stats type
  7306. * Value: stats-type specific configuration value
  7307. * Refer to htt_stats.h for interpretation for each stats sub_type
  7308. * - Reserved [31:0] for future use.
  7309. * - COOKIE_LSBS
  7310. * Bits 31:0
  7311. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7312. * message with its preceding host->target stats request message.
  7313. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7314. * - COOKIE_MSBS
  7315. * Bits 31:0
  7316. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7317. * message with its preceding host->target stats request message.
  7318. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7319. */
  7320. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7321. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7322. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7323. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7324. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7325. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7326. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7327. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7328. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7329. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7330. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7331. do { \
  7332. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7333. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7334. } while (0)
  7335. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7336. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7337. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7338. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7339. do { \
  7340. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7341. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7342. } while (0)
  7343. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7344. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7345. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7346. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7347. do { \
  7348. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7349. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7350. } while (0)
  7351. /**
  7352. * @brief host -> target FW streaming statistics request
  7353. *
  7354. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7355. *
  7356. * @details
  7357. * The following field definitions describe the format of the HTT host
  7358. * to target message that requests the target to start or stop producing
  7359. * ongoing stats of the specified type.
  7360. *
  7361. * |31|30 |23 16|15 8|7 0|
  7362. * |-----------------------------------------------------------|
  7363. * |EN| reserved | stats type | reserved | msg type |
  7364. * |-----------------------------------------------------------|
  7365. * | config param [0] |
  7366. * |-----------------------------------------------------------|
  7367. * | config param [1] |
  7368. * |-----------------------------------------------------------|
  7369. * | config param [2] |
  7370. * |-----------------------------------------------------------|
  7371. * | config param [3] |
  7372. * |-----------------------------------------------------------|
  7373. * Where:
  7374. * - EN is an enable/disable flag
  7375. * Header fields:
  7376. * - MSG_TYPE
  7377. * Bits 7:0
  7378. * Purpose: identifies this is a streaming stats upload request message
  7379. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7380. * - STATS_TYPE
  7381. * Bits 23:16
  7382. * Purpose: identifies which FW statistics to upload
  7383. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7384. * Only the htt_dbg_ext_stats_type values identified as streaming
  7385. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7386. * - ENABLE
  7387. * Bit 31
  7388. * Purpose: enable/disable the target's ongoing stats of the specified type
  7389. * Value:
  7390. * 0 - disable ongoing production of the specified stats type
  7391. * 1 - enable ongoing production of the specified stats type
  7392. * - CONFIG_PARAM [0]
  7393. * Bits 31:0
  7394. * Purpose: give an opaque configuration value to the specified stats type
  7395. * Value: stats-type specific configuration value
  7396. * Refer to htt_stats.h for interpretation for each stats sub_type
  7397. * - CONFIG_PARAM [1]
  7398. * Bits 31:0
  7399. * Purpose: give an opaque configuration value to the specified stats type
  7400. * Value: stats-type specific configuration value
  7401. * Refer to htt_stats.h for interpretation for each stats sub_type
  7402. * - CONFIG_PARAM [2]
  7403. * Bits 31:0
  7404. * Purpose: give an opaque configuration value to the specified stats type
  7405. * Value: stats-type specific configuration value
  7406. * Refer to htt_stats.h for interpretation for each stats sub_type
  7407. * - CONFIG_PARAM [3]
  7408. * Bits 31:0
  7409. * Purpose: give an opaque configuration value to the specified stats type
  7410. * Value: stats-type specific configuration value
  7411. * Refer to htt_stats.h for interpretation for each stats sub_type
  7412. */
  7413. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7414. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7415. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7416. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7417. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7418. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7419. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7420. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7421. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7422. do { \
  7423. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7424. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7425. } while (0)
  7426. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7427. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7428. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7429. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7430. do { \
  7431. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7432. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7433. } while (0)
  7434. /**
  7435. * @brief host -> target FW PPDU_STATS request message
  7436. *
  7437. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7438. *
  7439. * @details
  7440. * The following field definitions describe the format of the HTT host
  7441. * to target FW for PPDU_STATS_CFG msg.
  7442. * The message allows the host to configure the PPDU_STATS_IND messages
  7443. * produced by the target.
  7444. *
  7445. * |31 24|23 16|15 8|7 0|
  7446. * |-----------------------------------------------------------|
  7447. * | REQ bit mask | pdev_mask | msg type |
  7448. * |-----------------------------------------------------------|
  7449. * Header fields:
  7450. * - MSG_TYPE
  7451. * Bits 7:0
  7452. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7453. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7454. * - PDEV_MASK
  7455. * Bits 8:15
  7456. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7457. * Value: This is a overloaded field, refer to usage and interpretation of
  7458. * PDEV in interface document.
  7459. * Bit 8 : Reserved for SOC stats
  7460. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7461. * Indicates MACID_MASK in DBS
  7462. * - REQ_TLV_BIT_MASK
  7463. * Bits 16:31
  7464. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7465. * needs to be included in the target's PPDU_STATS_IND messages.
  7466. * Value: refer htt_ppdu_stats_tlv_tag_t
  7467. *
  7468. */
  7469. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7470. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7471. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7472. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7473. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7474. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7475. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7476. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7477. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7478. do { \
  7479. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7480. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7481. } while (0)
  7482. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7483. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7484. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7485. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7486. do { \
  7487. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7488. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7489. } while (0)
  7490. /**
  7491. * @brief Host-->target HTT RX FSE setup message
  7492. *
  7493. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7494. *
  7495. * @details
  7496. * Through this message, the host will provide details of the flow tables
  7497. * in host DDR along with hash keys.
  7498. * This message can be sent per SOC or per PDEV, which is differentiated
  7499. * by pdev id values.
  7500. * The host will allocate flow search table and sends table size,
  7501. * physical DMA address of flow table, and hash keys to firmware to
  7502. * program into the RXOLE FSE HW block.
  7503. *
  7504. * The following field definitions describe the format of the RX FSE setup
  7505. * message sent from the host to target
  7506. *
  7507. * Header fields:
  7508. * dword0 - b'7:0 - msg_type: This will be set to
  7509. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7510. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7511. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7512. * pdev's LMAC ring.
  7513. * b'31:16 - reserved : Reserved for future use
  7514. * dword1 - b'19:0 - number of records: This field indicates the number of
  7515. * entries in the flow table. For example: 8k number of
  7516. * records is equivalent to
  7517. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7518. * b'27:20 - max search: This field specifies the skid length to FSE
  7519. * parser HW module whenever match is not found at the
  7520. * exact index pointed by hash.
  7521. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7522. * Refer htt_ip_da_sa_prefix below for more details.
  7523. * b'31:30 - reserved: Reserved for future use
  7524. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7525. * table allocated by host in DDR
  7526. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7527. * table allocated by host in DDR
  7528. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7529. * entry hashing
  7530. *
  7531. *
  7532. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7533. * |---------------------------------------------------------------|
  7534. * | reserved | pdev_id | MSG_TYPE |
  7535. * |---------------------------------------------------------------|
  7536. * |resvd|IPDSA| max_search | Number of records |
  7537. * |---------------------------------------------------------------|
  7538. * | base address lo |
  7539. * |---------------------------------------------------------------|
  7540. * | base address high |
  7541. * |---------------------------------------------------------------|
  7542. * | toeplitz key 31_0 |
  7543. * |---------------------------------------------------------------|
  7544. * | toeplitz key 63_32 |
  7545. * |---------------------------------------------------------------|
  7546. * | toeplitz key 95_64 |
  7547. * |---------------------------------------------------------------|
  7548. * | toeplitz key 127_96 |
  7549. * |---------------------------------------------------------------|
  7550. * | toeplitz key 159_128 |
  7551. * |---------------------------------------------------------------|
  7552. * | toeplitz key 191_160 |
  7553. * |---------------------------------------------------------------|
  7554. * | toeplitz key 223_192 |
  7555. * |---------------------------------------------------------------|
  7556. * | toeplitz key 255_224 |
  7557. * |---------------------------------------------------------------|
  7558. * | toeplitz key 287_256 |
  7559. * |---------------------------------------------------------------|
  7560. * | reserved | toeplitz key 314_288(26:0 bits) |
  7561. * |---------------------------------------------------------------|
  7562. * where:
  7563. * IPDSA = ip_da_sa
  7564. */
  7565. /**
  7566. * @brief: htt_ip_da_sa_prefix
  7567. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7568. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7569. * documentation per RFC3849
  7570. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7571. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7572. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7573. */
  7574. enum htt_ip_da_sa_prefix {
  7575. HTT_RX_IPV6_20010db8,
  7576. HTT_RX_IPV4_MAPPED_IPV6,
  7577. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7578. HTT_RX_IPV6_64FF9B,
  7579. };
  7580. /**
  7581. * @brief Host-->target HTT RX FISA configure and enable
  7582. *
  7583. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7584. *
  7585. * @details
  7586. * The host will send this command down to configure and enable the FISA
  7587. * operational params.
  7588. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7589. * register.
  7590. * Should configure both the MACs.
  7591. *
  7592. * dword0 - b'7:0 - msg_type:
  7593. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7594. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7595. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7596. * pdev's LMAC ring.
  7597. * b'31:16 - reserved : Reserved for future use
  7598. *
  7599. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7600. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7601. * packets. 1 flow search will be skipped
  7602. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7603. * tcp,udp packets
  7604. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7605. * calculation
  7606. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7607. * calculation
  7608. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7609. * calculation
  7610. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7611. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7612. * length
  7613. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7614. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7615. * length
  7616. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7617. * num jump
  7618. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7619. * num jump
  7620. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7621. * data type switch has happened for MPDU Sequence num jump
  7622. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7623. * for MPDU Sequence num jump
  7624. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7625. * for decrypt errors
  7626. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7627. * while aggregating a msdu
  7628. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7629. * The aggregation is done until (number of MSDUs aggregated
  7630. * < LIMIT + 1)
  7631. * b'31:18 - Reserved
  7632. *
  7633. * fisa_control_value - 32bit value FW can write to register
  7634. *
  7635. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7636. * Threshold value for FISA timeout (units are microseconds).
  7637. * When the global timestamp exceeds this threshold, FISA
  7638. * aggregation will be restarted.
  7639. * A value of 0 means timeout is disabled.
  7640. * Compare the threshold register with timestamp field in
  7641. * flow entry to generate timeout for the flow.
  7642. *
  7643. * |31 18 |17 16|15 8|7 0|
  7644. * |-------------------------------------------------------------|
  7645. * | reserved | pdev_mask | msg type |
  7646. * |-------------------------------------------------------------|
  7647. * | reserved | FISA_CTRL |
  7648. * |-------------------------------------------------------------|
  7649. * | FISA_TIMEOUT_THRESH |
  7650. * |-------------------------------------------------------------|
  7651. */
  7652. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7653. A_UINT32 msg_type:8,
  7654. pdev_id:8,
  7655. reserved0:16;
  7656. /**
  7657. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7658. * [17:0]
  7659. */
  7660. union {
  7661. /*
  7662. * fisa_control_bits structure is deprecated.
  7663. * Please use fisa_control_bits_v2 going forward.
  7664. */
  7665. struct {
  7666. A_UINT32 fisa_enable: 1,
  7667. ipsec_skip_search: 1,
  7668. nontcp_skip_search: 1,
  7669. add_ipv4_fixed_hdr_len: 1,
  7670. add_ipv6_fixed_hdr_len: 1,
  7671. add_tcp_fixed_hdr_len: 1,
  7672. add_udp_hdr_len: 1,
  7673. chksum_cum_ip_len_en: 1,
  7674. disable_tid_check: 1,
  7675. disable_ta_check: 1,
  7676. disable_qos_check: 1,
  7677. disable_raw_check: 1,
  7678. disable_decrypt_err_check: 1,
  7679. disable_msdu_drop_check: 1,
  7680. fisa_aggr_limit: 4,
  7681. reserved: 14;
  7682. } fisa_control_bits;
  7683. struct {
  7684. A_UINT32 fisa_enable: 1,
  7685. fisa_aggr_limit: 4,
  7686. reserved: 27;
  7687. } fisa_control_bits_v2;
  7688. A_UINT32 fisa_control_value;
  7689. } u_fisa_control;
  7690. /**
  7691. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7692. * timeout threshold for aggregation. Unit in usec.
  7693. * [31:0]
  7694. */
  7695. A_UINT32 fisa_timeout_threshold;
  7696. } POSTPACK;
  7697. /* DWord 0: pdev-ID */
  7698. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7699. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7700. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7701. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7702. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7703. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7704. do { \
  7705. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7706. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7707. } while (0)
  7708. /* Dword 1: fisa_control_value fisa config */
  7709. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7710. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7711. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7712. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7713. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7714. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7717. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7718. } while (0)
  7719. /* Dword 1: fisa_control_value ipsec_skip_search */
  7720. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7721. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7722. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7723. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7724. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7725. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7726. do { \
  7727. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7728. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7729. } while (0)
  7730. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7731. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7732. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7733. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7734. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7735. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7736. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7737. do { \
  7738. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7739. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7740. } while (0)
  7741. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7742. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7743. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7744. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7745. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7746. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7747. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7750. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7751. } while (0)
  7752. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7753. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7754. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7755. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7756. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7757. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7758. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7761. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7762. } while (0)
  7763. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7764. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7765. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7766. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7767. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7768. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7769. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7770. do { \
  7771. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7772. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7773. } while (0)
  7774. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7775. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7776. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7777. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7778. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7779. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7780. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7781. do { \
  7782. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7783. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7784. } while (0)
  7785. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7786. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7787. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7788. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7789. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7790. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7791. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7792. do { \
  7793. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7794. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7795. } while (0)
  7796. /* Dword 1: fisa_control_value disable_tid_check */
  7797. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7798. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7799. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7800. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7801. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7802. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7805. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7806. } while (0)
  7807. /* Dword 1: fisa_control_value disable_ta_check */
  7808. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7809. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7810. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7811. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7812. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7813. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7814. do { \
  7815. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7816. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7817. } while (0)
  7818. /* Dword 1: fisa_control_value disable_qos_check */
  7819. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7820. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7821. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7822. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7823. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7824. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7825. do { \
  7826. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7827. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7828. } while (0)
  7829. /* Dword 1: fisa_control_value disable_raw_check */
  7830. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7831. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7832. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7833. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7834. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7835. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7836. do { \
  7837. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7838. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7839. } while (0)
  7840. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7841. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7842. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7843. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7844. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7845. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7846. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7847. do { \
  7848. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7849. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7850. } while (0)
  7851. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7852. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7853. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7854. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7855. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7856. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7857. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7858. do { \
  7859. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7860. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7861. } while (0)
  7862. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7863. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7864. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7865. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7866. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7867. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7868. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7869. do { \
  7870. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7871. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7872. } while (0)
  7873. /* Dword 1: fisa_control_value fisa config */
  7874. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7875. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7876. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7877. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7878. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7879. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7880. do { \
  7881. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7882. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7883. } while (0)
  7884. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7885. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7886. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7887. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7888. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7889. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7890. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7893. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7894. } while (0)
  7895. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7896. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7897. pdev_id:8,
  7898. reserved0:16;
  7899. A_UINT32 num_records:20,
  7900. max_search:8,
  7901. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7902. reserved1:2;
  7903. A_UINT32 base_addr_lo;
  7904. A_UINT32 base_addr_hi;
  7905. A_UINT32 toeplitz31_0;
  7906. A_UINT32 toeplitz63_32;
  7907. A_UINT32 toeplitz95_64;
  7908. A_UINT32 toeplitz127_96;
  7909. A_UINT32 toeplitz159_128;
  7910. A_UINT32 toeplitz191_160;
  7911. A_UINT32 toeplitz223_192;
  7912. A_UINT32 toeplitz255_224;
  7913. A_UINT32 toeplitz287_256;
  7914. A_UINT32 toeplitz314_288:27,
  7915. reserved2:5;
  7916. } POSTPACK;
  7917. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7918. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7919. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7920. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7921. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7922. /* DWORD 0: Pdev ID */
  7923. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7924. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7925. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7926. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7927. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7928. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7929. do { \
  7930. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7931. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7932. } while (0)
  7933. /* DWORD 1:num of records */
  7934. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7935. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7936. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7937. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7938. HTT_RX_FSE_SETUP_NUM_REC_S)
  7939. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7942. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7943. } while (0)
  7944. /* DWORD 1:max_search */
  7945. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7946. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7947. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7948. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7949. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7950. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7951. do { \
  7952. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7953. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7954. } while (0)
  7955. /* DWORD 1:ip_da_sa prefix */
  7956. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7957. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7958. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7959. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7960. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7961. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7962. do { \
  7963. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7964. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7965. } while (0)
  7966. /* DWORD 2: Base Address LO */
  7967. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7968. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7969. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7970. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7971. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7972. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7973. do { \
  7974. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7975. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7976. } while (0)
  7977. /* DWORD 3: Base Address High */
  7978. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7979. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7980. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7981. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7982. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7983. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7984. do { \
  7985. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7986. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7987. } while (0)
  7988. /* DWORD 4-12: Hash Value */
  7989. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7990. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7991. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7992. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7993. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7994. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7995. do { \
  7996. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7997. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7998. } while (0)
  7999. /* DWORD 13: Hash Value 314:288 bits */
  8000. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8001. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8002. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8003. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8004. do { \
  8005. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8006. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8007. } while (0)
  8008. /**
  8009. * @brief Host-->target HTT RX FSE operation message
  8010. *
  8011. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8012. *
  8013. * @details
  8014. * The host will send this Flow Search Engine (FSE) operation message for
  8015. * every flow add/delete operation.
  8016. * The FSE operation includes FSE full cache invalidation or individual entry
  8017. * invalidation.
  8018. * This message can be sent per SOC or per PDEV which is differentiated
  8019. * by pdev id values.
  8020. *
  8021. * |31 16|15 8|7 1|0|
  8022. * |-------------------------------------------------------------|
  8023. * | reserved | pdev_id | MSG_TYPE |
  8024. * |-------------------------------------------------------------|
  8025. * | reserved | operation |I|
  8026. * |-------------------------------------------------------------|
  8027. * | ip_src_addr_31_0 |
  8028. * |-------------------------------------------------------------|
  8029. * | ip_src_addr_63_32 |
  8030. * |-------------------------------------------------------------|
  8031. * | ip_src_addr_95_64 |
  8032. * |-------------------------------------------------------------|
  8033. * | ip_src_addr_127_96 |
  8034. * |-------------------------------------------------------------|
  8035. * | ip_dst_addr_31_0 |
  8036. * |-------------------------------------------------------------|
  8037. * | ip_dst_addr_63_32 |
  8038. * |-------------------------------------------------------------|
  8039. * | ip_dst_addr_95_64 |
  8040. * |-------------------------------------------------------------|
  8041. * | ip_dst_addr_127_96 |
  8042. * |-------------------------------------------------------------|
  8043. * | l4_dst_port | l4_src_port |
  8044. * | (32-bit SPI incase of IPsec) |
  8045. * |-------------------------------------------------------------|
  8046. * | reserved | l4_proto |
  8047. * |-------------------------------------------------------------|
  8048. *
  8049. * where I is 1-bit ipsec_valid.
  8050. *
  8051. * The following field definitions describe the format of the RX FSE operation
  8052. * message sent from the host to target for every add/delete flow entry to flow
  8053. * table.
  8054. *
  8055. * Header fields:
  8056. * dword0 - b'7:0 - msg_type: This will be set to
  8057. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8058. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8059. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8060. * specified pdev's LMAC ring.
  8061. * b'31:16 - reserved : Reserved for future use
  8062. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8063. * (Internet Protocol Security).
  8064. * IPsec describes the framework for providing security at
  8065. * IP layer. IPsec is defined for both versions of IP:
  8066. * IPV4 and IPV6.
  8067. * Please refer to htt_rx_flow_proto enumeration below for
  8068. * more info.
  8069. * ipsec_valid = 1 for IPSEC packets
  8070. * ipsec_valid = 0 for IP Packets
  8071. * b'7:1 - operation: This indicates types of FSE operation.
  8072. * Refer to htt_rx_fse_operation enumeration:
  8073. * 0 - No Cache Invalidation required
  8074. * 1 - Cache invalidate only one entry given by IP
  8075. * src/dest address at DWORD[2:9]
  8076. * 2 - Complete FSE Cache Invalidation
  8077. * 3 - FSE Disable
  8078. * 4 - FSE Enable
  8079. * b'31:8 - reserved: Reserved for future use
  8080. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8081. * for per flow addition/deletion
  8082. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8083. * and the subsequent 3 A_UINT32 will be padding bytes.
  8084. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8085. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8086. * from 0 to 65535 but only 0 to 1023 are designated as
  8087. * well-known ports. Refer to [RFC1700] for more details.
  8088. * This field is valid only if
  8089. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8090. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8091. * range from 0 to 65535 but only 0 to 1023 are designated
  8092. * as well-known ports. Refer to [RFC1700] for more details.
  8093. * This field is valid only if
  8094. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8095. * - SPI (31:0): Security Parameters Index is an
  8096. * identification tag added to the header while using IPsec
  8097. * for tunneling the IP traffici.
  8098. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8099. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8100. * Assigned Internet Protocol Numbers.
  8101. * l4_proto numbers for standard protocol like UDP/TCP
  8102. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8103. * l4_proto = 17 for UDP etc.
  8104. * b'31:8 - reserved: Reserved for future use.
  8105. *
  8106. */
  8107. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8108. A_UINT32 msg_type:8,
  8109. pdev_id:8,
  8110. reserved0:16;
  8111. A_UINT32 ipsec_valid:1,
  8112. operation:7,
  8113. reserved1:24;
  8114. A_UINT32 ip_src_addr_31_0;
  8115. A_UINT32 ip_src_addr_63_32;
  8116. A_UINT32 ip_src_addr_95_64;
  8117. A_UINT32 ip_src_addr_127_96;
  8118. A_UINT32 ip_dest_addr_31_0;
  8119. A_UINT32 ip_dest_addr_63_32;
  8120. A_UINT32 ip_dest_addr_95_64;
  8121. A_UINT32 ip_dest_addr_127_96;
  8122. union {
  8123. A_UINT32 spi;
  8124. struct {
  8125. A_UINT32 l4_src_port:16,
  8126. l4_dest_port:16;
  8127. } ip;
  8128. } u;
  8129. A_UINT32 l4_proto:8,
  8130. reserved:24;
  8131. } POSTPACK;
  8132. /**
  8133. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8134. *
  8135. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8136. *
  8137. * @details
  8138. * The host will send this Full monitor mode register configuration message.
  8139. * This message can be sent per SOC or per PDEV which is differentiated
  8140. * by pdev id values.
  8141. *
  8142. * |31 16|15 11|10 8|7 3|2|1|0|
  8143. * |-------------------------------------------------------------|
  8144. * | reserved | pdev_id | MSG_TYPE |
  8145. * |-------------------------------------------------------------|
  8146. * | reserved |Release Ring |N|Z|E|
  8147. * |-------------------------------------------------------------|
  8148. *
  8149. * where E is 1-bit full monitor mode enable/disable.
  8150. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8151. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8152. *
  8153. * The following field definitions describe the format of the full monitor
  8154. * mode configuration message sent from the host to target for each pdev.
  8155. *
  8156. * Header fields:
  8157. * dword0 - b'7:0 - msg_type: This will be set to
  8158. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8159. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8160. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8161. * specified pdev's LMAC ring.
  8162. * b'31:16 - reserved : Reserved for future use.
  8163. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8164. * monitor mode rxdma register is to be enabled or disabled.
  8165. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8166. * additional descriptors at ppdu end for zero mpdus
  8167. * enabled or disabled.
  8168. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8169. * additional descriptors at ppdu end for non zero mpdus
  8170. * enabled or disabled.
  8171. * b'10:3 - release_ring: This indicates the destination ring
  8172. * selection for the descriptor at the end of PPDU
  8173. * 0 - REO ring select
  8174. * 1 - FW ring select
  8175. * 2 - SW ring select
  8176. * 3 - Release ring select
  8177. * Refer to htt_rx_full_mon_release_ring.
  8178. * b'31:11 - reserved for future use
  8179. */
  8180. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8181. A_UINT32 msg_type:8,
  8182. pdev_id:8,
  8183. reserved0:16;
  8184. A_UINT32 full_monitor_mode_enable:1,
  8185. addnl_descs_zero_mpdus_end:1,
  8186. addnl_descs_non_zero_mpdus_end:1,
  8187. release_ring:8,
  8188. reserved1:21;
  8189. } POSTPACK;
  8190. /**
  8191. * Enumeration for full monitor mode destination ring select
  8192. * 0 - REO destination ring select
  8193. * 1 - FW destination ring select
  8194. * 2 - SW destination ring select
  8195. * 3 - Release destination ring select
  8196. */
  8197. enum htt_rx_full_mon_release_ring {
  8198. HTT_RX_MON_RING_REO,
  8199. HTT_RX_MON_RING_FW,
  8200. HTT_RX_MON_RING_SW,
  8201. HTT_RX_MON_RING_RELEASE,
  8202. };
  8203. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8204. /* DWORD 0: Pdev ID */
  8205. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8206. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8207. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8208. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8209. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8210. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8211. do { \
  8212. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8213. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8214. } while (0)
  8215. /* DWORD 1:ENABLE */
  8216. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8217. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8218. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8219. do { \
  8220. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8221. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8222. } while (0)
  8223. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8224. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8225. /* DWORD 1:ZERO_MPDU */
  8226. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8227. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8228. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8229. do { \
  8230. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8231. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8232. } while (0)
  8233. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8234. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8235. /* DWORD 1:NON_ZERO_MPDU */
  8236. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8237. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8238. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8239. do { \
  8240. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8241. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8242. } while (0)
  8243. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8244. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8245. /* DWORD 1:RELEASE_RINGS */
  8246. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8247. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8248. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8251. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8252. } while (0)
  8253. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8254. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8255. /**
  8256. * Enumeration for IP Protocol or IPSEC Protocol
  8257. * IPsec describes the framework for providing security at IP layer.
  8258. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8259. */
  8260. enum htt_rx_flow_proto {
  8261. HTT_RX_FLOW_IP_PROTO,
  8262. HTT_RX_FLOW_IPSEC_PROTO,
  8263. };
  8264. /**
  8265. * Enumeration for FSE Cache Invalidation
  8266. * 0 - No Cache Invalidation required
  8267. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8268. * 2 - Complete FSE Cache Invalidation
  8269. * 3 - FSE Disable
  8270. * 4 - FSE Enable
  8271. */
  8272. enum htt_rx_fse_operation {
  8273. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8274. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8275. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8276. HTT_RX_FSE_DISABLE,
  8277. HTT_RX_FSE_ENABLE,
  8278. };
  8279. /* DWORD 0: Pdev ID */
  8280. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8281. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8282. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8283. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8284. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8285. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8286. do { \
  8287. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8288. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8289. } while (0)
  8290. /* DWORD 1:IP PROTO or IPSEC */
  8291. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8292. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8293. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8294. do { \
  8295. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8296. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8297. } while (0)
  8298. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8299. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8300. /* DWORD 1:FSE Operation */
  8301. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8302. #define HTT_RX_FSE_OPERATION_S 1
  8303. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8304. do { \
  8305. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8306. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8307. } while (0)
  8308. #define HTT_RX_FSE_OPERATION_GET(word) \
  8309. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8310. /* DWORD 2-9:IP Address */
  8311. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8312. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8313. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8314. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8315. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8316. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8317. do { \
  8318. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8319. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8320. } while (0)
  8321. /* DWORD 10:Source Port Number */
  8322. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8323. #define HTT_RX_FSE_SOURCEPORT_S 0
  8324. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8327. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8328. } while (0)
  8329. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8330. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8331. /* DWORD 11:Destination Port Number */
  8332. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8333. #define HTT_RX_FSE_DESTPORT_S 16
  8334. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8335. do { \
  8336. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8337. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8338. } while (0)
  8339. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8340. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8341. /* DWORD 10-11:SPI (In case of IPSEC) */
  8342. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8343. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8344. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8345. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8346. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8347. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8348. do { \
  8349. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8350. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8351. } while (0)
  8352. /* DWORD 12:L4 PROTO */
  8353. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8354. #define HTT_RX_FSE_L4_PROTO_S 0
  8355. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8356. do { \
  8357. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8358. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8359. } while (0)
  8360. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8361. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8362. /**
  8363. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8364. *
  8365. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8366. *
  8367. * |31 24|23 |15 8|7 2|1|0|
  8368. * |----------------+----------------+----------------+----------------|
  8369. * | reserved | pdev_id | msg_type |
  8370. * |---------------------------------+----------------+----------------|
  8371. * | reserved |E|F|
  8372. * |---------------------------------+----------------+----------------|
  8373. * Where E = Configure the target to provide the 3-tuple hash value in
  8374. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8375. * F = Configure the target to provide the 3-tuple hash value in
  8376. * flow_id_toeplitz field of rx_msdu_start tlv
  8377. *
  8378. * The following field definitions describe the format of the 3 tuple hash value
  8379. * message sent from the host to target as part of initialization sequence.
  8380. *
  8381. * Header fields:
  8382. * dword0 - b'7:0 - msg_type: This will be set to
  8383. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8384. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8385. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8386. * specified pdev's LMAC ring.
  8387. * b'31:16 - reserved : Reserved for future use
  8388. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8389. * b'1 - toeplitz_hash_2_or_4_field_enable
  8390. * b'31:2 - reserved : Reserved for future use
  8391. * ---------+------+----------------------------------------------------------
  8392. * bit1 | bit0 | Functionality
  8393. * ---------+------+----------------------------------------------------------
  8394. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8395. * | | in flow_id_toeplitz field
  8396. * ---------+------+----------------------------------------------------------
  8397. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8398. * | | in toeplitz_hash_2_or_4 field
  8399. * ---------+------+----------------------------------------------------------
  8400. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8401. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8402. * ---------+------+----------------------------------------------------------
  8403. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8404. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8405. * | | toeplitz_hash_2_or_4 field
  8406. *----------------------------------------------------------------------------
  8407. */
  8408. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8409. A_UINT32 msg_type :8,
  8410. pdev_id :8,
  8411. reserved0 :16;
  8412. A_UINT32 flow_id_toeplitz_field_enable :1,
  8413. toeplitz_hash_2_or_4_field_enable :1,
  8414. reserved1 :30;
  8415. } POSTPACK;
  8416. /* DWORD0 : pdev_id configuration Macros */
  8417. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8418. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8419. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8420. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8421. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8422. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8423. do { \
  8424. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8425. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8426. } while (0)
  8427. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8428. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8429. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8430. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8431. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8432. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8433. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8434. do { \
  8435. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8436. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8437. } while (0)
  8438. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8439. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8440. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8441. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8442. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8443. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8446. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8447. } while (0)
  8448. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8449. /**
  8450. * @brief host --> target Host PA Address Size
  8451. *
  8452. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8453. *
  8454. * @details
  8455. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8456. * provide the physical start address and size of each of the memory
  8457. * areas within host DDR that the target FW may need to access.
  8458. *
  8459. * For example, the host can use this message to allow the target FW
  8460. * to set up access to the host's pools of TQM link descriptors.
  8461. * The message would appear as follows:
  8462. *
  8463. * |31 24|23 16|15 8|7 0|
  8464. * |----------------+----------------+----------------+----------------|
  8465. * | reserved | num_entries | msg_type |
  8466. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8467. * | mem area 0 size |
  8468. * |----------------+----------------+----------------+----------------|
  8469. * | mem area 0 physical_address_lo |
  8470. * |----------------+----------------+----------------+----------------|
  8471. * | mem area 0 physical_address_hi |
  8472. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8473. * | mem area 1 size |
  8474. * |----------------+----------------+----------------+----------------|
  8475. * | mem area 1 physical_address_lo |
  8476. * |----------------+----------------+----------------+----------------|
  8477. * | mem area 1 physical_address_hi |
  8478. * |----------------+----------------+----------------+----------------|
  8479. * ...
  8480. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8481. * | mem area N size |
  8482. * |----------------+----------------+----------------+----------------|
  8483. * | mem area N physical_address_lo |
  8484. * |----------------+----------------+----------------+----------------|
  8485. * | mem area N physical_address_hi |
  8486. * |----------------+----------------+----------------+----------------|
  8487. *
  8488. * The message is interpreted as follows:
  8489. * dword0 - b'0:7 - msg_type: This will be set to
  8490. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8491. * b'8:15 - number_entries: Indicated the number of host memory
  8492. * areas specified within the remainder of the message
  8493. * b'16:31 - reserved.
  8494. * dword1 - b'0:31 - memory area 0 size in bytes
  8495. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8496. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8497. * and similar for memory area 1 through memory area N.
  8498. */
  8499. PREPACK struct htt_h2t_host_paddr_size {
  8500. A_UINT32 msg_type: 8,
  8501. num_entries: 8,
  8502. reserved: 16;
  8503. } POSTPACK;
  8504. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8505. A_UINT32 size;
  8506. A_UINT32 physical_address_lo;
  8507. A_UINT32 physical_address_hi;
  8508. } POSTPACK;
  8509. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8510. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8511. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8512. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8513. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8514. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8515. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8516. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8517. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8518. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8519. do { \
  8520. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8521. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8522. } while (0)
  8523. /**
  8524. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8525. *
  8526. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8527. *
  8528. * @details
  8529. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8530. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8531. *
  8532. * The message would appear as follows:
  8533. *
  8534. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8535. * |---------------------------------+---+---+----------+-+-----------|
  8536. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8537. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8538. *
  8539. *
  8540. * The message is interpreted as follows:
  8541. * dword0 - b'0:7 - msg_type: This will be set to
  8542. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8543. * b'8 - override bit to drive MSDUs to PPE ring
  8544. * b'9:13 - REO destination ring indication
  8545. * b'14 - Multi buffer msdu override enable bit
  8546. * b'15 - Intra BSS override
  8547. * b'16 - Decap raw override
  8548. * b'17 - Decap Native wifi override
  8549. * b'18 - IP frag override
  8550. * b'19:31 - reserved
  8551. */
  8552. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8553. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8554. override: 1,
  8555. reo_destination_indication: 5,
  8556. multi_buffer_msdu_override_en: 1,
  8557. intra_bss_override: 1,
  8558. decap_raw_override: 1,
  8559. decap_nwifi_override: 1,
  8560. ip_frag_override: 1,
  8561. reserved: 13;
  8562. } POSTPACK;
  8563. /* DWORD 0: Override */
  8564. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8565. #define HTT_PPE_CFG_OVERRIDE_S 8
  8566. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8567. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8568. HTT_PPE_CFG_OVERRIDE_S)
  8569. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8570. do { \
  8571. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8572. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8573. } while (0)
  8574. /* DWORD 0: REO Destination Indication*/
  8575. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8576. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8577. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8578. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8579. HTT_PPE_CFG_REO_DEST_IND_S)
  8580. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8581. do { \
  8582. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8583. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8584. } while (0)
  8585. /* DWORD 0: Multi buffer MSDU override */
  8586. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8587. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8588. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8589. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8590. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8591. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8592. do { \
  8593. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8594. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8595. } while (0)
  8596. /* DWORD 0: Intra BSS override */
  8597. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8598. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8599. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8600. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8601. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8602. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8603. do { \
  8604. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8605. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8606. } while (0)
  8607. /* DWORD 0: Decap RAW override */
  8608. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8609. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8610. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8611. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8612. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8613. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8614. do { \
  8615. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8616. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8617. } while (0)
  8618. /* DWORD 0: Decap NWIFI override */
  8619. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8620. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8621. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8622. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8623. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8624. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8625. do { \
  8626. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8627. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8628. } while (0)
  8629. /* DWORD 0: IP frag override */
  8630. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8631. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8632. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8633. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8634. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8635. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8638. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8639. } while (0)
  8640. /*
  8641. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8642. *
  8643. * @details
  8644. * The following field definitions describe the format of the HTT host
  8645. * to target FW VDEV TX RX stats retrieve message.
  8646. * The message specifies the type of stats the host wants to retrieve.
  8647. *
  8648. * |31 27|26 25|24 17|16|15 8|7 0|
  8649. * |-----------------------------------------------------------|
  8650. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8651. * |-----------------------------------------------------------|
  8652. * | vdev_id lower bitmask |
  8653. * |-----------------------------------------------------------|
  8654. * | vdev_id upper bitmask |
  8655. * |-----------------------------------------------------------|
  8656. * Header fields:
  8657. * Where:
  8658. * dword0 - b'7:0 - msg_type: This will be set to
  8659. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8660. * b'15:8 - pdev id
  8661. * b'16(E) - Enable/Disable the vdev HW stats
  8662. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8663. * b'25:26(R) - Reset stats bits
  8664. * 0: don't reset stats
  8665. * 1: reset stats once
  8666. * 2: reset stats at the start of each periodic interval
  8667. * b'27:31 - reserved for future use
  8668. * dword1 - b'0:31 - vdev_id lower bitmask
  8669. * dword2 - b'0:31 - vdev_id upper bitmask
  8670. */
  8671. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8672. A_UINT32 msg_type :8,
  8673. pdev_id :8,
  8674. enable :1,
  8675. periodic_interval :8,
  8676. reset_stats_bits :2,
  8677. reserved0 :5;
  8678. A_UINT32 vdev_id_lower_bitmask;
  8679. A_UINT32 vdev_id_upper_bitmask;
  8680. } POSTPACK;
  8681. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8682. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8683. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8684. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8685. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8686. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8689. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8690. } while (0)
  8691. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8692. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8693. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8694. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8695. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8696. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8697. do { \
  8698. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8699. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8700. } while (0)
  8701. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8702. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8703. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8704. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8705. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8706. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8707. do { \
  8708. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8709. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8710. } while (0)
  8711. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8712. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8713. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8714. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8715. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8716. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8717. do { \
  8718. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8719. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8720. } while (0)
  8721. /*
  8722. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8723. *
  8724. * @details
  8725. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8726. * the default MSDU queues for one of the TIDs within the specified peer
  8727. * to the specified service class.
  8728. * The TID is indirectly specified - each service class is associated
  8729. * with a TID. All default MSDU queues for this peer-TID will be
  8730. * linked to the service class in question.
  8731. *
  8732. * |31 16|15 8|7 0|
  8733. * |------------------------------+--------------+--------------|
  8734. * | peer ID | svc class ID | msg type |
  8735. * |------------------------------------------------------------|
  8736. * Header fields:
  8737. * dword0 - b'7:0 - msg_type: This will be set to
  8738. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8739. * b'15:8 - service class ID
  8740. * b'31:16 - peer ID
  8741. */
  8742. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8743. A_UINT32 msg_type :8,
  8744. svc_class_id :8,
  8745. peer_id :16;
  8746. } POSTPACK;
  8747. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8748. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8749. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8750. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8751. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8752. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8753. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8754. do { \
  8755. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8756. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8757. } while (0)
  8758. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8759. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8760. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8761. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8762. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8763. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8766. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8767. } while (0)
  8768. /*
  8769. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8770. *
  8771. * @details
  8772. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8773. * remove the linkage of the specified peer-TID's MSDU queues to
  8774. * service classes.
  8775. *
  8776. * |31 16|15 8|7 0|
  8777. * |------------------------------+--------------+--------------|
  8778. * | peer ID | svc class ID | msg type |
  8779. * |------------------------------------------------------------|
  8780. * Header fields:
  8781. * dword0 - b'7:0 - msg_type: This will be set to
  8782. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8783. * b'15:8 - service class ID
  8784. * b'31:16 - peer ID
  8785. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8786. * value for peer ID indicates that the target should
  8787. * apply the UNMAP_REQ to all peers.
  8788. */
  8789. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8790. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8791. A_UINT32 msg_type :8,
  8792. svc_class_id :8,
  8793. peer_id :16;
  8794. } POSTPACK;
  8795. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8796. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8797. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8798. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8799. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8800. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8801. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8802. do { \
  8803. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8804. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8805. } while (0)
  8806. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8807. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8808. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8809. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8810. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8811. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8812. do { \
  8813. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8814. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8815. } while (0)
  8816. /*
  8817. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8818. *
  8819. * @details
  8820. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8821. * request the target to report what service class the default MSDU queues
  8822. * of the specified TIDs within the peer are linked to.
  8823. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8824. * to report what service class (if any) the default MSDU queues for
  8825. * each of the specified TIDs are linked to.
  8826. *
  8827. * |31 16|15 8|7 1| 0|
  8828. * |------------------------------+--------------+--------------|
  8829. * | peer ID | TID mask | msg type |
  8830. * |------------------------------------------------------------|
  8831. * | reserved |ETO|
  8832. * |------------------------------------------------------------|
  8833. * Header fields:
  8834. * dword0 - b'7:0 - msg_type: This will be set to
  8835. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8836. * b'15:8 - TID mask
  8837. * b'31:16 - peer ID
  8838. * dword1 - b'0 - "Existing Tids Only" flag
  8839. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8840. * message generated by this REQ will only show the
  8841. * mapping for TIDs that actually exist in the target's
  8842. * peer object.
  8843. * Any TIDs that are covered by a MAP_REQ but which
  8844. * do not actually exist will be shown as being
  8845. * unmapped (i.e. svc class ID 0xff).
  8846. * If this flag is cleared, the MAP_REPORT_CONF message
  8847. * will consider not only the mapping of TIDs currently
  8848. * existing in the peer, but also the mapping that will
  8849. * be applied for any TID objects created within this
  8850. * peer in the future.
  8851. * b'31:1 - reserved for future use
  8852. */
  8853. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8854. A_UINT32 msg_type :8,
  8855. tid_mask :8,
  8856. peer_id :16;
  8857. A_UINT32 existing_tids_only:1,
  8858. reserved :31;
  8859. } POSTPACK;
  8860. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8861. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8862. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8863. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8864. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8865. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8866. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8867. do { \
  8868. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8869. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8870. } while (0)
  8871. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8872. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8873. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8874. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8875. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8876. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8877. do { \
  8878. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8879. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8880. } while (0)
  8881. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8882. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8883. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8884. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8885. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8886. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8887. do { \
  8888. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8889. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8890. } while (0)
  8891. /**
  8892. * @brief Format of shared memory between Host and Target
  8893. * for UMAC hang recovery feature messaging.
  8894. * @details
  8895. * This is shared memory between Host and Target allocated
  8896. * and used in chips where UMAC hang recovery feature is supported.
  8897. * This shared memory is allocated per SOC level by Host since each
  8898. * SOC's target Q6FW needs to communicate independently to the Host
  8899. * through its own shared memory.
  8900. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8901. * then host interprets it as a new message from target.
  8902. * Host clears that particular read bit in t2h_msg after each read
  8903. * operation. It is vice versa for h2t_msg. At any given point
  8904. * of time there is expected to be only one bit set
  8905. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8906. *
  8907. * The message is interpreted as follows:
  8908. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8909. * added for debuggability purpose.
  8910. * dword1 - b'0 - do_pre_reset
  8911. * b'1 - do_post_reset_start
  8912. * b'2 - do_post_reset_complete
  8913. * b'3 - initiate_umac_recovery
  8914. * b'4:31 - rsvd_t2h
  8915. * dword2 - b'0 - pre_reset_done
  8916. * b'1 - post_reset_start_done
  8917. * b'2 - post_reset_complete_done
  8918. * b'3 - start_pre_reset
  8919. * b'4:31 - rsvd_h2t
  8920. */
  8921. PREPACK typedef struct {
  8922. /** Magic number added for debuggability. */
  8923. A_UINT32 magic_num;
  8924. union {
  8925. /*
  8926. * BIT [0] :- T2H msg to do pre-reset
  8927. * BIT [1] :- T2H msg to do post-reset start
  8928. * BIT [2] :- T2H msg to do post-reset complete
  8929. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8930. * This is needed to synchronize UMAC recovery
  8931. * across all SOCs.
  8932. * BIT [31 : 4] :- reserved
  8933. */
  8934. A_UINT32 t2h_msg;
  8935. struct {
  8936. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8937. do_post_reset_start : 1, /* BIT [1] */
  8938. do_post_reset_complete : 1, /* BIT [2] */
  8939. initiate_umac_recovery : 1, /* BIT [3] */
  8940. rsvd_t2h : 28; /* BIT [31 : 4] */
  8941. };
  8942. };
  8943. union {
  8944. /*
  8945. * BIT [0] :- H2T msg to send pre-reset done
  8946. * BIT [1] :- H2T msg to send post-reset start done
  8947. * BIT [2] :- H2T msg to send post-reset complete done
  8948. * BIT [3] :- H2T msg to start pre-reset.
  8949. * This is expected only after T2H
  8950. * initiate_umac_recovery was received by Host
  8951. * from one of the SOCs.
  8952. * BIT [31 : 4] :- reserved
  8953. */
  8954. A_UINT32 h2t_msg;
  8955. struct {
  8956. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8957. post_reset_start_done : 1, /* BIT [1] */
  8958. post_reset_complete_done : 1, /* BIT [2] */
  8959. start_pre_reset : 1, /* BIT [3] */
  8960. rsvd_h2t : 28; /* BIT [31 : 4] */
  8961. };
  8962. };
  8963. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8964. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8965. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8966. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8967. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8968. /* dword1 - b'0 - do_pre_reset */
  8969. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8970. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8971. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8972. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8973. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8974. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8977. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8978. } while (0)
  8979. /* dword1 - b'1 - do_post_reset_start */
  8980. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8981. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8982. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8983. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8984. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8985. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8988. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8989. } while (0)
  8990. /* dword1 - b'2 - do_post_reset_complete */
  8991. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8992. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8993. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8994. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8995. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8996. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8997. do { \
  8998. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8999. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9000. } while (0)
  9001. /* dword1 - b'3 - initiate_umac_recovery */
  9002. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9003. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9004. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9005. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9006. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9007. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9008. do { \
  9009. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9010. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9011. } while (0)
  9012. /* dword2 - b'0 - pre_reset_done */
  9013. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9014. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9015. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9016. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9017. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9018. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9019. do { \
  9020. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9021. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9022. } while (0)
  9023. /* dword2 - b'1 - post_reset_start_done */
  9024. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9025. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9026. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9027. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9028. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9029. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9030. do { \
  9031. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9032. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9033. } while (0)
  9034. /* dword2 - b'2 - post_reset_complete_done */
  9035. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9036. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9037. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9038. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9039. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9040. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9041. do { \
  9042. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9043. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9044. } while (0)
  9045. /* dword2 - b'3 - start_pre_reset */
  9046. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9047. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9048. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9049. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9050. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9051. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9052. do { \
  9053. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9054. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9055. } while (0)
  9056. /**
  9057. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9058. *
  9059. * @details
  9060. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9061. * by the host to provide prerequisite info to target for the UMAC hang
  9062. * recovery feature.
  9063. * The info sent in this H2T message are T2H message method, H2T message
  9064. * method, T2H MSI interrupt number and physical start address, size of
  9065. * the shared memory (refers to the shared memory dedicated for messaging
  9066. * between host and target when the DUT is in UMAC hang recovery mode).
  9067. * This H2T message is expected to be only sent if the WMI service bit
  9068. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9069. *
  9070. * |31 16|15 12|11 8|7 0|
  9071. * |-------------------------------+--------------+--------------+------------|
  9072. * | reserved |h2t msg method|t2h msg method| msg_type |
  9073. * |--------------------------------------------------------------------------|
  9074. * | t2h msi interrupt number |
  9075. * |--------------------------------------------------------------------------|
  9076. * | shared memory area size |
  9077. * |--------------------------------------------------------------------------|
  9078. * | shared memory area physical address low |
  9079. * |--------------------------------------------------------------------------|
  9080. * | shared memory area physical address high |
  9081. * |--------------------------------------------------------------------------|
  9082. *
  9083. * The message is interpreted as follows:
  9084. * dword0 - b'0:7 - msg_type
  9085. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9086. * b'8:11 - t2h_msg_method: indicates method to be used for
  9087. * T2H communication in UMAC hang recovery mode.
  9088. * Value zero indicates MSI interrupt (default method).
  9089. * Refer to htt_umac_hang_recovery_msg_method enum.
  9090. * b'12:15 - h2t_msg_method: indicates method to be used for
  9091. * H2T communication in UMAC hang recovery mode.
  9092. * Value zero indicates polling by target for this h2t msg
  9093. * during UMAC hang recovery mode.
  9094. * Refer to htt_umac_hang_recovery_msg_method enum.
  9095. * b'16:31 - reserved.
  9096. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9097. * T2H communication in UMAC hang recovery mode.
  9098. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9099. * only when in UMAC hang recovery mode.
  9100. * This refers to size in bytes.
  9101. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9102. * of the shared memory dedicated for messaging only when
  9103. * in UMAC hang recovery mode.
  9104. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9105. * of the shared memory dedicated for messaging only when
  9106. * in UMAC hang recovery mode.
  9107. */
  9108. /* t2h_msg_method and h2t_msg_method */
  9109. enum htt_umac_hang_recovery_msg_method {
  9110. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9111. };
  9112. PREPACK typedef struct {
  9113. A_UINT32 msg_type : 8,
  9114. t2h_msg_method : 4,
  9115. h2t_msg_method : 4,
  9116. reserved : 16;
  9117. A_UINT32 t2h_msi_data;
  9118. /* size bytes and physical address of shared memory. */
  9119. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9120. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9121. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9122. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9123. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9124. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9125. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9126. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9127. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9128. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9129. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9130. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9131. do { \
  9132. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9133. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9134. } while (0)
  9135. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9136. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9137. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9138. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9139. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9140. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9143. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9144. } while (0)
  9145. /**
  9146. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9147. *
  9148. * @details
  9149. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9150. * HTT message sent by the host to indicate that the target needs to start the
  9151. * UMAC hang recovery feature from the point of pre-reset routine.
  9152. * The purpose of this H2T message is to have host synchronize and trigger
  9153. * UMAC recovery across all targets.
  9154. * The info sent in this H2T message is the flag to indicate whether the
  9155. * target needs to execute UMAC-recovery in context of the Initiator or
  9156. * Non-Initiator.
  9157. * This H2T message is expected to be sent as response to the
  9158. * initiate_umac_recovery indication from the Initiator target attached to
  9159. * this same host.
  9160. * This H2T message is expected to be only sent if the WMI service bit
  9161. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9162. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9163. * beforehand.
  9164. *
  9165. * |31 9|8|7 0|
  9166. * |-----------------------------------------------------------|
  9167. * | reserved |I| msg_type |
  9168. * |-----------------------------------------------------------|
  9169. * Where:
  9170. * I = is_initiator
  9171. *
  9172. * The message is interpreted as follows:
  9173. * dword0 - b'0:7 - msg_type
  9174. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9175. * b'8 - is_initiator: indicates whether the target needs to
  9176. * execute the UMAC-recovery in context of the Initiator or
  9177. * Non-Initiator.
  9178. * The value zero indicates this target is Non-Initiator.
  9179. * b'9:31 - reserved.
  9180. */
  9181. PREPACK typedef struct {
  9182. A_UINT32 msg_type : 8,
  9183. is_initiator : 1,
  9184. reserved : 23;
  9185. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9186. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9187. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9188. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9189. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9190. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9191. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9192. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9193. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9194. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9195. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9196. do { \
  9197. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9198. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9199. } while (0)
  9200. /*=== target -> host messages ===============================================*/
  9201. enum htt_t2h_msg_type {
  9202. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9203. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9204. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9205. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9206. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9207. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9208. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9209. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9210. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9211. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9212. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9213. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9214. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9215. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9216. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9217. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9218. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9219. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9220. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9221. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9222. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9223. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9224. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9225. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9226. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9227. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9228. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9229. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9230. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9231. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9232. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9233. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9234. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9235. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9236. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9237. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9238. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9239. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9240. /* TX_OFFLOAD_DELIVER_IND:
  9241. * Forward the target's locally-generated packets to the host,
  9242. * to provide to the monitor mode interface.
  9243. */
  9244. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9245. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9246. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9247. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9248. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9249. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9250. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9251. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9252. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9253. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9254. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9255. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9256. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9257. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9258. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9259. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9260. HTT_T2H_MSG_TYPE_TEST,
  9261. /* keep this last */
  9262. HTT_T2H_NUM_MSGS
  9263. };
  9264. /*
  9265. * HTT target to host message type -
  9266. * stored in bits 7:0 of the first word of the message
  9267. */
  9268. #define HTT_T2H_MSG_TYPE_M 0xff
  9269. #define HTT_T2H_MSG_TYPE_S 0
  9270. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9271. do { \
  9272. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9273. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9274. } while (0)
  9275. #define HTT_T2H_MSG_TYPE_GET(word) \
  9276. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9277. /**
  9278. * @brief target -> host version number confirmation message definition
  9279. *
  9280. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9281. *
  9282. * |31 24|23 16|15 8|7 0|
  9283. * |----------------+----------------+----------------+----------------|
  9284. * | reserved | major number | minor number | msg type |
  9285. * |-------------------------------------------------------------------|
  9286. * : option request TLV (optional) |
  9287. * :...................................................................:
  9288. *
  9289. * The VER_CONF message may consist of a single 4-byte word, or may be
  9290. * extended with TLVs that specify HTT options selected by the target.
  9291. * The following option TLVs may be appended to the VER_CONF message:
  9292. * - LL_BUS_ADDR_SIZE
  9293. * - HL_SUPPRESS_TX_COMPL_IND
  9294. * - MAX_TX_QUEUE_GROUPS
  9295. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9296. * may be appended to the VER_CONF message (but only one TLV of each type).
  9297. *
  9298. * Header fields:
  9299. * - MSG_TYPE
  9300. * Bits 7:0
  9301. * Purpose: identifies this as a version number confirmation message
  9302. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9303. * - VER_MINOR
  9304. * Bits 15:8
  9305. * Purpose: Specify the minor number of the HTT message library version
  9306. * in use by the target firmware.
  9307. * The minor number specifies the specific revision within a range
  9308. * of fundamentally compatible HTT message definition revisions.
  9309. * Compatible revisions involve adding new messages or perhaps
  9310. * adding new fields to existing messages, in a backwards-compatible
  9311. * manner.
  9312. * Incompatible revisions involve changing the message type values,
  9313. * or redefining existing messages.
  9314. * Value: minor number
  9315. * - VER_MAJOR
  9316. * Bits 15:8
  9317. * Purpose: Specify the major number of the HTT message library version
  9318. * in use by the target firmware.
  9319. * The major number specifies the family of minor revisions that are
  9320. * fundamentally compatible with each other, but not with prior or
  9321. * later families.
  9322. * Value: major number
  9323. */
  9324. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9325. #define HTT_VER_CONF_MINOR_S 8
  9326. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9327. #define HTT_VER_CONF_MAJOR_S 16
  9328. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9329. do { \
  9330. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9331. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9332. } while (0)
  9333. #define HTT_VER_CONF_MINOR_GET(word) \
  9334. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9335. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9336. do { \
  9337. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9338. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9339. } while (0)
  9340. #define HTT_VER_CONF_MAJOR_GET(word) \
  9341. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9342. #define HTT_VER_CONF_BYTES 4
  9343. /**
  9344. * @brief - target -> host HTT Rx In order indication message
  9345. *
  9346. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9347. *
  9348. * @details
  9349. *
  9350. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9351. * |----------------+-------------------+---------------------+---------------|
  9352. * | peer ID | P| F| O| ext TID | msg type |
  9353. * |--------------------------------------------------------------------------|
  9354. * | MSDU count | Reserved | vdev id |
  9355. * |--------------------------------------------------------------------------|
  9356. * | MSDU 0 bus address (bits 31:0) |
  9357. #if HTT_PADDR64
  9358. * | MSDU 0 bus address (bits 63:32) |
  9359. #endif
  9360. * |--------------------------------------------------------------------------|
  9361. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9362. * |--------------------------------------------------------------------------|
  9363. * | MSDU 1 bus address (bits 31:0) |
  9364. #if HTT_PADDR64
  9365. * | MSDU 1 bus address (bits 63:32) |
  9366. #endif
  9367. * |--------------------------------------------------------------------------|
  9368. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9369. * |--------------------------------------------------------------------------|
  9370. */
  9371. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9372. *
  9373. * @details
  9374. * bits
  9375. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9376. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9377. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9378. * | | frag | | | | fail |chksum fail|
  9379. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9380. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9381. */
  9382. struct htt_rx_in_ord_paddr_ind_hdr_t
  9383. {
  9384. A_UINT32 /* word 0 */
  9385. msg_type: 8,
  9386. ext_tid: 5,
  9387. offload: 1,
  9388. frag: 1,
  9389. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9390. peer_id: 16;
  9391. A_UINT32 /* word 1 */
  9392. vap_id: 8,
  9393. /* NOTE:
  9394. * This reserved_1 field is not truly reserved - certain targets use
  9395. * this field internally to store debug information, and do not zero
  9396. * out the contents of the field before uploading the message to the
  9397. * host. Thus, any host-target communication supported by this field
  9398. * is limited to using values that are never used by the debug
  9399. * information stored by certain targets in the reserved_1 field.
  9400. * In particular, the targets in question don't use the value 0x3
  9401. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9402. * so this previously-unused value within these bits is available to
  9403. * use as the host / target PKT_CAPTURE_MODE flag.
  9404. */
  9405. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9406. /* if pkt_capture_mode == 0x3, host should
  9407. * send rx frames to monitor mode interface
  9408. */
  9409. msdu_cnt: 16;
  9410. };
  9411. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9412. {
  9413. A_UINT32 dma_addr;
  9414. A_UINT32
  9415. length: 16,
  9416. fw_desc: 8,
  9417. msdu_info:8;
  9418. };
  9419. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9420. {
  9421. A_UINT32 dma_addr_lo;
  9422. A_UINT32 dma_addr_hi;
  9423. A_UINT32
  9424. length: 16,
  9425. fw_desc: 8,
  9426. msdu_info:8;
  9427. };
  9428. #if HTT_PADDR64
  9429. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9430. #else
  9431. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9432. #endif
  9433. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9434. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9435. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9436. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9437. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9438. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9439. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9440. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9441. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9443. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9444. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9445. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9446. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9447. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9448. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9449. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9450. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9451. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9452. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9453. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9454. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9455. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9456. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9457. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9458. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9459. /* for systems using 64-bit format for bus addresses */
  9460. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9461. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9462. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9463. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9464. /* for systems using 32-bit format for bus addresses */
  9465. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9466. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9467. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9468. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9469. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9470. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9471. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9472. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9473. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9474. do { \
  9475. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9476. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9477. } while (0)
  9478. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9479. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9480. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9481. do { \
  9482. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9483. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9484. } while (0)
  9485. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9486. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9487. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9488. do { \
  9489. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9490. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9491. } while (0)
  9492. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9493. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9494. /*
  9495. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9496. * deliver the rx frames to the monitor mode interface.
  9497. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9498. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9499. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9500. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9501. */
  9502. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9503. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9504. do { \
  9505. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9506. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9507. } while (0)
  9508. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9509. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9510. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9511. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9512. do { \
  9513. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9514. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9515. } while (0)
  9516. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9517. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9518. /* for systems using 64-bit format for bus addresses */
  9519. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9520. do { \
  9521. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9522. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9523. } while (0)
  9524. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9525. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9526. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9527. do { \
  9528. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9529. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9530. } while (0)
  9531. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9532. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9533. /* for systems using 32-bit format for bus addresses */
  9534. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9537. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9538. } while (0)
  9539. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9540. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9541. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9542. do { \
  9543. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9544. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9545. } while (0)
  9546. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9547. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9548. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9549. do { \
  9550. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9551. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9552. } while (0)
  9553. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9554. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9555. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9556. do { \
  9557. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9558. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9559. } while (0)
  9560. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9561. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9562. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9563. do { \
  9564. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9565. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9566. } while (0)
  9567. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9568. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9569. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9570. do { \
  9571. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9572. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9573. } while (0)
  9574. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9575. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9576. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9577. do { \
  9578. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9579. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9580. } while (0)
  9581. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9582. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9583. /* definitions used within target -> host rx indication message */
  9584. PREPACK struct htt_rx_ind_hdr_prefix_t
  9585. {
  9586. A_UINT32 /* word 0 */
  9587. msg_type: 8,
  9588. ext_tid: 5,
  9589. release_valid: 1,
  9590. flush_valid: 1,
  9591. reserved0: 1,
  9592. peer_id: 16;
  9593. A_UINT32 /* word 1 */
  9594. flush_start_seq_num: 6,
  9595. flush_end_seq_num: 6,
  9596. release_start_seq_num: 6,
  9597. release_end_seq_num: 6,
  9598. num_mpdu_ranges: 8;
  9599. } POSTPACK;
  9600. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9601. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9602. #define HTT_TGT_RSSI_INVALID 0x80
  9603. PREPACK struct htt_rx_ppdu_desc_t
  9604. {
  9605. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9606. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9607. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9608. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9609. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9610. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9611. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9612. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9613. A_UINT32 /* word 0 */
  9614. rssi_cmb: 8,
  9615. timestamp_submicrosec: 8,
  9616. phy_err_code: 8,
  9617. phy_err: 1,
  9618. legacy_rate: 4,
  9619. legacy_rate_sel: 1,
  9620. end_valid: 1,
  9621. start_valid: 1;
  9622. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9623. union {
  9624. A_UINT32 /* word 1 */
  9625. rssi0_pri20: 8,
  9626. rssi0_ext20: 8,
  9627. rssi0_ext40: 8,
  9628. rssi0_ext80: 8;
  9629. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9630. } u0;
  9631. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9632. union {
  9633. A_UINT32 /* word 2 */
  9634. rssi1_pri20: 8,
  9635. rssi1_ext20: 8,
  9636. rssi1_ext40: 8,
  9637. rssi1_ext80: 8;
  9638. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9639. } u1;
  9640. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9641. union {
  9642. A_UINT32 /* word 3 */
  9643. rssi2_pri20: 8,
  9644. rssi2_ext20: 8,
  9645. rssi2_ext40: 8,
  9646. rssi2_ext80: 8;
  9647. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9648. } u2;
  9649. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9650. union {
  9651. A_UINT32 /* word 4 */
  9652. rssi3_pri20: 8,
  9653. rssi3_ext20: 8,
  9654. rssi3_ext40: 8,
  9655. rssi3_ext80: 8;
  9656. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9657. } u3;
  9658. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9659. A_UINT32 tsf32; /* word 5 */
  9660. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9661. A_UINT32 timestamp_microsec; /* word 6 */
  9662. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9663. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9664. A_UINT32 /* word 7 */
  9665. vht_sig_a1: 24,
  9666. preamble_type: 8;
  9667. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9668. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9669. A_UINT32 /* word 8 */
  9670. vht_sig_a2: 24,
  9671. /* sa_ant_matrix
  9672. * For cases where a single rx chain has options to be connected to
  9673. * different rx antennas, show which rx antennas were in use during
  9674. * receipt of a given PPDU.
  9675. * This sa_ant_matrix provides a bitmask of the antennas used while
  9676. * receiving this frame.
  9677. */
  9678. sa_ant_matrix: 8;
  9679. } POSTPACK;
  9680. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9681. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9682. PREPACK struct htt_rx_ind_hdr_suffix_t
  9683. {
  9684. A_UINT32 /* word 0 */
  9685. fw_rx_desc_bytes: 16,
  9686. reserved0: 16;
  9687. } POSTPACK;
  9688. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9689. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9690. PREPACK struct htt_rx_ind_hdr_t
  9691. {
  9692. struct htt_rx_ind_hdr_prefix_t prefix;
  9693. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9694. struct htt_rx_ind_hdr_suffix_t suffix;
  9695. } POSTPACK;
  9696. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9697. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9698. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9699. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9700. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9701. /*
  9702. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9703. * the offset into the HTT rx indication message at which the
  9704. * FW rx PPDU descriptor resides
  9705. */
  9706. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9707. /*
  9708. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9709. * the offset into the HTT rx indication message at which the
  9710. * header suffix (FW rx MSDU byte count) resides
  9711. */
  9712. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9713. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9714. /*
  9715. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9716. * the offset into the HTT rx indication message at which the per-MSDU
  9717. * information starts
  9718. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9719. * per-MSDU information portion of the message. The per-MSDU info itself
  9720. * starts at byte 12.
  9721. */
  9722. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9723. /**
  9724. * @brief target -> host rx indication message definition
  9725. *
  9726. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9727. *
  9728. * @details
  9729. * The following field definitions describe the format of the rx indication
  9730. * message sent from the target to the host.
  9731. * The message consists of three major sections:
  9732. * 1. a fixed-length header
  9733. * 2. a variable-length list of firmware rx MSDU descriptors
  9734. * 3. one or more 4-octet MPDU range information elements
  9735. * The fixed length header itself has two sub-sections
  9736. * 1. the message meta-information, including identification of the
  9737. * sender and type of the received data, and a 4-octet flush/release IE
  9738. * 2. the firmware rx PPDU descriptor
  9739. *
  9740. * The format of the message is depicted below.
  9741. * in this depiction, the following abbreviations are used for information
  9742. * elements within the message:
  9743. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9744. * elements associated with the PPDU start are valid.
  9745. * Specifically, the following fields are valid only if SV is set:
  9746. * RSSI (all variants), L, legacy rate, preamble type, service,
  9747. * VHT-SIG-A
  9748. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9749. * elements associated with the PPDU end are valid.
  9750. * Specifically, the following fields are valid only if EV is set:
  9751. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9752. * - L - Legacy rate selector - if legacy rates are used, this flag
  9753. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9754. * (L == 0) PHY.
  9755. * - P - PHY error flag - boolean indication of whether the rx frame had
  9756. * a PHY error
  9757. *
  9758. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9759. * |----------------+-------------------+---------------------+---------------|
  9760. * | peer ID | |RV|FV| ext TID | msg type |
  9761. * |--------------------------------------------------------------------------|
  9762. * | num | release | release | flush | flush |
  9763. * | MPDU | end | start | end | start |
  9764. * | ranges | seq num | seq num | seq num | seq num |
  9765. * |==========================================================================|
  9766. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9767. * |V|V| | rate | | | timestamp | RSSI |
  9768. * |--------------------------------------------------------------------------|
  9769. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9770. * |--------------------------------------------------------------------------|
  9771. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9772. * |--------------------------------------------------------------------------|
  9773. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9774. * |--------------------------------------------------------------------------|
  9775. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9776. * |--------------------------------------------------------------------------|
  9777. * | TSF LSBs |
  9778. * |--------------------------------------------------------------------------|
  9779. * | microsec timestamp |
  9780. * |--------------------------------------------------------------------------|
  9781. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9782. * |--------------------------------------------------------------------------|
  9783. * | service | HT-SIG / VHT-SIG-A2 |
  9784. * |==========================================================================|
  9785. * | reserved | FW rx desc bytes |
  9786. * |--------------------------------------------------------------------------|
  9787. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9788. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9789. * |--------------------------------------------------------------------------|
  9790. * : : :
  9791. * |--------------------------------------------------------------------------|
  9792. * | alignment | MSDU Rx |
  9793. * | padding | desc Bn |
  9794. * |--------------------------------------------------------------------------|
  9795. * | reserved | MPDU range status | MPDU count |
  9796. * |--------------------------------------------------------------------------|
  9797. * : reserved : MPDU range status : MPDU count :
  9798. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9799. *
  9800. * Header fields:
  9801. * - MSG_TYPE
  9802. * Bits 7:0
  9803. * Purpose: identifies this as an rx indication message
  9804. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9805. * - EXT_TID
  9806. * Bits 12:8
  9807. * Purpose: identify the traffic ID of the rx data, including
  9808. * special "extended" TID values for multicast, broadcast, and
  9809. * non-QoS data frames
  9810. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9811. * - FLUSH_VALID (FV)
  9812. * Bit 13
  9813. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9814. * is valid
  9815. * Value:
  9816. * 1 -> flush IE is valid and needs to be processed
  9817. * 0 -> flush IE is not valid and should be ignored
  9818. * - REL_VALID (RV)
  9819. * Bit 13
  9820. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9821. * is valid
  9822. * Value:
  9823. * 1 -> release IE is valid and needs to be processed
  9824. * 0 -> release IE is not valid and should be ignored
  9825. * - PEER_ID
  9826. * Bits 31:16
  9827. * Purpose: Identify, by ID, which peer sent the rx data
  9828. * Value: ID of the peer who sent the rx data
  9829. * - FLUSH_SEQ_NUM_START
  9830. * Bits 5:0
  9831. * Purpose: Indicate the start of a series of MPDUs to flush
  9832. * Not all MPDUs within this series are necessarily valid - the host
  9833. * must check each sequence number within this range to see if the
  9834. * corresponding MPDU is actually present.
  9835. * This field is only valid if the FV bit is set.
  9836. * Value:
  9837. * The sequence number for the first MPDUs to check to flush.
  9838. * The sequence number is masked by 0x3f.
  9839. * - FLUSH_SEQ_NUM_END
  9840. * Bits 11:6
  9841. * Purpose: Indicate the end of a series of MPDUs to flush
  9842. * Value:
  9843. * The sequence number one larger than the sequence number of the
  9844. * last MPDU to check to flush.
  9845. * The sequence number is masked by 0x3f.
  9846. * Not all MPDUs within this series are necessarily valid - the host
  9847. * must check each sequence number within this range to see if the
  9848. * corresponding MPDU is actually present.
  9849. * This field is only valid if the FV bit is set.
  9850. * - REL_SEQ_NUM_START
  9851. * Bits 17:12
  9852. * Purpose: Indicate the start of a series of MPDUs to release.
  9853. * All MPDUs within this series are present and valid - the host
  9854. * need not check each sequence number within this range to see if
  9855. * the corresponding MPDU is actually present.
  9856. * This field is only valid if the RV bit is set.
  9857. * Value:
  9858. * The sequence number for the first MPDUs to check to release.
  9859. * The sequence number is masked by 0x3f.
  9860. * - REL_SEQ_NUM_END
  9861. * Bits 23:18
  9862. * Purpose: Indicate the end of a series of MPDUs to release.
  9863. * Value:
  9864. * The sequence number one larger than the sequence number of the
  9865. * last MPDU to check to release.
  9866. * The sequence number is masked by 0x3f.
  9867. * All MPDUs within this series are present and valid - the host
  9868. * need not check each sequence number within this range to see if
  9869. * the corresponding MPDU is actually present.
  9870. * This field is only valid if the RV bit is set.
  9871. * - NUM_MPDU_RANGES
  9872. * Bits 31:24
  9873. * Purpose: Indicate how many ranges of MPDUs are present.
  9874. * Each MPDU range consists of a series of contiguous MPDUs within the
  9875. * rx frame sequence which all have the same MPDU status.
  9876. * Value: 1-63 (typically a small number, like 1-3)
  9877. *
  9878. * Rx PPDU descriptor fields:
  9879. * - RSSI_CMB
  9880. * Bits 7:0
  9881. * Purpose: Combined RSSI from all active rx chains, across the active
  9882. * bandwidth.
  9883. * Value: RSSI dB units w.r.t. noise floor
  9884. * - TIMESTAMP_SUBMICROSEC
  9885. * Bits 15:8
  9886. * Purpose: high-resolution timestamp
  9887. * Value:
  9888. * Sub-microsecond time of PPDU reception.
  9889. * This timestamp ranges from [0,MAC clock MHz).
  9890. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9891. * to form a high-resolution, large range rx timestamp.
  9892. * - PHY_ERR_CODE
  9893. * Bits 23:16
  9894. * Purpose:
  9895. * If the rx frame processing resulted in a PHY error, indicate what
  9896. * type of rx PHY error occurred.
  9897. * Value:
  9898. * This field is valid if the "P" (PHY_ERR) flag is set.
  9899. * TBD: document/specify the values for this field
  9900. * - PHY_ERR
  9901. * Bit 24
  9902. * Purpose: indicate whether the rx PPDU had a PHY error
  9903. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9904. * - LEGACY_RATE
  9905. * Bits 28:25
  9906. * Purpose:
  9907. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9908. * specify which rate was used.
  9909. * Value:
  9910. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9911. * flag.
  9912. * If LEGACY_RATE_SEL is 0:
  9913. * 0x8: OFDM 48 Mbps
  9914. * 0x9: OFDM 24 Mbps
  9915. * 0xA: OFDM 12 Mbps
  9916. * 0xB: OFDM 6 Mbps
  9917. * 0xC: OFDM 54 Mbps
  9918. * 0xD: OFDM 36 Mbps
  9919. * 0xE: OFDM 18 Mbps
  9920. * 0xF: OFDM 9 Mbps
  9921. * If LEGACY_RATE_SEL is 1:
  9922. * 0x8: CCK 11 Mbps long preamble
  9923. * 0x9: CCK 5.5 Mbps long preamble
  9924. * 0xA: CCK 2 Mbps long preamble
  9925. * 0xB: CCK 1 Mbps long preamble
  9926. * 0xC: CCK 11 Mbps short preamble
  9927. * 0xD: CCK 5.5 Mbps short preamble
  9928. * 0xE: CCK 2 Mbps short preamble
  9929. * - LEGACY_RATE_SEL
  9930. * Bit 29
  9931. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9932. * Value:
  9933. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9934. * used a legacy rate.
  9935. * 0 -> OFDM, 1 -> CCK
  9936. * - END_VALID
  9937. * Bit 30
  9938. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9939. * the start of the PPDU are valid. Specifically, the following
  9940. * fields are only valid if END_VALID is set:
  9941. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9942. * TIMESTAMP_SUBMICROSEC
  9943. * Value:
  9944. * 0 -> rx PPDU desc end fields are not valid
  9945. * 1 -> rx PPDU desc end fields are valid
  9946. * - START_VALID
  9947. * Bit 31
  9948. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9949. * the end of the PPDU are valid. Specifically, the following
  9950. * fields are only valid if START_VALID is set:
  9951. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9952. * VHT-SIG-A
  9953. * Value:
  9954. * 0 -> rx PPDU desc start fields are not valid
  9955. * 1 -> rx PPDU desc start fields are valid
  9956. * - RSSI0_PRI20
  9957. * Bits 7:0
  9958. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9959. * Value: RSSI dB units w.r.t. noise floor
  9960. *
  9961. * - RSSI0_EXT20
  9962. * Bits 7:0
  9963. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9964. * (if the rx bandwidth was >= 40 MHz)
  9965. * Value: RSSI dB units w.r.t. noise floor
  9966. * - RSSI0_EXT40
  9967. * Bits 7:0
  9968. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9969. * (if the rx bandwidth was >= 80 MHz)
  9970. * Value: RSSI dB units w.r.t. noise floor
  9971. * - RSSI0_EXT80
  9972. * Bits 7:0
  9973. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9974. * (if the rx bandwidth was >= 160 MHz)
  9975. * Value: RSSI dB units w.r.t. noise floor
  9976. *
  9977. * - RSSI1_PRI20
  9978. * Bits 7:0
  9979. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9980. * Value: RSSI dB units w.r.t. noise floor
  9981. * - RSSI1_EXT20
  9982. * Bits 7:0
  9983. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9984. * (if the rx bandwidth was >= 40 MHz)
  9985. * Value: RSSI dB units w.r.t. noise floor
  9986. * - RSSI1_EXT40
  9987. * Bits 7:0
  9988. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9989. * (if the rx bandwidth was >= 80 MHz)
  9990. * Value: RSSI dB units w.r.t. noise floor
  9991. * - RSSI1_EXT80
  9992. * Bits 7:0
  9993. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9994. * (if the rx bandwidth was >= 160 MHz)
  9995. * Value: RSSI dB units w.r.t. noise floor
  9996. *
  9997. * - RSSI2_PRI20
  9998. * Bits 7:0
  9999. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10000. * Value: RSSI dB units w.r.t. noise floor
  10001. * - RSSI2_EXT20
  10002. * Bits 7:0
  10003. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10004. * (if the rx bandwidth was >= 40 MHz)
  10005. * Value: RSSI dB units w.r.t. noise floor
  10006. * - RSSI2_EXT40
  10007. * Bits 7:0
  10008. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10009. * (if the rx bandwidth was >= 80 MHz)
  10010. * Value: RSSI dB units w.r.t. noise floor
  10011. * - RSSI2_EXT80
  10012. * Bits 7:0
  10013. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10014. * (if the rx bandwidth was >= 160 MHz)
  10015. * Value: RSSI dB units w.r.t. noise floor
  10016. *
  10017. * - RSSI3_PRI20
  10018. * Bits 7:0
  10019. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10020. * Value: RSSI dB units w.r.t. noise floor
  10021. * - RSSI3_EXT20
  10022. * Bits 7:0
  10023. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10024. * (if the rx bandwidth was >= 40 MHz)
  10025. * Value: RSSI dB units w.r.t. noise floor
  10026. * - RSSI3_EXT40
  10027. * Bits 7:0
  10028. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10029. * (if the rx bandwidth was >= 80 MHz)
  10030. * Value: RSSI dB units w.r.t. noise floor
  10031. * - RSSI3_EXT80
  10032. * Bits 7:0
  10033. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10034. * (if the rx bandwidth was >= 160 MHz)
  10035. * Value: RSSI dB units w.r.t. noise floor
  10036. *
  10037. * - TSF32
  10038. * Bits 31:0
  10039. * Purpose: specify the time the rx PPDU was received, in TSF units
  10040. * Value: 32 LSBs of the TSF
  10041. * - TIMESTAMP_MICROSEC
  10042. * Bits 31:0
  10043. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10044. * Value: PPDU rx time, in microseconds
  10045. * - VHT_SIG_A1
  10046. * Bits 23:0
  10047. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10048. * from the rx PPDU
  10049. * Value:
  10050. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10051. * VHT-SIG-A1 data.
  10052. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10053. * first 24 bits of the HT-SIG data.
  10054. * Otherwise, this field is invalid.
  10055. * Refer to the the 802.11 protocol for the definition of the
  10056. * HT-SIG and VHT-SIG-A1 fields
  10057. * - VHT_SIG_A2
  10058. * Bits 23:0
  10059. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10060. * from the rx PPDU
  10061. * Value:
  10062. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10063. * VHT-SIG-A2 data.
  10064. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10065. * last 24 bits of the HT-SIG data.
  10066. * Otherwise, this field is invalid.
  10067. * Refer to the the 802.11 protocol for the definition of the
  10068. * HT-SIG and VHT-SIG-A2 fields
  10069. * - PREAMBLE_TYPE
  10070. * Bits 31:24
  10071. * Purpose: indicate the PHY format of the received burst
  10072. * Value:
  10073. * 0x4: Legacy (OFDM/CCK)
  10074. * 0x8: HT
  10075. * 0x9: HT with TxBF
  10076. * 0xC: VHT
  10077. * 0xD: VHT with TxBF
  10078. * - SERVICE
  10079. * Bits 31:24
  10080. * Purpose: TBD
  10081. * Value: TBD
  10082. *
  10083. * Rx MSDU descriptor fields:
  10084. * - FW_RX_DESC_BYTES
  10085. * Bits 15:0
  10086. * Purpose: Indicate how many bytes in the Rx indication are used for
  10087. * FW Rx descriptors
  10088. *
  10089. * Payload fields:
  10090. * - MPDU_COUNT
  10091. * Bits 7:0
  10092. * Purpose: Indicate how many sequential MPDUs share the same status.
  10093. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10094. * - MPDU_STATUS
  10095. * Bits 15:8
  10096. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10097. * received successfully.
  10098. * Value:
  10099. * 0x1: success
  10100. * 0x2: FCS error
  10101. * 0x3: duplicate error
  10102. * 0x4: replay error
  10103. * 0x5: invalid peer
  10104. */
  10105. /* header fields */
  10106. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10107. #define HTT_RX_IND_EXT_TID_S 8
  10108. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10109. #define HTT_RX_IND_FLUSH_VALID_S 13
  10110. #define HTT_RX_IND_REL_VALID_M 0x4000
  10111. #define HTT_RX_IND_REL_VALID_S 14
  10112. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10113. #define HTT_RX_IND_PEER_ID_S 16
  10114. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10115. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10116. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10117. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10118. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10119. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10120. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10121. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10122. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10123. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10124. /* rx PPDU descriptor fields */
  10125. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10126. #define HTT_RX_IND_RSSI_CMB_S 0
  10127. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10128. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10129. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10130. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10131. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10132. #define HTT_RX_IND_PHY_ERR_S 24
  10133. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10134. #define HTT_RX_IND_LEGACY_RATE_S 25
  10135. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10136. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10137. #define HTT_RX_IND_END_VALID_M 0x40000000
  10138. #define HTT_RX_IND_END_VALID_S 30
  10139. #define HTT_RX_IND_START_VALID_M 0x80000000
  10140. #define HTT_RX_IND_START_VALID_S 31
  10141. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10142. #define HTT_RX_IND_RSSI_PRI20_S 0
  10143. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10144. #define HTT_RX_IND_RSSI_EXT20_S 8
  10145. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10146. #define HTT_RX_IND_RSSI_EXT40_S 16
  10147. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10148. #define HTT_RX_IND_RSSI_EXT80_S 24
  10149. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10150. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10151. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10152. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10153. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10154. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10155. #define HTT_RX_IND_SERVICE_M 0xff000000
  10156. #define HTT_RX_IND_SERVICE_S 24
  10157. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10158. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10159. /* rx MSDU descriptor fields */
  10160. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10161. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10162. /* payload fields */
  10163. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10164. #define HTT_RX_IND_MPDU_COUNT_S 0
  10165. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10166. #define HTT_RX_IND_MPDU_STATUS_S 8
  10167. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10168. do { \
  10169. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10170. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10171. } while (0)
  10172. #define HTT_RX_IND_EXT_TID_GET(word) \
  10173. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10174. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10175. do { \
  10176. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10177. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10178. } while (0)
  10179. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10180. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10181. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10182. do { \
  10183. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10184. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10185. } while (0)
  10186. #define HTT_RX_IND_REL_VALID_GET(word) \
  10187. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10188. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10189. do { \
  10190. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10191. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10192. } while (0)
  10193. #define HTT_RX_IND_PEER_ID_GET(word) \
  10194. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10195. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10196. do { \
  10197. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10198. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10199. } while (0)
  10200. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10201. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10202. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10203. do { \
  10204. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10205. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10206. } while (0)
  10207. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10208. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10209. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10210. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10213. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10214. } while (0)
  10215. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10216. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10217. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10218. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10219. do { \
  10220. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10221. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10222. } while (0)
  10223. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10224. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10225. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10226. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10227. do { \
  10228. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10229. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10230. } while (0)
  10231. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10232. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10233. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10234. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10235. do { \
  10236. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10237. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10238. } while (0)
  10239. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10240. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10241. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10242. /* FW rx PPDU descriptor fields */
  10243. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10244. do { \
  10245. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10246. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10247. } while (0)
  10248. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10249. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10250. HTT_RX_IND_RSSI_CMB_S)
  10251. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10252. do { \
  10253. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10254. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10255. } while (0)
  10256. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10257. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10258. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10259. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10260. do { \
  10261. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10262. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10263. } while (0)
  10264. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10265. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10266. HTT_RX_IND_PHY_ERR_CODE_S)
  10267. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10268. do { \
  10269. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10270. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10271. } while (0)
  10272. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10273. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10274. HTT_RX_IND_PHY_ERR_S)
  10275. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10276. do { \
  10277. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10278. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10279. } while (0)
  10280. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10281. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10282. HTT_RX_IND_LEGACY_RATE_S)
  10283. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10284. do { \
  10285. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10286. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10287. } while (0)
  10288. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10289. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10290. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10291. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10292. do { \
  10293. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10294. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10295. } while (0)
  10296. #define HTT_RX_IND_END_VALID_GET(word) \
  10297. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10298. HTT_RX_IND_END_VALID_S)
  10299. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10300. do { \
  10301. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10302. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10303. } while (0)
  10304. #define HTT_RX_IND_START_VALID_GET(word) \
  10305. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10306. HTT_RX_IND_START_VALID_S)
  10307. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10308. do { \
  10309. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10310. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10311. } while (0)
  10312. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10313. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10314. HTT_RX_IND_RSSI_PRI20_S)
  10315. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10316. do { \
  10317. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10318. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10319. } while (0)
  10320. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10321. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10322. HTT_RX_IND_RSSI_EXT20_S)
  10323. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10326. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10327. } while (0)
  10328. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10329. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10330. HTT_RX_IND_RSSI_EXT40_S)
  10331. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10332. do { \
  10333. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10334. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10335. } while (0)
  10336. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10337. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10338. HTT_RX_IND_RSSI_EXT80_S)
  10339. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10340. do { \
  10341. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10342. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10343. } while (0)
  10344. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10345. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10346. HTT_RX_IND_VHT_SIG_A1_S)
  10347. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10348. do { \
  10349. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10350. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10351. } while (0)
  10352. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10353. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10354. HTT_RX_IND_VHT_SIG_A2_S)
  10355. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10358. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10359. } while (0)
  10360. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10361. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10362. HTT_RX_IND_PREAMBLE_TYPE_S)
  10363. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10366. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10367. } while (0)
  10368. #define HTT_RX_IND_SERVICE_GET(word) \
  10369. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10370. HTT_RX_IND_SERVICE_S)
  10371. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10374. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10375. } while (0)
  10376. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10377. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10378. HTT_RX_IND_SA_ANT_MATRIX_S)
  10379. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10382. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10383. } while (0)
  10384. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10385. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10386. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10389. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10390. } while (0)
  10391. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10392. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10393. #define HTT_RX_IND_HL_BYTES \
  10394. (HTT_RX_IND_HDR_BYTES + \
  10395. 4 /* single FW rx MSDU descriptor */ + \
  10396. 4 /* single MPDU range information element */)
  10397. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10398. /* Could we use one macro entry? */
  10399. #define HTT_WORD_SET(word, field, value) \
  10400. do { \
  10401. HTT_CHECK_SET_VAL(field, value); \
  10402. (word) |= ((value) << field ## _S); \
  10403. } while (0)
  10404. #define HTT_WORD_GET(word, field) \
  10405. (((word) & field ## _M) >> field ## _S)
  10406. PREPACK struct hl_htt_rx_ind_base {
  10407. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10408. } POSTPACK;
  10409. /*
  10410. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10411. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10412. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10413. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10414. * htt_rx_ind_hl_rx_desc_t.
  10415. */
  10416. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10417. struct htt_rx_ind_hl_rx_desc_t {
  10418. A_UINT8 ver;
  10419. A_UINT8 len;
  10420. struct {
  10421. A_UINT8
  10422. first_msdu: 1,
  10423. last_msdu: 1,
  10424. c3_failed: 1,
  10425. c4_failed: 1,
  10426. ipv6: 1,
  10427. tcp: 1,
  10428. udp: 1,
  10429. reserved: 1;
  10430. } flags;
  10431. /* NOTE: no reserved space - don't append any new fields here */
  10432. };
  10433. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10434. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10435. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10436. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10437. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10438. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10439. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10440. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10441. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10442. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10443. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10444. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10445. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10446. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10447. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10448. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10449. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10450. /* This structure is used in HL, the basic descriptor information
  10451. * used by host. the structure is translated by FW from HW desc
  10452. * or generated by FW. But in HL monitor mode, the host would use
  10453. * the same structure with LL.
  10454. */
  10455. PREPACK struct hl_htt_rx_desc_base {
  10456. A_UINT32
  10457. seq_num:12,
  10458. encrypted:1,
  10459. chan_info_present:1,
  10460. resv0:2,
  10461. mcast_bcast:1,
  10462. fragment:1,
  10463. key_id_oct:8,
  10464. resv1:6;
  10465. A_UINT32
  10466. pn_31_0;
  10467. union {
  10468. struct {
  10469. A_UINT16 pn_47_32;
  10470. A_UINT16 pn_63_48;
  10471. } pn16;
  10472. A_UINT32 pn_63_32;
  10473. } u0;
  10474. A_UINT32
  10475. pn_95_64;
  10476. A_UINT32
  10477. pn_127_96;
  10478. } POSTPACK;
  10479. /*
  10480. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10481. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10482. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10483. * Please see htt_chan_change_t for description of the fields.
  10484. */
  10485. PREPACK struct htt_chan_info_t
  10486. {
  10487. A_UINT32 primary_chan_center_freq_mhz: 16,
  10488. contig_chan1_center_freq_mhz: 16;
  10489. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10490. phy_mode: 8,
  10491. reserved: 8;
  10492. } POSTPACK;
  10493. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10494. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10495. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10496. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10497. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10498. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10499. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10500. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10501. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10502. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10503. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10504. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10505. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10506. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10507. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10508. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10509. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10510. /* Channel information */
  10511. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10512. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10513. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10514. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10515. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10516. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10517. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10518. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10519. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10520. do { \
  10521. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10522. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10523. } while (0)
  10524. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10525. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10526. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10527. do { \
  10528. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10529. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10530. } while (0)
  10531. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10532. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10533. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10534. do { \
  10535. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10536. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10537. } while (0)
  10538. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10539. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10540. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10541. do { \
  10542. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10543. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10544. } while (0)
  10545. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10546. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10547. /*
  10548. * @brief target -> host message definition for FW offloaded pkts
  10549. *
  10550. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10551. *
  10552. * @details
  10553. * The following field definitions describe the format of the firmware
  10554. * offload deliver message sent from the target to the host.
  10555. *
  10556. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10557. *
  10558. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10559. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10560. * | reserved_1 | msg type |
  10561. * |--------------------------------------------------------------------------|
  10562. * | phy_timestamp_l32 |
  10563. * |--------------------------------------------------------------------------|
  10564. * | WORD2 (see below) |
  10565. * |--------------------------------------------------------------------------|
  10566. * | seqno | framectrl |
  10567. * |--------------------------------------------------------------------------|
  10568. * | reserved_3 | vdev_id | tid_num|
  10569. * |--------------------------------------------------------------------------|
  10570. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10571. * |--------------------------------------------------------------------------|
  10572. *
  10573. * where:
  10574. * STAT = status
  10575. * F = format (802.3 vs. 802.11)
  10576. *
  10577. * definition for word 2
  10578. *
  10579. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10580. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10581. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10582. * |--------------------------------------------------------------------------|
  10583. *
  10584. * where:
  10585. * PR = preamble
  10586. * BF = beamformed
  10587. */
  10588. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10589. {
  10590. A_UINT32 /* word 0 */
  10591. msg_type:8, /* [ 7: 0] */
  10592. reserved_1:24; /* [31: 8] */
  10593. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10594. A_UINT32 /* word 2 */
  10595. /* preamble:
  10596. * 0-OFDM,
  10597. * 1-CCk,
  10598. * 2-HT,
  10599. * 3-VHT
  10600. */
  10601. preamble: 2, /* [1:0] */
  10602. /* mcs:
  10603. * In case of HT preamble interpret
  10604. * MCS along with NSS.
  10605. * Valid values for HT are 0 to 7.
  10606. * HT mcs 0 with NSS 2 is mcs 8.
  10607. * Valid values for VHT are 0 to 9.
  10608. */
  10609. mcs: 4, /* [5:2] */
  10610. /* rate:
  10611. * This is applicable only for
  10612. * CCK and OFDM preamble type
  10613. * rate 0: OFDM 48 Mbps,
  10614. * 1: OFDM 24 Mbps,
  10615. * 2: OFDM 12 Mbps
  10616. * 3: OFDM 6 Mbps
  10617. * 4: OFDM 54 Mbps
  10618. * 5: OFDM 36 Mbps
  10619. * 6: OFDM 18 Mbps
  10620. * 7: OFDM 9 Mbps
  10621. * rate 0: CCK 11 Mbps Long
  10622. * 1: CCK 5.5 Mbps Long
  10623. * 2: CCK 2 Mbps Long
  10624. * 3: CCK 1 Mbps Long
  10625. * 4: CCK 11 Mbps Short
  10626. * 5: CCK 5.5 Mbps Short
  10627. * 6: CCK 2 Mbps Short
  10628. */
  10629. rate : 3, /* [ 8: 6] */
  10630. rssi : 8, /* [16: 9] units=dBm */
  10631. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10632. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10633. stbc : 1, /* [22] */
  10634. sgi : 1, /* [23] */
  10635. ldpc : 1, /* [24] */
  10636. beamformed: 1, /* [25] */
  10637. reserved_2: 6; /* [31:26] */
  10638. A_UINT32 /* word 3 */
  10639. framectrl:16, /* [15: 0] */
  10640. seqno:16; /* [31:16] */
  10641. A_UINT32 /* word 4 */
  10642. tid_num:5, /* [ 4: 0] actual TID number */
  10643. vdev_id:8, /* [12: 5] */
  10644. reserved_3:19; /* [31:13] */
  10645. A_UINT32 /* word 5 */
  10646. /* status:
  10647. * 0: tx_ok
  10648. * 1: retry
  10649. * 2: drop
  10650. * 3: filtered
  10651. * 4: abort
  10652. * 5: tid delete
  10653. * 6: sw abort
  10654. * 7: dropped by peer migration
  10655. */
  10656. status:3, /* [2:0] */
  10657. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10658. tx_mpdu_bytes:16, /* [19:4] */
  10659. /* Indicates retry count of offloaded/local generated Data tx frames */
  10660. tx_retry_cnt:6, /* [25:20] */
  10661. reserved_4:6; /* [31:26] */
  10662. } POSTPACK;
  10663. /* FW offload deliver ind message header fields */
  10664. /* DWORD one */
  10665. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10666. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10667. /* DWORD two */
  10668. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10669. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10670. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10671. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10672. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10673. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10674. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10675. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10676. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10677. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10678. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10679. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10680. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10681. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10682. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10683. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10684. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10685. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10686. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10687. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10688. /* DWORD three*/
  10689. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10690. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10691. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10692. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10693. /* DWORD four */
  10694. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10695. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10696. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10697. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10698. /* DWORD five */
  10699. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10700. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10701. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10702. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10703. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10704. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10705. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10706. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10707. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10708. do { \
  10709. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10710. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10711. } while (0)
  10712. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10713. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10714. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10715. do { \
  10716. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10717. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10718. } while (0)
  10719. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10720. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10721. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10722. do { \
  10723. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10724. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10725. } while (0)
  10726. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10727. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10728. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10729. do { \
  10730. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10731. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10732. } while (0)
  10733. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10734. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10735. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10736. do { \
  10737. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10738. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10739. } while (0)
  10740. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10741. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10742. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10743. do { \
  10744. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10745. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10746. } while (0)
  10747. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10748. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10749. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10750. do { \
  10751. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10752. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10753. } while (0)
  10754. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10755. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10756. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10757. do { \
  10758. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10759. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10760. } while (0)
  10761. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10762. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10763. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10764. do { \
  10765. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10766. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10767. } while (0)
  10768. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10769. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10770. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10771. do { \
  10772. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10773. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10774. } while (0)
  10775. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10776. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10777. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10778. do { \
  10779. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10780. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10781. } while (0)
  10782. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10783. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10784. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10785. do { \
  10786. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10787. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10788. } while (0)
  10789. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10790. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10791. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10792. do { \
  10793. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10794. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10795. } while (0)
  10796. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10797. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10798. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10801. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10802. } while (0)
  10803. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10804. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10805. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10806. do { \
  10807. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10808. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10809. } while (0)
  10810. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10811. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10812. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10813. do { \
  10814. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10815. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10816. } while (0)
  10817. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10818. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10819. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10820. do { \
  10821. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10822. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10823. } while (0)
  10824. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10825. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10826. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10827. do { \
  10828. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10829. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10830. } while (0)
  10831. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10832. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10833. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10834. do { \
  10835. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10836. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10837. } while (0)
  10838. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10839. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10840. /*
  10841. * @brief target -> host rx reorder flush message definition
  10842. *
  10843. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10844. *
  10845. * @details
  10846. * The following field definitions describe the format of the rx flush
  10847. * message sent from the target to the host.
  10848. * The message consists of a 4-octet header, followed by one or more
  10849. * 4-octet payload information elements.
  10850. *
  10851. * |31 24|23 8|7 0|
  10852. * |--------------------------------------------------------------|
  10853. * | TID | peer ID | msg type |
  10854. * |--------------------------------------------------------------|
  10855. * | seq num end | seq num start | MPDU status | reserved |
  10856. * |--------------------------------------------------------------|
  10857. * First DWORD:
  10858. * - MSG_TYPE
  10859. * Bits 7:0
  10860. * Purpose: identifies this as an rx flush message
  10861. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10862. * - PEER_ID
  10863. * Bits 23:8 (only bits 18:8 actually used)
  10864. * Purpose: identify which peer's rx data is being flushed
  10865. * Value: (rx) peer ID
  10866. * - TID
  10867. * Bits 31:24 (only bits 27:24 actually used)
  10868. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10869. * Value: traffic identifier
  10870. * Second DWORD:
  10871. * - MPDU_STATUS
  10872. * Bits 15:8
  10873. * Purpose:
  10874. * Indicate whether the flushed MPDUs should be discarded or processed.
  10875. * Value:
  10876. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10877. * stages of rx processing
  10878. * other: discard the MPDUs
  10879. * It is anticipated that flush messages will always have
  10880. * MPDU status == 1, but the status flag is included for
  10881. * flexibility.
  10882. * - SEQ_NUM_START
  10883. * Bits 23:16
  10884. * Purpose:
  10885. * Indicate the start of a series of consecutive MPDUs being flushed.
  10886. * Not all MPDUs within this range are necessarily valid - the host
  10887. * must check each sequence number within this range to see if the
  10888. * corresponding MPDU is actually present.
  10889. * Value:
  10890. * The sequence number for the first MPDU in the sequence.
  10891. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10892. * - SEQ_NUM_END
  10893. * Bits 30:24
  10894. * Purpose:
  10895. * Indicate the end of a series of consecutive MPDUs being flushed.
  10896. * Value:
  10897. * The sequence number one larger than the sequence number of the
  10898. * last MPDU being flushed.
  10899. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10900. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10901. * are to be released for further rx processing.
  10902. * Not all MPDUs within this range are necessarily valid - the host
  10903. * must check each sequence number within this range to see if the
  10904. * corresponding MPDU is actually present.
  10905. */
  10906. /* first DWORD */
  10907. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10908. #define HTT_RX_FLUSH_PEER_ID_S 8
  10909. #define HTT_RX_FLUSH_TID_M 0xff000000
  10910. #define HTT_RX_FLUSH_TID_S 24
  10911. /* second DWORD */
  10912. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10913. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10914. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10915. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10916. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10917. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10918. #define HTT_RX_FLUSH_BYTES 8
  10919. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10920. do { \
  10921. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10922. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10923. } while (0)
  10924. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10925. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10926. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10927. do { \
  10928. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10929. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10930. } while (0)
  10931. #define HTT_RX_FLUSH_TID_GET(word) \
  10932. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10933. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10934. do { \
  10935. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10936. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10937. } while (0)
  10938. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10939. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10940. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10941. do { \
  10942. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10943. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10944. } while (0)
  10945. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10946. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10947. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10948. do { \
  10949. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10950. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10951. } while (0)
  10952. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10953. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10954. /*
  10955. * @brief target -> host rx pn check indication message
  10956. *
  10957. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10958. *
  10959. * @details
  10960. * The following field definitions describe the format of the Rx PN check
  10961. * indication message sent from the target to the host.
  10962. * The message consists of a 4-octet header, followed by the start and
  10963. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10964. * IE is one octet containing the sequence number that failed the PN
  10965. * check.
  10966. *
  10967. * |31 24|23 8|7 0|
  10968. * |--------------------------------------------------------------|
  10969. * | TID | peer ID | msg type |
  10970. * |--------------------------------------------------------------|
  10971. * | Reserved | PN IE count | seq num end | seq num start|
  10972. * |--------------------------------------------------------------|
  10973. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10974. * |--------------------------------------------------------------|
  10975. * First DWORD:
  10976. * - MSG_TYPE
  10977. * Bits 7:0
  10978. * Purpose: Identifies this as an rx pn check indication message
  10979. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10980. * - PEER_ID
  10981. * Bits 23:8 (only bits 18:8 actually used)
  10982. * Purpose: identify which peer
  10983. * Value: (rx) peer ID
  10984. * - TID
  10985. * Bits 31:24 (only bits 27:24 actually used)
  10986. * Purpose: identify traffic identifier
  10987. * Value: traffic identifier
  10988. * Second DWORD:
  10989. * - SEQ_NUM_START
  10990. * Bits 7:0
  10991. * Purpose:
  10992. * Indicates the starting sequence number of the MPDU in this
  10993. * series of MPDUs that went though PN check.
  10994. * Value:
  10995. * The sequence number for the first MPDU in the sequence.
  10996. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10997. * - SEQ_NUM_END
  10998. * Bits 15:8
  10999. * Purpose:
  11000. * Indicates the ending sequence number of the MPDU in this
  11001. * series of MPDUs that went though PN check.
  11002. * Value:
  11003. * The sequence number one larger then the sequence number of the last
  11004. * MPDU being flushed.
  11005. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11006. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11007. * for invalid PN numbers and are ready to be released for further processing.
  11008. * Not all MPDUs within this range are necessarily valid - the host
  11009. * must check each sequence number within this range to see if the
  11010. * corresponding MPDU is actually present.
  11011. * - PN_IE_COUNT
  11012. * Bits 23:16
  11013. * Purpose:
  11014. * Used to determine the variable number of PN information elements in this
  11015. * message
  11016. *
  11017. * PN information elements:
  11018. * - PN_IE_x-
  11019. * Purpose:
  11020. * Each PN information element contains the sequence number of the MPDU that
  11021. * has failed the target PN check.
  11022. * Value:
  11023. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11024. * that failed the PN check.
  11025. */
  11026. /* first DWORD */
  11027. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11028. #define HTT_RX_PN_IND_PEER_ID_S 8
  11029. #define HTT_RX_PN_IND_TID_M 0xff000000
  11030. #define HTT_RX_PN_IND_TID_S 24
  11031. /* second DWORD */
  11032. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11033. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11034. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11035. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11036. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11037. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11038. #define HTT_RX_PN_IND_BYTES 8
  11039. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11042. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11043. } while (0)
  11044. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11045. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11046. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11049. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11050. } while (0)
  11051. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11052. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11053. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11054. do { \
  11055. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11056. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11057. } while (0)
  11058. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11059. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11060. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11061. do { \
  11062. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11063. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11064. } while (0)
  11065. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11066. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11067. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11068. do { \
  11069. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11070. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11071. } while (0)
  11072. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11073. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11074. /*
  11075. * @brief target -> host rx offload deliver message for LL system
  11076. *
  11077. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11078. *
  11079. * @details
  11080. * In a low latency system this message is sent whenever the offload
  11081. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11082. * The DMA of the actual packets into host memory is done before sending out
  11083. * this message. This message indicates only how many MSDUs to reap. The
  11084. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11085. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11086. * DMA'd by the MAC directly into host memory these packets do not contain
  11087. * the MAC descriptors in the header portion of the packet. Instead they contain
  11088. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11089. * message, the packets are delivered directly to the NW stack without going
  11090. * through the regular reorder buffering and PN checking path since it has
  11091. * already been done in target.
  11092. *
  11093. * |31 24|23 16|15 8|7 0|
  11094. * |-----------------------------------------------------------------------|
  11095. * | Total MSDU count | reserved | msg type |
  11096. * |-----------------------------------------------------------------------|
  11097. *
  11098. * @brief target -> host rx offload deliver message for HL system
  11099. *
  11100. * @details
  11101. * In a high latency system this message is sent whenever the offload manager
  11102. * flushes out the packets it has coalesced in its coalescing buffer. The
  11103. * actual packets are also carried along with this message. When the host
  11104. * receives this message, it is expected to deliver these packets to the NW
  11105. * stack directly instead of routing them through the reorder buffering and
  11106. * PN checking path since it has already been done in target.
  11107. *
  11108. * |31 24|23 16|15 8|7 0|
  11109. * |-----------------------------------------------------------------------|
  11110. * | Total MSDU count | reserved | msg type |
  11111. * |-----------------------------------------------------------------------|
  11112. * | peer ID | MSDU length |
  11113. * |-----------------------------------------------------------------------|
  11114. * | MSDU payload | FW Desc | tid | vdev ID |
  11115. * |-----------------------------------------------------------------------|
  11116. * | MSDU payload contd. |
  11117. * |-----------------------------------------------------------------------|
  11118. * | peer ID | MSDU length |
  11119. * |-----------------------------------------------------------------------|
  11120. * | MSDU payload | FW Desc | tid | vdev ID |
  11121. * |-----------------------------------------------------------------------|
  11122. * | MSDU payload contd. |
  11123. * |-----------------------------------------------------------------------|
  11124. *
  11125. */
  11126. /* first DWORD */
  11127. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11130. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11131. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11132. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11137. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11138. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11139. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11140. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11141. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11142. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11143. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11144. do { \
  11145. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11146. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11147. } while (0)
  11148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11149. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11150. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11151. do { \
  11152. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11153. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11154. } while (0)
  11155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11156. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11157. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11158. do { \
  11159. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11160. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11161. } while (0)
  11162. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11163. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11164. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11165. do { \
  11166. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11167. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11168. } while (0)
  11169. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11170. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11171. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11172. do { \
  11173. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11174. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11175. } while (0)
  11176. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11177. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11178. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11179. do { \
  11180. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11181. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11182. } while (0)
  11183. /**
  11184. * @brief target -> host rx peer map/unmap message definition
  11185. *
  11186. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11187. *
  11188. * @details
  11189. * The following diagram shows the format of the rx peer map message sent
  11190. * from the target to the host. This layout assumes the target operates
  11191. * as little-endian.
  11192. *
  11193. * This message always contains a SW peer ID. The main purpose of the
  11194. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11195. * with, so that the host can use that peer ID to determine which peer
  11196. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11197. * other purposes, such as identifying during tx completions which peer
  11198. * the tx frames in question were transmitted to.
  11199. *
  11200. * In certain generations of chips, the peer map message also contains
  11201. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11202. * to identify which peer the frame needs to be forwarded to (i.e. the
  11203. * peer associated with the Destination MAC Address within the packet),
  11204. * and particularly which vdev needs to transmit the frame (for cases
  11205. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11206. * meaning as AST_INDEX_0.
  11207. * This DA-based peer ID that is provided for certain rx frames
  11208. * (the rx frames that need to be re-transmitted as tx frames)
  11209. * is the ID that the HW uses for referring to the peer in question,
  11210. * rather than the peer ID that the SW+FW use to refer to the peer.
  11211. *
  11212. *
  11213. * |31 24|23 16|15 8|7 0|
  11214. * |-----------------------------------------------------------------------|
  11215. * | SW peer ID | VDEV ID | msg type |
  11216. * |-----------------------------------------------------------------------|
  11217. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11218. * |-----------------------------------------------------------------------|
  11219. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11220. * |-----------------------------------------------------------------------|
  11221. *
  11222. *
  11223. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11224. *
  11225. * The following diagram shows the format of the rx peer unmap message sent
  11226. * from the target to the host.
  11227. *
  11228. * |31 24|23 16|15 8|7 0|
  11229. * |-----------------------------------------------------------------------|
  11230. * | SW peer ID | VDEV ID | msg type |
  11231. * |-----------------------------------------------------------------------|
  11232. *
  11233. * The following field definitions describe the format of the rx peer map
  11234. * and peer unmap messages sent from the target to the host.
  11235. * - MSG_TYPE
  11236. * Bits 7:0
  11237. * Purpose: identifies this as an rx peer map or peer unmap message
  11238. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11239. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11240. * - VDEV_ID
  11241. * Bits 15:8
  11242. * Purpose: Indicates which virtual device the peer is associated
  11243. * with.
  11244. * Value: vdev ID (used in the host to look up the vdev object)
  11245. * - PEER_ID (a.k.a. SW_PEER_ID)
  11246. * Bits 31:16
  11247. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11248. * freeing (unmap)
  11249. * Value: (rx) peer ID
  11250. * - MAC_ADDR_L32 (peer map only)
  11251. * Bits 31:0
  11252. * Purpose: Identifies which peer node the peer ID is for.
  11253. * Value: lower 4 bytes of peer node's MAC address
  11254. * - MAC_ADDR_U16 (peer map only)
  11255. * Bits 15:0
  11256. * Purpose: Identifies which peer node the peer ID is for.
  11257. * Value: upper 2 bytes of peer node's MAC address
  11258. * - HW_PEER_ID
  11259. * Bits 31:16
  11260. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11261. * address, so for rx frames marked for rx --> tx forwarding, the
  11262. * host can determine from the HW peer ID provided as meta-data with
  11263. * the rx frame which peer the frame is supposed to be forwarded to.
  11264. * Value: ID used by the MAC HW to identify the peer
  11265. */
  11266. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11267. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11268. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11269. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11270. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11271. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11272. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11273. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11274. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11275. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11276. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11277. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11278. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11279. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11280. do { \
  11281. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11282. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11283. } while (0)
  11284. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11285. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11286. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11287. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11288. do { \
  11289. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11290. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11291. } while (0)
  11292. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11293. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11294. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11295. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11296. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11297. do { \
  11298. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11299. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11300. } while (0)
  11301. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11302. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11303. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11304. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11305. #define HTT_RX_PEER_MAP_BYTES 12
  11306. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11307. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11308. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11309. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11310. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11311. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11312. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11313. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11314. #define HTT_RX_PEER_UNMAP_BYTES 4
  11315. /**
  11316. * @brief target -> host rx peer map V2 message definition
  11317. *
  11318. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11319. *
  11320. * @details
  11321. * The following diagram shows the format of the rx peer map v2 message sent
  11322. * from the target to the host. This layout assumes the target operates
  11323. * as little-endian.
  11324. *
  11325. * This message always contains a SW peer ID. The main purpose of the
  11326. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11327. * with, so that the host can use that peer ID to determine which peer
  11328. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11329. * other purposes, such as identifying during tx completions which peer
  11330. * the tx frames in question were transmitted to.
  11331. *
  11332. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11333. * is used during rx --> tx frame forwarding to identify which peer the
  11334. * frame needs to be forwarded to (i.e. the peer associated with the
  11335. * Destination MAC Address within the packet), and particularly which vdev
  11336. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11337. * This DA-based peer ID that is provided for certain rx frames
  11338. * (the rx frames that need to be re-transmitted as tx frames)
  11339. * is the ID that the HW uses for referring to the peer in question,
  11340. * rather than the peer ID that the SW+FW use to refer to the peer.
  11341. *
  11342. * The HW peer id here is the same meaning as AST_INDEX_0.
  11343. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11344. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11345. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11346. * AST is valid.
  11347. *
  11348. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11349. * |-------------------------------------------------------------------------|
  11350. * | SW peer ID | VDEV ID | msg type |
  11351. * |-------------------------------------------------------------------------|
  11352. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11353. * |-------------------------------------------------------------------------|
  11354. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11355. * |-------------------------------------------------------------------------|
  11356. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11357. * |-------------------------------------------------------------------------|
  11358. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11359. * |-------------------------------------------------------------------------|
  11360. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11361. * |-------------------------------------------------------------------------|
  11362. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11363. * |-------------------------------------------------------------------------|
  11364. * | Reserved_2 |
  11365. * |-------------------------------------------------------------------------|
  11366. * Where:
  11367. * NH = Next Hop
  11368. * ASTVM = AST valid mask
  11369. * OA = on-chip AST valid bit
  11370. * ASTFM = AST flow mask
  11371. *
  11372. * The following field definitions describe the format of the rx peer map v2
  11373. * messages sent from the target to the host.
  11374. * - MSG_TYPE
  11375. * Bits 7:0
  11376. * Purpose: identifies this as an rx peer map v2 message
  11377. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11378. * - VDEV_ID
  11379. * Bits 15:8
  11380. * Purpose: Indicates which virtual device the peer is associated with.
  11381. * Value: vdev ID (used in the host to look up the vdev object)
  11382. * - SW_PEER_ID
  11383. * Bits 31:16
  11384. * Purpose: The peer ID (index) that WAL is allocating
  11385. * Value: (rx) peer ID
  11386. * - MAC_ADDR_L32
  11387. * Bits 31:0
  11388. * Purpose: Identifies which peer node the peer ID is for.
  11389. * Value: lower 4 bytes of peer node's MAC address
  11390. * - MAC_ADDR_U16
  11391. * Bits 15:0
  11392. * Purpose: Identifies which peer node the peer ID is for.
  11393. * Value: upper 2 bytes of peer node's MAC address
  11394. * - HW_PEER_ID / AST_INDEX_0
  11395. * Bits 31:16
  11396. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11397. * address, so for rx frames marked for rx --> tx forwarding, the
  11398. * host can determine from the HW peer ID provided as meta-data with
  11399. * the rx frame which peer the frame is supposed to be forwarded to.
  11400. * Value: ID used by the MAC HW to identify the peer
  11401. * - AST_HASH_VALUE
  11402. * Bits 15:0
  11403. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11404. * override feature.
  11405. * - NEXT_HOP
  11406. * Bit 16
  11407. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11408. * (Wireless Distribution System).
  11409. * - AST_VALID_MASK
  11410. * Bits 19:17
  11411. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11412. * - ONCHIP_AST_VALID_FLAG
  11413. * Bit 20
  11414. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11415. * is valid.
  11416. * - AST_INDEX_1
  11417. * Bits 15:0
  11418. * Purpose: indicate the second AST index for this peer
  11419. * - AST_0_FLOW_MASK
  11420. * Bits 19:16
  11421. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11422. * - AST_1_FLOW_MASK
  11423. * Bits 23:20
  11424. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11425. * - AST_2_FLOW_MASK
  11426. * Bits 27:24
  11427. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11428. * - AST_3_FLOW_MASK
  11429. * Bits 31:28
  11430. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11431. * - AST_INDEX_2
  11432. * Bits 15:0
  11433. * Purpose: indicate the third AST index for this peer
  11434. * - TID_VALID_HI_PRI
  11435. * Bits 23:16
  11436. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11437. * - TID_VALID_LOW_PRI
  11438. * Bits 31:24
  11439. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11440. * - AST_INDEX_3
  11441. * Bits 15:0
  11442. * Purpose: indicate the fourth AST index for this peer
  11443. * - ONCHIP_AST_IDX / RESERVED
  11444. * Bits 31:16
  11445. * Purpose: This field is valid only when split AST feature is enabled.
  11446. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11447. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11448. * address, this ast_idx is used for LMAC modules for RXPCU.
  11449. * Value: ID used by the LMAC HW to identify the peer
  11450. */
  11451. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11452. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11453. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11454. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11455. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11456. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11457. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11458. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11459. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11460. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11461. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11462. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11463. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11464. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11465. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11466. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11467. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11468. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11469. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11470. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11471. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11472. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11473. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11474. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11475. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11476. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11477. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11478. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11479. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11480. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11481. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11482. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11483. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11484. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11485. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11486. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11487. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11488. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11489. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11490. do { \
  11491. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11492. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11493. } while (0)
  11494. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11495. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11496. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11497. do { \
  11498. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11499. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11500. } while (0)
  11501. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11502. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11503. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11504. do { \
  11505. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11506. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11507. } while (0)
  11508. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11509. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11510. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11511. do { \
  11512. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11513. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11514. } while (0)
  11515. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11516. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11517. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11518. do { \
  11519. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11520. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11521. } while (0)
  11522. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11523. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11524. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11525. do { \
  11526. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11527. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11528. } while (0)
  11529. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11530. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11531. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11532. do { \
  11533. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11534. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11535. } while (0)
  11536. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11537. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11538. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11539. do { \
  11540. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11541. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11542. } while (0)
  11543. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11544. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11545. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11546. do { \
  11547. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11548. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11549. } while (0)
  11550. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11551. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11552. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11553. do { \
  11554. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11555. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11556. } while (0)
  11557. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11558. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11559. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11560. do { \
  11561. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11562. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11563. } while (0)
  11564. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11565. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11566. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11567. do { \
  11568. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11569. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11570. } while (0)
  11571. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11572. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11573. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11574. do { \
  11575. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11576. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11577. } while (0)
  11578. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11579. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11580. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11581. do { \
  11582. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11583. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11584. } while (0)
  11585. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11586. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11587. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11588. do { \
  11589. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11590. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11591. } while (0)
  11592. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11593. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11594. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11595. do { \
  11596. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11597. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11598. } while (0)
  11599. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11600. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11601. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11602. do { \
  11603. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11604. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11605. } while (0)
  11606. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11607. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11608. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11609. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11610. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11611. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11612. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11613. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11614. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11615. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11616. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11617. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11618. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11619. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11620. /**
  11621. * @brief target -> host rx peer map V3 message definition
  11622. *
  11623. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11624. *
  11625. * @details
  11626. * The following diagram shows the format of the rx peer map v3 message sent
  11627. * from the target to the host.
  11628. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11629. * This layout assumes the target operates as little-endian.
  11630. *
  11631. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11632. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11633. * | SW peer ID | VDEV ID | msg type |
  11634. * |-----------------+--------------------+-----------------+-----------------|
  11635. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11636. * |-----------------+--------------------+-----------------+-----------------|
  11637. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11638. * |-----------------+--------+-----------+-----------------+-----------------|
  11639. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11640. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11641. * | (8bits) | | (4bits) | |
  11642. * |-----------------+--------+--+--+--+--------------------------------------|
  11643. * | RESERVED |E |O | | |
  11644. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11645. * | |V |V | | |
  11646. * |-----------------+--------------------+-----------------------------------|
  11647. * | HTT_MSDU_IDX_ | RESERVED | |
  11648. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11649. * | (8bits) | | |
  11650. * |-----------------+--------------------+-----------------------------------|
  11651. * | Reserved_2 |
  11652. * |--------------------------------------------------------------------------|
  11653. * | Reserved_3 |
  11654. * |--------------------------------------------------------------------------|
  11655. *
  11656. * Where:
  11657. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11658. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11659. * NH = Next Hop
  11660. * The following field definitions describe the format of the rx peer map v3
  11661. * messages sent from the target to the host.
  11662. * - MSG_TYPE
  11663. * Bits 7:0
  11664. * Purpose: identifies this as a peer map v3 message
  11665. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11666. * - VDEV_ID
  11667. * Bits 15:8
  11668. * Purpose: Indicates which virtual device the peer is associated with.
  11669. * - SW_PEER_ID
  11670. * Bits 31:16
  11671. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11672. * - MAC_ADDR_L32
  11673. * Bits 31:0
  11674. * Purpose: Identifies which peer node the peer ID is for.
  11675. * Value: lower 4 bytes of peer node's MAC address
  11676. * - MAC_ADDR_U16
  11677. * Bits 15:0
  11678. * Purpose: Identifies which peer node the peer ID is for.
  11679. * Value: upper 2 bytes of peer node's MAC address
  11680. * - MULTICAST_SW_PEER_ID
  11681. * Bits 31:16
  11682. * Purpose: The multicast peer ID (index)
  11683. * Value: set to HTT_INVALID_PEER if not valid
  11684. * - HW_PEER_ID / AST_INDEX
  11685. * Bits 15:0
  11686. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11687. * address, so for rx frames marked for rx --> tx forwarding, the
  11688. * host can determine from the HW peer ID provided as meta-data with
  11689. * the rx frame which peer the frame is supposed to be forwarded to.
  11690. * - CACHE_SET_NUM
  11691. * Bits 19:16
  11692. * Purpose: Cache Set Number for AST_INDEX
  11693. * Cache set number that should be used to cache the index based
  11694. * search results, for address and flow search.
  11695. * This value should be equal to LSB 4 bits of the hash value
  11696. * of match data, in case of search index points to an entry which
  11697. * may be used in content based search also. The value can be
  11698. * anything when the entry pointed by search index will not be
  11699. * used for content based search.
  11700. * - HTT_MSDU_IDX_VALID_MASK
  11701. * Bits 31:24
  11702. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11703. * - ONCHIP_AST_IDX / RESERVED
  11704. * Bits 15:0
  11705. * Purpose: This field is valid only when split AST feature is enabled.
  11706. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11707. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11708. * address, this ast_idx is used for LMAC modules for RXPCU.
  11709. * - NEXT_HOP
  11710. * Bits 16
  11711. * Purpose: Flag indicates next_hop AST entry used for WDS
  11712. * (Wireless Distribution System).
  11713. * - ONCHIP_AST_VALID
  11714. * Bits 17
  11715. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11716. * - EXT_AST_VALID
  11717. * Bits 18
  11718. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11719. * - EXT_AST_INDEX
  11720. * Bits 15:0
  11721. * Purpose: This field describes Extended AST index
  11722. * Valid if EXT_AST_VALID flag set
  11723. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11724. * Bits 31:24
  11725. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11726. */
  11727. /* dword 0 */
  11728. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11729. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11730. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11731. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11732. /* dword 1 */
  11733. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11734. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11735. /* dword 2 */
  11736. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11737. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11738. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11739. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11740. /* dword 3 */
  11741. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11742. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11743. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11744. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11745. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11746. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11747. /* dword 4 */
  11748. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11749. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11750. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11751. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11752. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11753. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11754. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11755. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11756. /* dword 5 */
  11757. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11758. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11759. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11760. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11761. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11762. do { \
  11763. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11764. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11765. } while (0)
  11766. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11767. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11768. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11769. do { \
  11770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11771. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11772. } while (0)
  11773. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11774. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11775. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11776. do { \
  11777. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11778. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11779. } while (0)
  11780. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11781. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11782. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11783. do { \
  11784. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11785. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11786. } while (0)
  11787. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11788. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11789. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11790. do { \
  11791. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11792. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11793. } while (0)
  11794. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11795. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11796. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11797. do { \
  11798. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11799. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11800. } while (0)
  11801. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11802. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11803. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11806. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11807. } while (0)
  11808. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11809. (((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)
  11810. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11811. do { \
  11812. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11813. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11814. } while (0)
  11815. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11816. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11817. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11818. do { \
  11819. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11820. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11821. } while (0)
  11822. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11823. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11824. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11827. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11828. } while (0)
  11829. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11830. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11831. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11834. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11835. } while (0)
  11836. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11837. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11838. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11841. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11842. } while (0)
  11843. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11844. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11845. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11846. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11847. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11848. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11849. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11850. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11851. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11852. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11853. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11854. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11855. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11856. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11857. /**
  11858. * @brief target -> host rx peer unmap V2 message definition
  11859. *
  11860. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11861. *
  11862. * The following diagram shows the format of the rx peer unmap message sent
  11863. * from the target to the host.
  11864. *
  11865. * |31 24|23 16|15 8|7 0|
  11866. * |-----------------------------------------------------------------------|
  11867. * | SW peer ID | VDEV ID | msg type |
  11868. * |-----------------------------------------------------------------------|
  11869. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11870. * |-----------------------------------------------------------------------|
  11871. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11872. * |-----------------------------------------------------------------------|
  11873. * | Peer Delete Duration |
  11874. * |-----------------------------------------------------------------------|
  11875. * | Reserved_0 | WDS Free Count |
  11876. * |-----------------------------------------------------------------------|
  11877. * | Reserved_1 |
  11878. * |-----------------------------------------------------------------------|
  11879. * | Reserved_2 |
  11880. * |-----------------------------------------------------------------------|
  11881. *
  11882. *
  11883. * The following field definitions describe the format of the rx peer unmap
  11884. * messages sent from the target to the host.
  11885. * - MSG_TYPE
  11886. * Bits 7:0
  11887. * Purpose: identifies this as an rx peer unmap v2 message
  11888. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11889. * - VDEV_ID
  11890. * Bits 15:8
  11891. * Purpose: Indicates which virtual device the peer is associated
  11892. * with.
  11893. * Value: vdev ID (used in the host to look up the vdev object)
  11894. * - SW_PEER_ID
  11895. * Bits 31:16
  11896. * Purpose: The peer ID (index) that WAL is freeing
  11897. * Value: (rx) peer ID
  11898. * - MAC_ADDR_L32
  11899. * Bits 31:0
  11900. * Purpose: Identifies which peer node the peer ID is for.
  11901. * Value: lower 4 bytes of peer node's MAC address
  11902. * - MAC_ADDR_U16
  11903. * Bits 15:0
  11904. * Purpose: Identifies which peer node the peer ID is for.
  11905. * Value: upper 2 bytes of peer node's MAC address
  11906. * - NEXT_HOP
  11907. * Bits 16
  11908. * Purpose: Bit indicates next_hop AST entry used for WDS
  11909. * (Wireless Distribution System).
  11910. * - PEER_DELETE_DURATION
  11911. * Bits 31:0
  11912. * Purpose: Time taken to delete peer, in msec,
  11913. * Used for monitoring / debugging PEER delete response delay
  11914. * - PEER_WDS_FREE_COUNT
  11915. * Bits 15:0
  11916. * Purpose: Count of WDS entries deleted associated to peer deleted
  11917. */
  11918. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11919. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11920. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11921. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11922. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11923. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11924. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11925. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11926. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11927. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11928. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11929. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11930. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11931. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11932. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11933. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11934. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11935. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11936. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11937. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11938. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11939. do { \
  11940. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11941. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11942. } while (0)
  11943. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11944. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11945. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11946. do { \
  11947. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11948. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11949. } while (0)
  11950. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11951. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11952. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11953. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11954. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11955. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11956. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11957. /**
  11958. * @brief target -> host rx peer mlo map message definition
  11959. *
  11960. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11961. *
  11962. * @details
  11963. * The following diagram shows the format of the rx mlo peer map message sent
  11964. * from the target to the host. This layout assumes the target operates
  11965. * as little-endian.
  11966. *
  11967. * MCC:
  11968. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11969. *
  11970. * WIN:
  11971. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11972. * It will be sent on the Assoc Link.
  11973. *
  11974. * This message always contains a MLO peer ID. The main purpose of the
  11975. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11976. * with, so that the host can use that MLO peer ID to determine which peer
  11977. * transmitted the rx frame.
  11978. *
  11979. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11980. * |-------------------------------------------------------------------------|
  11981. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11982. * |-------------------------------------------------------------------------|
  11983. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11984. * |-------------------------------------------------------------------------|
  11985. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11986. * |-------------------------------------------------------------------------|
  11987. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11988. * |-------------------------------------------------------------------------|
  11989. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11990. * |-------------------------------------------------------------------------|
  11991. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11992. * |-------------------------------------------------------------------------|
  11993. * |RSVD |
  11994. * |-------------------------------------------------------------------------|
  11995. * |RSVD |
  11996. * |-------------------------------------------------------------------------|
  11997. * | htt_tlv_hdr_t |
  11998. * |-------------------------------------------------------------------------|
  11999. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12000. * |-------------------------------------------------------------------------|
  12001. * | htt_tlv_hdr_t |
  12002. * |-------------------------------------------------------------------------|
  12003. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12004. * |-------------------------------------------------------------------------|
  12005. * | htt_tlv_hdr_t |
  12006. * |-------------------------------------------------------------------------|
  12007. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12008. * |-------------------------------------------------------------------------|
  12009. *
  12010. * Where:
  12011. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12012. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12013. * V (valid) - 1 Bit Bit17
  12014. * CHIPID - 3 Bits
  12015. * TIDMASK - 8 Bits
  12016. * CACHE_SET_NUM - 8 Bits
  12017. *
  12018. * The following field definitions describe the format of the rx MLO peer map
  12019. * messages sent from the target to the host.
  12020. * - MSG_TYPE
  12021. * Bits 7:0
  12022. * Purpose: identifies this as an rx mlo peer map message
  12023. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12024. *
  12025. * - MLO_PEER_ID
  12026. * Bits 23:8
  12027. * Purpose: The MLO peer ID (index).
  12028. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12029. * Value: MLO peer ID
  12030. *
  12031. * - NUMLINK
  12032. * Bits: 26:24 (3Bits)
  12033. * Purpose: Indicate the max number of logical links supported per client.
  12034. * Value: number of logical links
  12035. *
  12036. * - PRC
  12037. * Bits: 29:27 (3Bits)
  12038. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12039. * if there is migration of the primary chip.
  12040. * Value: Primary REO CHIPID
  12041. *
  12042. * - MAC_ADDR_L32
  12043. * Bits 31:0
  12044. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12045. * Value: lower 4 bytes of peer node's MAC address
  12046. *
  12047. * - MAC_ADDR_U16
  12048. * Bits 15:0
  12049. * Purpose: Identifies which peer node the peer ID is for.
  12050. * Value: upper 2 bytes of peer node's MAC address
  12051. *
  12052. * - PRIMARY_TCL_AST_IDX
  12053. * Bits 15:0
  12054. * Purpose: Primary TCL AST index for this peer.
  12055. *
  12056. * - V
  12057. * 1 Bit Position 16
  12058. * Purpose: If the ast idx is valid.
  12059. *
  12060. * - CHIPID
  12061. * Bits 19:17
  12062. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12063. *
  12064. * - TIDMASK
  12065. * Bits 27:20
  12066. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12067. *
  12068. * - CACHE_SET_NUM
  12069. * Bits 31:28
  12070. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12071. * Cache set number that should be used to cache the index based
  12072. * search results, for address and flow search.
  12073. * This value should be equal to LSB four bits of the hash value
  12074. * of match data, in case of search index points to an entry which
  12075. * may be used in content based search also. The value can be
  12076. * anything when the entry pointed by search index will not be
  12077. * used for content based search.
  12078. *
  12079. * - htt_tlv_hdr_t
  12080. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12081. *
  12082. * Bits 11:0
  12083. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12084. *
  12085. * Bits 23:12
  12086. * Purpose: Length, Length of the value that follows the header
  12087. *
  12088. * Bits 31:28
  12089. * Purpose: Reserved.
  12090. *
  12091. *
  12092. * - SW_PEER_ID
  12093. * Bits 15:0
  12094. * Purpose: The peer ID (index) that WAL is allocating
  12095. * Value: (rx) peer ID
  12096. *
  12097. * - VDEV_ID
  12098. * Bits 23:16
  12099. * Purpose: Indicates which virtual device the peer is associated with.
  12100. * Value: vdev ID (used in the host to look up the vdev object)
  12101. *
  12102. * - CHIPID
  12103. * Bits 26:24
  12104. * Purpose: Indicates which Chip id the peer is associated with.
  12105. * Value: chip ID (Provided by Host as part of QMI exchange)
  12106. */
  12107. typedef enum {
  12108. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12109. } MLO_PEER_MAP_TLV_TAG_ID;
  12110. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12111. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12112. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12113. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12114. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12115. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12116. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12117. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12118. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12119. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12120. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12121. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12122. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12123. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12124. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12125. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12126. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12127. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12128. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12129. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12130. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12131. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12132. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12133. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12134. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12135. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12136. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12137. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12138. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12139. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12140. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12141. do { \
  12142. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12143. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12144. } while (0)
  12145. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12146. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12147. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12148. do { \
  12149. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12150. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12151. } while (0)
  12152. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12153. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12154. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12155. do { \
  12156. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12157. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12158. } while (0)
  12159. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12160. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12161. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12162. do { \
  12163. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12164. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12165. } while (0)
  12166. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12167. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12168. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12169. do { \
  12170. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12171. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12172. } while (0)
  12173. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12174. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12175. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12176. do { \
  12177. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12178. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12179. } while (0)
  12180. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12181. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12182. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12183. do { \
  12184. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12185. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12186. } while (0)
  12187. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12188. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12189. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12190. do { \
  12191. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12192. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12193. } while (0)
  12194. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12195. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12196. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12197. do { \
  12198. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12199. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12200. } while (0)
  12201. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12202. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12203. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12204. do { \
  12205. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12206. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12207. } while (0)
  12208. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12209. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12210. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12211. do { \
  12212. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12213. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12214. } while (0)
  12215. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12216. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12217. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12218. do { \
  12219. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12220. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12221. } while (0)
  12222. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12223. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12224. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12225. do { \
  12226. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12227. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12228. } while (0)
  12229. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12230. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12231. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12232. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12233. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12234. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12235. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12236. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12237. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12238. *
  12239. * The following diagram shows the format of the rx mlo peer unmap message sent
  12240. * from the target to the host.
  12241. *
  12242. * |31 24|23 16|15 8|7 0|
  12243. * |-----------------------------------------------------------------------|
  12244. * | RSVD_24_31 | MLO peer ID | msg type |
  12245. * |-----------------------------------------------------------------------|
  12246. */
  12247. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12248. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12249. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12250. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12251. /**
  12252. * @brief target -> host message specifying security parameters
  12253. *
  12254. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12255. *
  12256. * @details
  12257. * The following diagram shows the format of the security specification
  12258. * message sent from the target to the host.
  12259. * This security specification message tells the host whether a PN check is
  12260. * necessary on rx data frames, and if so, how large the PN counter is.
  12261. * This message also tells the host about the security processing to apply
  12262. * to defragmented rx frames - specifically, whether a Message Integrity
  12263. * Check is required, and the Michael key to use.
  12264. *
  12265. * |31 24|23 16|15|14 8|7 0|
  12266. * |-----------------------------------------------------------------------|
  12267. * | peer ID | U| security type | msg type |
  12268. * |-----------------------------------------------------------------------|
  12269. * | Michael Key K0 |
  12270. * |-----------------------------------------------------------------------|
  12271. * | Michael Key K1 |
  12272. * |-----------------------------------------------------------------------|
  12273. * | WAPI RSC Low0 |
  12274. * |-----------------------------------------------------------------------|
  12275. * | WAPI RSC Low1 |
  12276. * |-----------------------------------------------------------------------|
  12277. * | WAPI RSC Hi0 |
  12278. * |-----------------------------------------------------------------------|
  12279. * | WAPI RSC Hi1 |
  12280. * |-----------------------------------------------------------------------|
  12281. *
  12282. * The following field definitions describe the format of the security
  12283. * indication message sent from the target to the host.
  12284. * - MSG_TYPE
  12285. * Bits 7:0
  12286. * Purpose: identifies this as a security specification message
  12287. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12288. * - SEC_TYPE
  12289. * Bits 14:8
  12290. * Purpose: specifies which type of security applies to the peer
  12291. * Value: htt_sec_type enum value
  12292. * - UNICAST
  12293. * Bit 15
  12294. * Purpose: whether this security is applied to unicast or multicast data
  12295. * Value: 1 -> unicast, 0 -> multicast
  12296. * - PEER_ID
  12297. * Bits 31:16
  12298. * Purpose: The ID number for the peer the security specification is for
  12299. * Value: peer ID
  12300. * - MICHAEL_KEY_K0
  12301. * Bits 31:0
  12302. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12303. * Value: Michael Key K0 (if security type is TKIP)
  12304. * - MICHAEL_KEY_K1
  12305. * Bits 31:0
  12306. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12307. * Value: Michael Key K1 (if security type is TKIP)
  12308. * - WAPI_RSC_LOW0
  12309. * Bits 31:0
  12310. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12311. * Value: WAPI RSC Low0 (if security type is WAPI)
  12312. * - WAPI_RSC_LOW1
  12313. * Bits 31:0
  12314. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12315. * Value: WAPI RSC Low1 (if security type is WAPI)
  12316. * - WAPI_RSC_HI0
  12317. * Bits 31:0
  12318. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12319. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12320. * - WAPI_RSC_HI1
  12321. * Bits 31:0
  12322. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12323. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12324. */
  12325. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12326. #define HTT_SEC_IND_SEC_TYPE_S 8
  12327. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12328. #define HTT_SEC_IND_UNICAST_S 15
  12329. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12330. #define HTT_SEC_IND_PEER_ID_S 16
  12331. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12332. do { \
  12333. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12334. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12335. } while (0)
  12336. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12337. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12338. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12339. do { \
  12340. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12341. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12342. } while (0)
  12343. #define HTT_SEC_IND_UNICAST_GET(word) \
  12344. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12345. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12346. do { \
  12347. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12348. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12349. } while (0)
  12350. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12351. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12352. #define HTT_SEC_IND_BYTES 28
  12353. /**
  12354. * @brief target -> host rx ADDBA / DELBA message definitions
  12355. *
  12356. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12357. *
  12358. * @details
  12359. * The following diagram shows the format of the rx ADDBA message sent
  12360. * from the target to the host:
  12361. *
  12362. * |31 20|19 16|15 8|7 0|
  12363. * |---------------------------------------------------------------------|
  12364. * | peer ID | TID | window size | msg type |
  12365. * |---------------------------------------------------------------------|
  12366. *
  12367. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12368. *
  12369. * The following diagram shows the format of the rx DELBA message sent
  12370. * from the target to the host:
  12371. *
  12372. * |31 20|19 16|15 10|9 8|7 0|
  12373. * |---------------------------------------------------------------------|
  12374. * | peer ID | TID | window size | IR| msg type |
  12375. * |---------------------------------------------------------------------|
  12376. *
  12377. * The following field definitions describe the format of the rx ADDBA
  12378. * and DELBA messages sent from the target to the host.
  12379. * - MSG_TYPE
  12380. * Bits 7:0
  12381. * Purpose: identifies this as an rx ADDBA or DELBA message
  12382. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12383. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12384. * - IR (initiator / recipient)
  12385. * Bits 9:8 (DELBA only)
  12386. * Purpose: specify whether the DELBA handshake was initiated by the
  12387. * local STA/AP, or by the peer STA/AP
  12388. * Value:
  12389. * 0 - unspecified
  12390. * 1 - initiator (a.k.a. originator)
  12391. * 2 - recipient (a.k.a. responder)
  12392. * 3 - unused / reserved
  12393. * - WIN_SIZE
  12394. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12395. * Purpose: Specifies the length of the block ack window (max = 64).
  12396. * Value:
  12397. * block ack window length specified by the received ADDBA/DELBA
  12398. * management message.
  12399. * - TID
  12400. * Bits 19:16
  12401. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12402. * Value:
  12403. * TID specified by the received ADDBA or DELBA management message.
  12404. * - PEER_ID
  12405. * Bits 31:20
  12406. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12407. * Value:
  12408. * ID (hash value) used by the host for fast, direct lookup of
  12409. * host SW peer info, including rx reorder states.
  12410. */
  12411. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12412. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12413. #define HTT_RX_ADDBA_TID_M 0xf0000
  12414. #define HTT_RX_ADDBA_TID_S 16
  12415. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12416. #define HTT_RX_ADDBA_PEER_ID_S 20
  12417. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12418. do { \
  12419. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12420. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12421. } while (0)
  12422. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12423. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12424. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12425. do { \
  12426. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12427. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12428. } while (0)
  12429. #define HTT_RX_ADDBA_TID_GET(word) \
  12430. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12431. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12432. do { \
  12433. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12434. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12435. } while (0)
  12436. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12437. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12438. #define HTT_RX_ADDBA_BYTES 4
  12439. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12440. #define HTT_RX_DELBA_INITIATOR_S 8
  12441. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12442. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12443. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12444. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12445. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12446. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12447. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12448. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12449. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12450. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12451. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12452. do { \
  12453. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12454. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12455. } while (0)
  12456. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12457. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12458. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12459. do { \
  12460. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12461. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12462. } while (0)
  12463. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12464. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12465. #define HTT_RX_DELBA_BYTES 4
  12466. /**
  12467. * @brief target -> host rx ADDBA / DELBA message definitions
  12468. *
  12469. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12470. *
  12471. * @details
  12472. * The following diagram shows the format of the rx ADDBA extn message sent
  12473. * from the target to the host:
  12474. *
  12475. * |31 20|19 16|15 13|12 8|7 0|
  12476. * |---------------------------------------------------------------------|
  12477. * | peer ID | TID | reserved | msg type |
  12478. * |---------------------------------------------------------------------|
  12479. * | reserved | window size |
  12480. * |---------------------------------------------------------------------|
  12481. *
  12482. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12483. *
  12484. * The following diagram shows the format of the rx DELBA message sent
  12485. * from the target to the host:
  12486. *
  12487. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12488. * |---------------------------------------------------------------------|
  12489. * | peer ID | TID | reserved | IR| msg type |
  12490. * |---------------------------------------------------------------------|
  12491. * | reserved | window size |
  12492. * |---------------------------------------------------------------------|
  12493. *
  12494. * The following field definitions describe the format of the rx ADDBA
  12495. * and DELBA messages sent from the target to the host.
  12496. * - MSG_TYPE
  12497. * Bits 7:0
  12498. * Purpose: identifies this as an rx ADDBA or DELBA message
  12499. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12500. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12501. * - IR (initiator / recipient)
  12502. * Bits 9:8 (DELBA only)
  12503. * Purpose: specify whether the DELBA handshake was initiated by the
  12504. * local STA/AP, or by the peer STA/AP
  12505. * Value:
  12506. * 0 - unspecified
  12507. * 1 - initiator (a.k.a. originator)
  12508. * 2 - recipient (a.k.a. responder)
  12509. * 3 - unused / reserved
  12510. * Value:
  12511. * block ack window length specified by the received ADDBA/DELBA
  12512. * management message.
  12513. * - TID
  12514. * Bits 19:16
  12515. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12516. * Value:
  12517. * TID specified by the received ADDBA or DELBA management message.
  12518. * - PEER_ID
  12519. * Bits 31:20
  12520. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12521. * Value:
  12522. * ID (hash value) used by the host for fast, direct lookup of
  12523. * host SW peer info, including rx reorder states.
  12524. * == DWORD 1
  12525. * - WIN_SIZE
  12526. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12527. * Purpose: Specifies the length of the block ack window (max = 8191).
  12528. */
  12529. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12530. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12531. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12532. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12533. /*--- Dword 0 ---*/
  12534. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12535. do { \
  12536. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12537. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12538. } while (0)
  12539. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12540. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12541. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12542. do { \
  12543. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12544. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12545. } while (0)
  12546. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12547. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12548. /*--- Dword 1 ---*/
  12549. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12550. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12551. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12552. do { \
  12553. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12554. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12555. } while (0)
  12556. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12557. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12558. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12559. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12560. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12561. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12562. #define HTT_RX_DELBA_EXTN_TID_S 16
  12563. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12564. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12565. /*--- Dword 0 ---*/
  12566. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12567. do { \
  12568. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12569. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12570. } while (0)
  12571. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12572. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12573. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12574. do { \
  12575. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12576. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12577. } while (0)
  12578. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12579. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12580. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12581. do { \
  12582. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12583. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12584. } while (0)
  12585. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12586. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12587. /*--- Dword 1 ---*/
  12588. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12589. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12590. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12591. do { \
  12592. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12593. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12594. } while (0)
  12595. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12596. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12597. #define HTT_RX_DELBA_EXTN_BYTES 8
  12598. /**
  12599. * @brief tx queue group information element definition
  12600. *
  12601. * @details
  12602. * The following diagram shows the format of the tx queue group
  12603. * information element, which can be included in target --> host
  12604. * messages to specify the number of tx "credits" (tx descriptors
  12605. * for LL, or tx buffers for HL) available to a particular group
  12606. * of host-side tx queues, and which host-side tx queues belong to
  12607. * the group.
  12608. *
  12609. * |31|30 24|23 16|15|14|13 0|
  12610. * |------------------------------------------------------------------------|
  12611. * | X| reserved | tx queue grp ID | A| S| credit count |
  12612. * |------------------------------------------------------------------------|
  12613. * | vdev ID mask | AC mask |
  12614. * |------------------------------------------------------------------------|
  12615. *
  12616. * The following definitions describe the fields within the tx queue group
  12617. * information element:
  12618. * - credit_count
  12619. * Bits 13:1
  12620. * Purpose: specify how many tx credits are available to the tx queue group
  12621. * Value: An absolute or relative, positive or negative credit value
  12622. * The 'A' bit specifies whether the value is absolute or relative.
  12623. * The 'S' bit specifies whether the value is positive or negative.
  12624. * A negative value can only be relative, not absolute.
  12625. * An absolute value replaces any prior credit value the host has for
  12626. * the tx queue group in question.
  12627. * A relative value is added to the prior credit value the host has for
  12628. * the tx queue group in question.
  12629. * - sign
  12630. * Bit 14
  12631. * Purpose: specify whether the credit count is positive or negative
  12632. * Value: 0 -> positive, 1 -> negative
  12633. * - absolute
  12634. * Bit 15
  12635. * Purpose: specify whether the credit count is absolute or relative
  12636. * Value: 0 -> relative, 1 -> absolute
  12637. * - txq_group_id
  12638. * Bits 23:16
  12639. * Purpose: indicate which tx queue group's credit and/or membership are
  12640. * being specified
  12641. * Value: 0 to max_tx_queue_groups-1
  12642. * - reserved
  12643. * Bits 30:16
  12644. * Value: 0x0
  12645. * - eXtension
  12646. * Bit 31
  12647. * Purpose: specify whether another tx queue group info element follows
  12648. * Value: 0 -> no more tx queue group information elements
  12649. * 1 -> another tx queue group information element immediately follows
  12650. * - ac_mask
  12651. * Bits 15:0
  12652. * Purpose: specify which Access Categories belong to the tx queue group
  12653. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12654. * the tx queue group.
  12655. * The AC bit-mask values are obtained by left-shifting by the
  12656. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12657. * - vdev_id_mask
  12658. * Bits 31:16
  12659. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12660. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12661. * belong to the tx queue group.
  12662. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12663. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12664. */
  12665. PREPACK struct htt_txq_group {
  12666. A_UINT32
  12667. credit_count: 14,
  12668. sign: 1,
  12669. absolute: 1,
  12670. tx_queue_group_id: 8,
  12671. reserved0: 7,
  12672. extension: 1;
  12673. A_UINT32
  12674. ac_mask: 16,
  12675. vdev_id_mask: 16;
  12676. } POSTPACK;
  12677. /* first word */
  12678. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12679. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12680. #define HTT_TXQ_GROUP_SIGN_S 14
  12681. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12682. #define HTT_TXQ_GROUP_ABS_S 15
  12683. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12684. #define HTT_TXQ_GROUP_ID_S 16
  12685. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12686. #define HTT_TXQ_GROUP_EXT_S 31
  12687. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12688. /* second word */
  12689. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12690. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12691. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12692. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12693. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12694. do { \
  12695. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12696. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12697. } while (0)
  12698. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12699. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12700. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12701. do { \
  12702. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12703. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12704. } while (0)
  12705. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12706. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12707. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12708. do { \
  12709. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12710. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12711. } while (0)
  12712. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12713. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12714. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12715. do { \
  12716. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12717. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12718. } while (0)
  12719. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12720. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12721. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12722. do { \
  12723. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12724. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12725. } while (0)
  12726. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12727. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12728. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12729. do { \
  12730. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12731. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12732. } while (0)
  12733. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12734. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12735. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12736. do { \
  12737. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12738. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12739. } while (0)
  12740. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12741. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12742. /**
  12743. * @brief target -> host TX completion indication message definition
  12744. *
  12745. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12746. *
  12747. * @details
  12748. * The following diagram shows the format of the TX completion indication sent
  12749. * from the target to the host
  12750. *
  12751. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12752. * |-------------------------------------------------------------------|
  12753. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12754. * |-------------------------------------------------------------------|
  12755. * payload:| MSDU1 ID | MSDU0 ID |
  12756. * |-------------------------------------------------------------------|
  12757. * : MSDU3 ID | MSDU2 ID :
  12758. * |-------------------------------------------------------------------|
  12759. * | struct htt_tx_compl_ind_append_retries |
  12760. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12761. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12762. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12763. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12764. * |-------------------------------------------------------------------|
  12765. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12766. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12767. * | MSDU0 tx_tsf64_low |
  12768. * |-------------------------------------------------------------------|
  12769. * | MSDU0 tx_tsf64_high |
  12770. * |-------------------------------------------------------------------|
  12771. * | MSDU1 tx_tsf64_low |
  12772. * |-------------------------------------------------------------------|
  12773. * | MSDU1 tx_tsf64_high |
  12774. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12775. * | phy_timestamp |
  12776. * |-------------------------------------------------------------------|
  12777. * | rate specs (see below) |
  12778. * |-------------------------------------------------------------------|
  12779. * | seqctrl | framectrl |
  12780. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12781. * Where:
  12782. * A0 = append (a.k.a. append0)
  12783. * A1 = append1
  12784. * TP = MSDU tx power presence
  12785. * A2 = append2
  12786. * A3 = append3
  12787. * A4 = append4
  12788. *
  12789. * The following field definitions describe the format of the TX completion
  12790. * indication sent from the target to the host
  12791. * Header fields:
  12792. * - msg_type
  12793. * Bits 7:0
  12794. * Purpose: identifies this as HTT TX completion indication
  12795. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12796. * - status
  12797. * Bits 10:8
  12798. * Purpose: the TX completion status of payload fragmentations descriptors
  12799. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12800. * - tid
  12801. * Bits 14:11
  12802. * Purpose: the tid associated with those fragmentation descriptors. It is
  12803. * valid or not, depending on the tid_invalid bit.
  12804. * Value: 0 to 15
  12805. * - tid_invalid
  12806. * Bits 15:15
  12807. * Purpose: this bit indicates whether the tid field is valid or not
  12808. * Value: 0 indicates valid; 1 indicates invalid
  12809. * - num
  12810. * Bits 23:16
  12811. * Purpose: the number of payload in this indication
  12812. * Value: 1 to 255
  12813. * - append (a.k.a. append0)
  12814. * Bits 24:24
  12815. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12816. * the number of tx retries for one MSDU at the end of this message
  12817. * Value: 0 indicates no appending; 1 indicates appending
  12818. * - append1
  12819. * Bits 25:25
  12820. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12821. * contains the timestamp info for each TX msdu id in payload.
  12822. * The order of the timestamps matches the order of the MSDU IDs.
  12823. * Note that a big-endian host needs to account for the reordering
  12824. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12825. * conversion) when determining which tx timestamp corresponds to
  12826. * which MSDU ID.
  12827. * Value: 0 indicates no appending; 1 indicates appending
  12828. * - msdu_tx_power_presence
  12829. * Bits 26:26
  12830. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12831. * for each MSDU referenced by the TX_COMPL_IND message.
  12832. * The tx power is reported in 0.5 dBm units.
  12833. * The order of the per-MSDU tx power reports matches the order
  12834. * of the MSDU IDs.
  12835. * Note that a big-endian host needs to account for the reordering
  12836. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12837. * conversion) when determining which Tx Power corresponds to
  12838. * which MSDU ID.
  12839. * Value: 0 indicates MSDU tx power reports are not appended,
  12840. * 1 indicates MSDU tx power reports are appended
  12841. * - append2
  12842. * Bits 27:27
  12843. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12844. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12845. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12846. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12847. * for each MSDU, for convenience.
  12848. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12849. * this append2 bit is set).
  12850. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12851. * dB above the noise floor.
  12852. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12853. * 1 indicates MSDU ACK RSSI values are appended.
  12854. * - append3
  12855. * Bits 28:28
  12856. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12857. * contains the tx tsf info based on wlan global TSF for
  12858. * each TX msdu id in payload.
  12859. * The order of the tx tsf matches the order of the MSDU IDs.
  12860. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12861. * values to indicate the the lower 32 bits and higher 32 bits of
  12862. * the tx tsf.
  12863. * The tx_tsf64 here represents the time MSDU was acked and the
  12864. * tx_tsf64 has microseconds units.
  12865. * Value: 0 indicates no appending; 1 indicates appending
  12866. * - append4
  12867. * Bits 29:29
  12868. * Purpose: Indicate whether data frame control fields and fields required
  12869. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12870. * message. The order of the this message matches the order of
  12871. * the MSDU IDs.
  12872. * Value: 0 indicates frame control fields and fields required for
  12873. * radio tap header values are not appended,
  12874. * 1 indicates frame control fields and fields required for
  12875. * radio tap header values are appended.
  12876. * Payload fields:
  12877. * - hmsdu_id
  12878. * Bits 15:0
  12879. * Purpose: this ID is used to track the Tx buffer in host
  12880. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12881. */
  12882. PREPACK struct htt_tx_data_hdr_information {
  12883. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12884. A_UINT32 /* word 1 */
  12885. /* preamble:
  12886. * 0-OFDM,
  12887. * 1-CCk,
  12888. * 2-HT,
  12889. * 3-VHT
  12890. */
  12891. preamble: 2, /* [1:0] */
  12892. /* mcs:
  12893. * In case of HT preamble interpret
  12894. * MCS along with NSS.
  12895. * Valid values for HT are 0 to 7.
  12896. * HT mcs 0 with NSS 2 is mcs 8.
  12897. * Valid values for VHT are 0 to 9.
  12898. */
  12899. mcs: 4, /* [5:2] */
  12900. /* rate:
  12901. * This is applicable only for
  12902. * CCK and OFDM preamble type
  12903. * rate 0: OFDM 48 Mbps,
  12904. * 1: OFDM 24 Mbps,
  12905. * 2: OFDM 12 Mbps
  12906. * 3: OFDM 6 Mbps
  12907. * 4: OFDM 54 Mbps
  12908. * 5: OFDM 36 Mbps
  12909. * 6: OFDM 18 Mbps
  12910. * 7: OFDM 9 Mbps
  12911. * rate 0: CCK 11 Mbps Long
  12912. * 1: CCK 5.5 Mbps Long
  12913. * 2: CCK 2 Mbps Long
  12914. * 3: CCK 1 Mbps Long
  12915. * 4: CCK 11 Mbps Short
  12916. * 5: CCK 5.5 Mbps Short
  12917. * 6: CCK 2 Mbps Short
  12918. */
  12919. rate : 3, /* [ 8: 6] */
  12920. rssi : 8, /* [16: 9] units=dBm */
  12921. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12922. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12923. stbc : 1, /* [22] */
  12924. sgi : 1, /* [23] */
  12925. ldpc : 1, /* [24] */
  12926. beamformed: 1, /* [25] */
  12927. /* tx_retry_cnt:
  12928. * Indicates retry count of data tx frames provided by the host.
  12929. */
  12930. tx_retry_cnt: 6; /* [31:26] */
  12931. A_UINT32 /* word 2 */
  12932. framectrl:16, /* [15: 0] */
  12933. seqno:16; /* [31:16] */
  12934. } POSTPACK;
  12935. #define HTT_TX_COMPL_IND_STATUS_S 8
  12936. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12937. #define HTT_TX_COMPL_IND_TID_S 11
  12938. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12939. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12940. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12941. #define HTT_TX_COMPL_IND_NUM_S 16
  12942. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12943. #define HTT_TX_COMPL_IND_APPEND_S 24
  12944. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12945. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12946. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12947. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12948. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12949. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12950. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12951. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12952. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12953. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12954. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12955. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12956. do { \
  12957. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12958. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12959. } while (0)
  12960. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12961. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12962. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12963. do { \
  12964. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12965. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12966. } while (0)
  12967. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12968. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12969. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12970. do { \
  12971. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12972. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12973. } while (0)
  12974. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12975. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12976. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12977. do { \
  12978. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12979. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12980. } while (0)
  12981. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12982. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12983. HTT_TX_COMPL_IND_TID_INV_S)
  12984. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12985. do { \
  12986. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12987. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12988. } while (0)
  12989. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12990. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12991. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12992. do { \
  12993. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12994. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12995. } while (0)
  12996. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12997. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12998. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12999. do { \
  13000. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13001. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13002. } while (0)
  13003. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13004. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13005. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13006. do { \
  13007. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13008. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13009. } while (0)
  13010. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13011. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13012. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13013. do { \
  13014. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13015. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13016. } while (0)
  13017. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13018. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13019. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13020. do { \
  13021. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13022. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13023. } while (0)
  13024. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13025. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13026. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13027. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13028. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13029. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13030. #define HTT_TX_COMPL_IND_STAT_OK 0
  13031. /* DISCARD:
  13032. * current meaning:
  13033. * MSDUs were queued for transmission but filtered by HW or SW
  13034. * without any over the air attempts
  13035. * legacy meaning (HL Rome):
  13036. * MSDUs were discarded by the target FW without any over the air
  13037. * attempts due to lack of space
  13038. */
  13039. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13040. /* NO_ACK:
  13041. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13042. */
  13043. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13044. /* POSTPONE:
  13045. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13046. * be downloaded again later (in the appropriate order), when they are
  13047. * deliverable.
  13048. */
  13049. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13050. /*
  13051. * The PEER_DEL tx completion status is used for HL cases
  13052. * where the peer the frame is for has been deleted.
  13053. * The host has already discarded its copy of the frame, but
  13054. * it still needs the tx completion to restore its credit.
  13055. */
  13056. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13057. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13058. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13059. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13060. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13061. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13062. PREPACK struct htt_tx_compl_ind_base {
  13063. A_UINT32 hdr;
  13064. A_UINT16 payload[1/*or more*/];
  13065. } POSTPACK;
  13066. PREPACK struct htt_tx_compl_ind_append_retries {
  13067. A_UINT16 msdu_id;
  13068. A_UINT8 tx_retries;
  13069. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13070. 0: this is the last append_retries struct */
  13071. } POSTPACK;
  13072. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13073. A_UINT32 timestamp[1/*or more*/];
  13074. } POSTPACK;
  13075. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13076. A_UINT32 tx_tsf64_low;
  13077. A_UINT32 tx_tsf64_high;
  13078. } POSTPACK;
  13079. /* htt_tx_data_hdr_information payload extension fields: */
  13080. /* DWORD zero */
  13081. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13082. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13083. /* DWORD one */
  13084. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13085. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13086. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13087. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13088. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13089. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13090. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13091. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13092. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13093. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13094. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13095. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13096. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13097. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13098. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13099. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13100. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13101. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13102. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13103. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13104. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13105. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13106. /* DWORD two */
  13107. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13108. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13109. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13110. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13111. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13112. do { \
  13113. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13114. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13115. } while (0)
  13116. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13117. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13118. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13119. do { \
  13120. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13121. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13122. } while (0)
  13123. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13124. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13125. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13126. do { \
  13127. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13128. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13129. } while (0)
  13130. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13131. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13132. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13133. do { \
  13134. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13135. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13136. } while (0)
  13137. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13138. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13139. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13140. do { \
  13141. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13142. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13143. } while (0)
  13144. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13145. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13146. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13147. do { \
  13148. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13149. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13150. } while (0)
  13151. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13152. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13153. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13156. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13157. } while (0)
  13158. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13159. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13160. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13161. do { \
  13162. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13163. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13164. } while (0)
  13165. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13166. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13167. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13168. do { \
  13169. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13170. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13171. } while (0)
  13172. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13173. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13174. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13175. do { \
  13176. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13177. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13178. } while (0)
  13179. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13180. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13181. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13182. do { \
  13183. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13184. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13185. } while (0)
  13186. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13187. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13188. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13191. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13192. } while (0)
  13193. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13194. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13195. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13196. do { \
  13197. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13198. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13199. } while (0)
  13200. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13201. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13202. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13203. do { \
  13204. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13205. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13206. } while (0)
  13207. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13208. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13209. /**
  13210. * @brief target -> host rate-control update indication message
  13211. *
  13212. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13213. *
  13214. * @details
  13215. * The following diagram shows the format of the RC Update message
  13216. * sent from the target to the host, while processing the tx-completion
  13217. * of a transmitted PPDU.
  13218. *
  13219. * |31 24|23 16|15 8|7 0|
  13220. * |-------------------------------------------------------------|
  13221. * | peer ID | vdev ID | msg_type |
  13222. * |-------------------------------------------------------------|
  13223. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13224. * |-------------------------------------------------------------|
  13225. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13226. * |-------------------------------------------------------------|
  13227. * | : |
  13228. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13229. * | : |
  13230. * |-------------------------------------------------------------|
  13231. * | : |
  13232. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13233. * | : |
  13234. * |-------------------------------------------------------------|
  13235. * : :
  13236. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13237. *
  13238. */
  13239. typedef struct {
  13240. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13241. A_UINT32 rate_code_flags;
  13242. A_UINT32 flags; /* Encodes information such as excessive
  13243. retransmission, aggregate, some info
  13244. from .11 frame control,
  13245. STBC, LDPC, (SGI and Tx Chain Mask
  13246. are encoded in ptx_rc->flags field),
  13247. AMPDU truncation (BT/time based etc.),
  13248. RTS/CTS attempt */
  13249. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13250. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13251. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13252. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13253. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13254. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13255. } HTT_RC_TX_DONE_PARAMS;
  13256. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13257. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13258. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13259. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13260. #define HTT_RC_UPDATE_VDEVID_S 8
  13261. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13262. #define HTT_RC_UPDATE_PEERID_S 16
  13263. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13264. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13265. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13266. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13267. do { \
  13268. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13269. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13270. } while (0)
  13271. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13272. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13273. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13274. do { \
  13275. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13276. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13277. } while (0)
  13278. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13279. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13280. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13281. do { \
  13282. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13283. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13284. } while (0)
  13285. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13286. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13287. /**
  13288. * @brief target -> host rx fragment indication message definition
  13289. *
  13290. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13291. *
  13292. * @details
  13293. * The following field definitions describe the format of the rx fragment
  13294. * indication message sent from the target to the host.
  13295. * The rx fragment indication message shares the format of the
  13296. * rx indication message, but not all fields from the rx indication message
  13297. * are relevant to the rx fragment indication message.
  13298. *
  13299. *
  13300. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13301. * |-----------+-------------------+---------------------+-------------|
  13302. * | peer ID | |FV| ext TID | msg type |
  13303. * |-------------------------------------------------------------------|
  13304. * | | flush | flush |
  13305. * | | end | start |
  13306. * | | seq num | seq num |
  13307. * |-------------------------------------------------------------------|
  13308. * | reserved | FW rx desc bytes |
  13309. * |-------------------------------------------------------------------|
  13310. * | | FW MSDU Rx |
  13311. * | | desc B0 |
  13312. * |-------------------------------------------------------------------|
  13313. * Header fields:
  13314. * - MSG_TYPE
  13315. * Bits 7:0
  13316. * Purpose: identifies this as an rx fragment indication message
  13317. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13318. * - EXT_TID
  13319. * Bits 12:8
  13320. * Purpose: identify the traffic ID of the rx data, including
  13321. * special "extended" TID values for multicast, broadcast, and
  13322. * non-QoS data frames
  13323. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13324. * - FLUSH_VALID (FV)
  13325. * Bit 13
  13326. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13327. * is valid
  13328. * Value:
  13329. * 1 -> flush IE is valid and needs to be processed
  13330. * 0 -> flush IE is not valid and should be ignored
  13331. * - PEER_ID
  13332. * Bits 31:16
  13333. * Purpose: Identify, by ID, which peer sent the rx data
  13334. * Value: ID of the peer who sent the rx data
  13335. * - FLUSH_SEQ_NUM_START
  13336. * Bits 5:0
  13337. * Purpose: Indicate the start of a series of MPDUs to flush
  13338. * Not all MPDUs within this series are necessarily valid - the host
  13339. * must check each sequence number within this range to see if the
  13340. * corresponding MPDU is actually present.
  13341. * This field is only valid if the FV bit is set.
  13342. * Value:
  13343. * The sequence number for the first MPDUs to check to flush.
  13344. * The sequence number is masked by 0x3f.
  13345. * - FLUSH_SEQ_NUM_END
  13346. * Bits 11:6
  13347. * Purpose: Indicate the end of a series of MPDUs to flush
  13348. * Value:
  13349. * The sequence number one larger than the sequence number of the
  13350. * last MPDU to check to flush.
  13351. * The sequence number is masked by 0x3f.
  13352. * Not all MPDUs within this series are necessarily valid - the host
  13353. * must check each sequence number within this range to see if the
  13354. * corresponding MPDU is actually present.
  13355. * This field is only valid if the FV bit is set.
  13356. * Rx descriptor fields:
  13357. * - FW_RX_DESC_BYTES
  13358. * Bits 15:0
  13359. * Purpose: Indicate how many bytes in the Rx indication are used for
  13360. * FW Rx descriptors
  13361. * Value: 1
  13362. */
  13363. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13364. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13365. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13366. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13367. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13368. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13369. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13370. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13371. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13372. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13373. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13374. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13375. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13376. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13377. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13378. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13379. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13380. #define HTT_RX_FRAG_IND_BYTES \
  13381. (4 /* msg hdr */ + \
  13382. 4 /* flush spec */ + \
  13383. 4 /* (unused) FW rx desc bytes spec */ + \
  13384. 4 /* FW rx desc */)
  13385. /**
  13386. * @brief target -> host test message definition
  13387. *
  13388. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13389. *
  13390. * @details
  13391. * The following field definitions describe the format of the test
  13392. * message sent from the target to the host.
  13393. * The message consists of a 4-octet header, followed by a variable
  13394. * number of 32-bit integer values, followed by a variable number
  13395. * of 8-bit character values.
  13396. *
  13397. * |31 16|15 8|7 0|
  13398. * |-----------------------------------------------------------|
  13399. * | num chars | num ints | msg type |
  13400. * |-----------------------------------------------------------|
  13401. * | int 0 |
  13402. * |-----------------------------------------------------------|
  13403. * | int 1 |
  13404. * |-----------------------------------------------------------|
  13405. * | ... |
  13406. * |-----------------------------------------------------------|
  13407. * | char 3 | char 2 | char 1 | char 0 |
  13408. * |-----------------------------------------------------------|
  13409. * | | | ... | char 4 |
  13410. * |-----------------------------------------------------------|
  13411. * - MSG_TYPE
  13412. * Bits 7:0
  13413. * Purpose: identifies this as a test message
  13414. * Value: HTT_MSG_TYPE_TEST
  13415. * - NUM_INTS
  13416. * Bits 15:8
  13417. * Purpose: indicate how many 32-bit integers follow the message header
  13418. * - NUM_CHARS
  13419. * Bits 31:16
  13420. * Purpose: indicate how many 8-bit characters follow the series of integers
  13421. */
  13422. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13423. #define HTT_RX_TEST_NUM_INTS_S 8
  13424. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13425. #define HTT_RX_TEST_NUM_CHARS_S 16
  13426. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13427. do { \
  13428. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13429. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13430. } while (0)
  13431. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13432. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13433. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13434. do { \
  13435. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13436. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13437. } while (0)
  13438. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13439. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13440. /**
  13441. * @brief target -> host packet log message
  13442. *
  13443. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13444. *
  13445. * @details
  13446. * The following field definitions describe the format of the packet log
  13447. * message sent from the target to the host.
  13448. * The message consists of a 4-octet header,followed by a variable number
  13449. * of 32-bit character values.
  13450. *
  13451. * |31 16|15 12|11 10|9 8|7 0|
  13452. * |------------------------------------------------------------------|
  13453. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13454. * |------------------------------------------------------------------|
  13455. * | payload |
  13456. * |------------------------------------------------------------------|
  13457. * - MSG_TYPE
  13458. * Bits 7:0
  13459. * Purpose: identifies this as a pktlog message
  13460. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13461. * - mac_id
  13462. * Bits 9:8
  13463. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13464. * Value: 0-3
  13465. * - pdev_id
  13466. * Bits 11:10
  13467. * Purpose: pdev_id
  13468. * Value: 0-3
  13469. * 0 (for rings at SOC level),
  13470. * 1/2/3 PDEV -> 0/1/2
  13471. * - payload_size
  13472. * Bits 31:16
  13473. * Purpose: explicitly specify the payload size
  13474. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13475. */
  13476. PREPACK struct htt_pktlog_msg {
  13477. A_UINT32 header;
  13478. A_UINT32 payload[1/* or more */];
  13479. } POSTPACK;
  13480. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13481. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13482. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13483. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13484. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13485. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13486. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13487. do { \
  13488. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13489. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13490. } while (0)
  13491. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13492. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13493. HTT_T2H_PKTLOG_MAC_ID_S)
  13494. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13495. do { \
  13496. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13497. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13498. } while (0)
  13499. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13500. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13501. HTT_T2H_PKTLOG_PDEV_ID_S)
  13502. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13503. do { \
  13504. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13505. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13506. } while (0)
  13507. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13508. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13509. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13510. /*
  13511. * Rx reorder statistics
  13512. * NB: all the fields must be defined in 4 octets size.
  13513. */
  13514. struct rx_reorder_stats {
  13515. /* Non QoS MPDUs received */
  13516. A_UINT32 deliver_non_qos;
  13517. /* MPDUs received in-order */
  13518. A_UINT32 deliver_in_order;
  13519. /* Flush due to reorder timer expired */
  13520. A_UINT32 deliver_flush_timeout;
  13521. /* Flush due to move out of window */
  13522. A_UINT32 deliver_flush_oow;
  13523. /* Flush due to DELBA */
  13524. A_UINT32 deliver_flush_delba;
  13525. /* MPDUs dropped due to FCS error */
  13526. A_UINT32 fcs_error;
  13527. /* MPDUs dropped due to monitor mode non-data packet */
  13528. A_UINT32 mgmt_ctrl;
  13529. /* Unicast-data MPDUs dropped due to invalid peer */
  13530. A_UINT32 invalid_peer;
  13531. /* MPDUs dropped due to duplication (non aggregation) */
  13532. A_UINT32 dup_non_aggr;
  13533. /* MPDUs dropped due to processed before */
  13534. A_UINT32 dup_past;
  13535. /* MPDUs dropped due to duplicate in reorder queue */
  13536. A_UINT32 dup_in_reorder;
  13537. /* Reorder timeout happened */
  13538. A_UINT32 reorder_timeout;
  13539. /* invalid bar ssn */
  13540. A_UINT32 invalid_bar_ssn;
  13541. /* reorder reset due to bar ssn */
  13542. A_UINT32 ssn_reset;
  13543. /* Flush due to delete peer */
  13544. A_UINT32 deliver_flush_delpeer;
  13545. /* Flush due to offload*/
  13546. A_UINT32 deliver_flush_offload;
  13547. /* Flush due to out of buffer*/
  13548. A_UINT32 deliver_flush_oob;
  13549. /* MPDUs dropped due to PN check fail */
  13550. A_UINT32 pn_fail;
  13551. /* MPDUs dropped due to unable to allocate memory */
  13552. A_UINT32 store_fail;
  13553. /* Number of times the tid pool alloc succeeded */
  13554. A_UINT32 tid_pool_alloc_succ;
  13555. /* Number of times the MPDU pool alloc succeeded */
  13556. A_UINT32 mpdu_pool_alloc_succ;
  13557. /* Number of times the MSDU pool alloc succeeded */
  13558. A_UINT32 msdu_pool_alloc_succ;
  13559. /* Number of times the tid pool alloc failed */
  13560. A_UINT32 tid_pool_alloc_fail;
  13561. /* Number of times the MPDU pool alloc failed */
  13562. A_UINT32 mpdu_pool_alloc_fail;
  13563. /* Number of times the MSDU pool alloc failed */
  13564. A_UINT32 msdu_pool_alloc_fail;
  13565. /* Number of times the tid pool freed */
  13566. A_UINT32 tid_pool_free;
  13567. /* Number of times the MPDU pool freed */
  13568. A_UINT32 mpdu_pool_free;
  13569. /* Number of times the MSDU pool freed */
  13570. A_UINT32 msdu_pool_free;
  13571. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13572. A_UINT32 msdu_queued;
  13573. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13574. A_UINT32 msdu_recycled;
  13575. /* Number of MPDUs with invalid peer but A2 found in AST */
  13576. A_UINT32 invalid_peer_a2_in_ast;
  13577. /* Number of MPDUs with invalid peer but A3 found in AST */
  13578. A_UINT32 invalid_peer_a3_in_ast;
  13579. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13580. A_UINT32 invalid_peer_bmc_mpdus;
  13581. /* Number of MSDUs with err attention word */
  13582. A_UINT32 rxdesc_err_att;
  13583. /* Number of MSDUs with flag of peer_idx_invalid */
  13584. A_UINT32 rxdesc_err_peer_idx_inv;
  13585. /* Number of MSDUs with flag of peer_idx_timeout */
  13586. A_UINT32 rxdesc_err_peer_idx_to;
  13587. /* Number of MSDUs with flag of overflow */
  13588. A_UINT32 rxdesc_err_ov;
  13589. /* Number of MSDUs with flag of msdu_length_err */
  13590. A_UINT32 rxdesc_err_msdu_len;
  13591. /* Number of MSDUs with flag of mpdu_length_err */
  13592. A_UINT32 rxdesc_err_mpdu_len;
  13593. /* Number of MSDUs with flag of tkip_mic_err */
  13594. A_UINT32 rxdesc_err_tkip_mic;
  13595. /* Number of MSDUs with flag of decrypt_err */
  13596. A_UINT32 rxdesc_err_decrypt;
  13597. /* Number of MSDUs with flag of fcs_err */
  13598. A_UINT32 rxdesc_err_fcs;
  13599. /* Number of Unicast (bc_mc bit is not set in attention word)
  13600. * frames with invalid peer handler
  13601. */
  13602. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13603. /* Number of unicast frame directly (direct bit is set in attention word)
  13604. * to DUT with invalid peer handler
  13605. */
  13606. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13607. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13608. * frames with invalid peer handler
  13609. */
  13610. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13611. /* Number of MSDUs dropped due to no first MSDU flag */
  13612. A_UINT32 rxdesc_no_1st_msdu;
  13613. /* Number of MSDUs dropped due to ring overflow */
  13614. A_UINT32 msdu_drop_ring_ov;
  13615. /* Number of MSDUs dropped due to FC mismatch */
  13616. A_UINT32 msdu_drop_fc_mismatch;
  13617. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13618. A_UINT32 msdu_drop_mgmt_remote_ring;
  13619. /* Number of MSDUs dropped due to errors not reported in attention word */
  13620. A_UINT32 msdu_drop_misc;
  13621. /* Number of MSDUs go to offload before reorder */
  13622. A_UINT32 offload_msdu_wal;
  13623. /* Number of data frame dropped by offload after reorder */
  13624. A_UINT32 offload_msdu_reorder;
  13625. /* Number of MPDUs with sequence number in the past and within the BA window */
  13626. A_UINT32 dup_past_within_window;
  13627. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13628. A_UINT32 dup_past_outside_window;
  13629. /* Number of MSDUs with decrypt/MIC error */
  13630. A_UINT32 rxdesc_err_decrypt_mic;
  13631. /* Number of data MSDUs received on both local and remote rings */
  13632. A_UINT32 data_msdus_on_both_rings;
  13633. /* MPDUs never filled */
  13634. A_UINT32 holes_not_filled;
  13635. };
  13636. /*
  13637. * Rx Remote buffer statistics
  13638. * NB: all the fields must be defined in 4 octets size.
  13639. */
  13640. struct rx_remote_buffer_mgmt_stats {
  13641. /* Total number of MSDUs reaped for Rx processing */
  13642. A_UINT32 remote_reaped;
  13643. /* MSDUs recycled within firmware */
  13644. A_UINT32 remote_recycled;
  13645. /* MSDUs stored by Data Rx */
  13646. A_UINT32 data_rx_msdus_stored;
  13647. /* Number of HTT indications from WAL Rx MSDU */
  13648. A_UINT32 wal_rx_ind;
  13649. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13650. A_UINT32 wal_rx_ind_unconsumed;
  13651. /* Number of HTT indications from Data Rx MSDU */
  13652. A_UINT32 data_rx_ind;
  13653. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13654. A_UINT32 data_rx_ind_unconsumed;
  13655. /* Number of HTT indications from ATHBUF */
  13656. A_UINT32 athbuf_rx_ind;
  13657. /* Number of remote buffers requested for refill */
  13658. A_UINT32 refill_buf_req;
  13659. /* Number of remote buffers filled by the host */
  13660. A_UINT32 refill_buf_rsp;
  13661. /* Number of times MAC hw_index = f/w write_index */
  13662. A_INT32 mac_no_bufs;
  13663. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13664. A_INT32 fw_indices_equal;
  13665. /* Number of times f/w finds no buffers to post */
  13666. A_INT32 host_no_bufs;
  13667. };
  13668. /*
  13669. * TXBF MU/SU packets and NDPA statistics
  13670. * NB: all the fields must be defined in 4 octets size.
  13671. */
  13672. struct rx_txbf_musu_ndpa_pkts_stats {
  13673. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13674. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13675. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13676. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13677. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13678. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13679. };
  13680. /*
  13681. * htt_dbg_stats_status -
  13682. * present - The requested stats have been delivered in full.
  13683. * This indicates that either the stats information was contained
  13684. * in its entirety within this message, or else this message
  13685. * completes the delivery of the requested stats info that was
  13686. * partially delivered through earlier STATS_CONF messages.
  13687. * partial - The requested stats have been delivered in part.
  13688. * One or more subsequent STATS_CONF messages with the same
  13689. * cookie value will be sent to deliver the remainder of the
  13690. * information.
  13691. * error - The requested stats could not be delivered, for example due
  13692. * to a shortage of memory to construct a message holding the
  13693. * requested stats.
  13694. * invalid - The requested stat type is either not recognized, or the
  13695. * target is configured to not gather the stats type in question.
  13696. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13697. * series_done - This special value indicates that no further stats info
  13698. * elements are present within a series of stats info elems
  13699. * (within a stats upload confirmation message).
  13700. */
  13701. enum htt_dbg_stats_status {
  13702. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13703. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13704. HTT_DBG_STATS_STATUS_ERROR = 2,
  13705. HTT_DBG_STATS_STATUS_INVALID = 3,
  13706. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13707. };
  13708. /**
  13709. * @brief target -> host statistics upload
  13710. *
  13711. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13712. *
  13713. * @details
  13714. * The following field definitions describe the format of the HTT target
  13715. * to host stats upload confirmation message.
  13716. * The message contains a cookie echoed from the HTT host->target stats
  13717. * upload request, which identifies which request the confirmation is
  13718. * for, and a series of tag-length-value stats information elements.
  13719. * The tag-length header for each stats info element also includes a
  13720. * status field, to indicate whether the request for the stat type in
  13721. * question was fully met, partially met, unable to be met, or invalid
  13722. * (if the stat type in question is disabled in the target).
  13723. * A special value of all 1's in this status field is used to indicate
  13724. * the end of the series of stats info elements.
  13725. *
  13726. *
  13727. * |31 16|15 8|7 5|4 0|
  13728. * |------------------------------------------------------------|
  13729. * | reserved | msg type |
  13730. * |------------------------------------------------------------|
  13731. * | cookie LSBs |
  13732. * |------------------------------------------------------------|
  13733. * | cookie MSBs |
  13734. * |------------------------------------------------------------|
  13735. * | stats entry length | reserved | S |stat type|
  13736. * |------------------------------------------------------------|
  13737. * | |
  13738. * | type-specific stats info |
  13739. * | |
  13740. * |------------------------------------------------------------|
  13741. * | stats entry length | reserved | S |stat type|
  13742. * |------------------------------------------------------------|
  13743. * | |
  13744. * | type-specific stats info |
  13745. * | |
  13746. * |------------------------------------------------------------|
  13747. * | n/a | reserved | 111 | n/a |
  13748. * |------------------------------------------------------------|
  13749. * Header fields:
  13750. * - MSG_TYPE
  13751. * Bits 7:0
  13752. * Purpose: identifies this is a statistics upload confirmation message
  13753. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13754. * - COOKIE_LSBS
  13755. * Bits 31:0
  13756. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13757. * message with its preceding host->target stats request message.
  13758. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13759. * - COOKIE_MSBS
  13760. * Bits 31:0
  13761. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13762. * message with its preceding host->target stats request message.
  13763. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13764. *
  13765. * Stats Information Element tag-length header fields:
  13766. * - STAT_TYPE
  13767. * Bits 4:0
  13768. * Purpose: identifies the type of statistics info held in the
  13769. * following information element
  13770. * Value: htt_dbg_stats_type
  13771. * - STATUS
  13772. * Bits 7:5
  13773. * Purpose: indicate whether the requested stats are present
  13774. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13775. * the completion of the stats entry series
  13776. * - LENGTH
  13777. * Bits 31:16
  13778. * Purpose: indicate the stats information size
  13779. * Value: This field specifies the number of bytes of stats information
  13780. * that follows the element tag-length header.
  13781. * It is expected but not required that this length is a multiple of
  13782. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13783. * subsequent stats entry header will begin on a 4-byte aligned
  13784. * boundary.
  13785. */
  13786. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13787. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13788. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13789. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13790. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13791. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13792. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13793. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13794. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13795. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13796. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13797. do { \
  13798. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13799. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13800. } while (0)
  13801. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13802. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13803. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13804. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13805. do { \
  13806. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13807. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13808. } while (0)
  13809. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13810. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13811. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13812. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13813. do { \
  13814. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13815. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13816. } while (0)
  13817. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13818. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13819. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13820. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13821. #define HTT_MAX_AGGR 64
  13822. #define HTT_HL_MAX_AGGR 18
  13823. /**
  13824. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13825. *
  13826. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13827. *
  13828. * @details
  13829. * The following field definitions describe the format of the HTT host
  13830. * to target frag_desc/msdu_ext bank configuration message.
  13831. * The message contains the based address and the min and max id of the
  13832. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13833. * MSDU_EXT/FRAG_DESC.
  13834. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13835. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13836. * the hardware does the mapping/translation.
  13837. *
  13838. * Total banks that can be configured is configured to 16.
  13839. *
  13840. * This should be called before any TX has be initiated by the HTT
  13841. *
  13842. * |31 16|15 8|7 5|4 0|
  13843. * |------------------------------------------------------------|
  13844. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13845. * |------------------------------------------------------------|
  13846. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13847. #if HTT_PADDR64
  13848. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13849. #endif
  13850. * |------------------------------------------------------------|
  13851. * | ... |
  13852. * |------------------------------------------------------------|
  13853. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13854. #if HTT_PADDR64
  13855. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13856. #endif
  13857. * |------------------------------------------------------------|
  13858. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13859. * |------------------------------------------------------------|
  13860. * | ... |
  13861. * |------------------------------------------------------------|
  13862. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13863. * |------------------------------------------------------------|
  13864. * Header fields:
  13865. * - MSG_TYPE
  13866. * Bits 7:0
  13867. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13868. * for systems with 64-bit format for bus addresses:
  13869. * - BANKx_BASE_ADDRESS_LO
  13870. * Bits 31:0
  13871. * Purpose: Provide a mechanism to specify the base address of the
  13872. * MSDU_EXT bank physical/bus address.
  13873. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13874. * - BANKx_BASE_ADDRESS_HI
  13875. * Bits 31:0
  13876. * Purpose: Provide a mechanism to specify the base address of the
  13877. * MSDU_EXT bank physical/bus address.
  13878. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13879. * for systems with 32-bit format for bus addresses:
  13880. * - BANKx_BASE_ADDRESS
  13881. * Bits 31:0
  13882. * Purpose: Provide a mechanism to specify the base address of the
  13883. * MSDU_EXT bank physical/bus address.
  13884. * Value: MSDU_EXT bank physical / bus address
  13885. * - BANKx_MIN_ID
  13886. * Bits 15:0
  13887. * Purpose: Provide a mechanism to specify the min index that needs to
  13888. * mapped.
  13889. * - BANKx_MAX_ID
  13890. * Bits 31:16
  13891. * Purpose: Provide a mechanism to specify the max index that needs to
  13892. * mapped.
  13893. *
  13894. */
  13895. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13896. * safe value.
  13897. * @note MAX supported banks is 16.
  13898. */
  13899. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13900. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13901. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13902. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13903. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13904. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13905. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13906. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13907. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13908. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13909. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13910. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13911. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13912. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13913. do { \
  13914. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13915. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13916. } while (0)
  13917. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13918. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13919. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13920. do { \
  13921. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13922. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13923. } while (0)
  13924. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13925. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13926. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13927. do { \
  13928. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13929. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13930. } while (0)
  13931. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13932. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13933. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13934. do { \
  13935. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13936. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13937. } while (0)
  13938. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13939. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13940. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13941. do { \
  13942. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13943. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13944. } while (0)
  13945. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13946. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13947. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13948. do { \
  13949. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13950. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13951. } while (0)
  13952. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13953. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13954. /*
  13955. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13956. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13957. * addresses are stored in a XXX-bit field.
  13958. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13959. * htt_tx_frag_desc64_bank_cfg_t structs.
  13960. */
  13961. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13962. _paddr_bits_, \
  13963. _paddr__bank_base_address_) \
  13964. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13965. /** word 0 \
  13966. * msg_type: 8, \
  13967. * pdev_id: 2, \
  13968. * swap: 1, \
  13969. * reserved0: 5, \
  13970. * num_banks: 8, \
  13971. * desc_size: 8; \
  13972. */ \
  13973. A_UINT32 word0; \
  13974. /* \
  13975. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13976. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13977. * the second A_UINT32). \
  13978. */ \
  13979. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13980. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13981. } POSTPACK
  13982. /* define htt_tx_frag_desc32_bank_cfg_t */
  13983. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13984. /* define htt_tx_frag_desc64_bank_cfg_t */
  13985. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13986. /*
  13987. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13988. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13989. */
  13990. #if HTT_PADDR64
  13991. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13992. #else
  13993. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13994. #endif
  13995. /**
  13996. * @brief target -> host HTT TX Credit total count update message definition
  13997. *
  13998. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13999. *
  14000. *|31 16|15|14 9| 8 |7 0 |
  14001. *|---------------------+--+----------+-------+----------|
  14002. *|cur htt credit delta | Q| reserved | sign | msg type |
  14003. *|------------------------------------------------------|
  14004. *
  14005. * Header fields:
  14006. * - MSG_TYPE
  14007. * Bits 7:0
  14008. * Purpose: identifies this as a htt tx credit delta update message
  14009. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14010. * - SIGN
  14011. * Bits 8
  14012. * identifies whether credit delta is positive or negative
  14013. * Value:
  14014. * - 0x0: credit delta is positive, rebalance in some buffers
  14015. * - 0x1: credit delta is negative, rebalance out some buffers
  14016. * - reserved
  14017. * Bits 14:9
  14018. * Value: 0x0
  14019. * - TXQ_GRP
  14020. * Bit 15
  14021. * Purpose: indicates whether any tx queue group information elements
  14022. * are appended to the tx credit update message
  14023. * Value: 0 -> no tx queue group information element is present
  14024. * 1 -> a tx queue group information element immediately follows
  14025. * - DELTA_COUNT
  14026. * Bits 31:16
  14027. * Purpose: Specify current htt credit delta absolute count
  14028. */
  14029. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14030. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14031. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14032. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14033. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14034. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14035. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14036. do { \
  14037. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14038. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14039. } while (0)
  14040. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14041. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14042. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14043. do { \
  14044. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14045. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14046. } while (0)
  14047. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14048. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14049. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14050. do { \
  14051. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14052. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14053. } while (0)
  14054. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14055. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14056. #define HTT_TX_CREDIT_MSG_BYTES 4
  14057. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14058. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14059. /**
  14060. * @brief HTT WDI_IPA Operation Response Message
  14061. *
  14062. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14063. *
  14064. * @details
  14065. * HTT WDI_IPA Operation Response message is sent by target
  14066. * to host confirming suspend or resume operation.
  14067. * |31 24|23 16|15 8|7 0|
  14068. * |----------------+----------------+----------------+----------------|
  14069. * | op_code | Rsvd | msg_type |
  14070. * |-------------------------------------------------------------------|
  14071. * | Rsvd | Response len |
  14072. * |-------------------------------------------------------------------|
  14073. * | |
  14074. * | Response-type specific info |
  14075. * | |
  14076. * | |
  14077. * |-------------------------------------------------------------------|
  14078. * Header fields:
  14079. * - MSG_TYPE
  14080. * Bits 7:0
  14081. * Purpose: Identifies this as WDI_IPA Operation Response message
  14082. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14083. * - OP_CODE
  14084. * Bits 31:16
  14085. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14086. * value: = enum htt_wdi_ipa_op_code
  14087. * - RSP_LEN
  14088. * Bits 16:0
  14089. * Purpose: length for the response-type specific info
  14090. * value: = length in bytes for response-type specific info
  14091. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14092. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14093. */
  14094. PREPACK struct htt_wdi_ipa_op_response_t
  14095. {
  14096. /* DWORD 0: flags and meta-data */
  14097. A_UINT32
  14098. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14099. reserved1: 8,
  14100. op_code: 16;
  14101. A_UINT32
  14102. rsp_len: 16,
  14103. reserved2: 16;
  14104. } POSTPACK;
  14105. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14106. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14107. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14108. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14109. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14110. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14111. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14112. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14113. do { \
  14114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14115. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14116. } while (0)
  14117. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14118. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14119. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14120. do { \
  14121. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14122. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14123. } while (0)
  14124. enum htt_phy_mode {
  14125. htt_phy_mode_11a = 0,
  14126. htt_phy_mode_11g = 1,
  14127. htt_phy_mode_11b = 2,
  14128. htt_phy_mode_11g_only = 3,
  14129. htt_phy_mode_11na_ht20 = 4,
  14130. htt_phy_mode_11ng_ht20 = 5,
  14131. htt_phy_mode_11na_ht40 = 6,
  14132. htt_phy_mode_11ng_ht40 = 7,
  14133. htt_phy_mode_11ac_vht20 = 8,
  14134. htt_phy_mode_11ac_vht40 = 9,
  14135. htt_phy_mode_11ac_vht80 = 10,
  14136. htt_phy_mode_11ac_vht20_2g = 11,
  14137. htt_phy_mode_11ac_vht40_2g = 12,
  14138. htt_phy_mode_11ac_vht80_2g = 13,
  14139. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14140. htt_phy_mode_11ac_vht160 = 15,
  14141. htt_phy_mode_max,
  14142. };
  14143. /**
  14144. * @brief target -> host HTT channel change indication
  14145. *
  14146. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14147. *
  14148. * @details
  14149. * Specify when a channel change occurs.
  14150. * This allows the host to precisely determine which rx frames arrived
  14151. * on the old channel and which rx frames arrived on the new channel.
  14152. *
  14153. *|31 |7 0 |
  14154. *|-------------------------------------------+----------|
  14155. *| reserved | msg type |
  14156. *|------------------------------------------------------|
  14157. *| primary_chan_center_freq_mhz |
  14158. *|------------------------------------------------------|
  14159. *| contiguous_chan1_center_freq_mhz |
  14160. *|------------------------------------------------------|
  14161. *| contiguous_chan2_center_freq_mhz |
  14162. *|------------------------------------------------------|
  14163. *| phy_mode |
  14164. *|------------------------------------------------------|
  14165. *
  14166. * Header fields:
  14167. * - MSG_TYPE
  14168. * Bits 7:0
  14169. * Purpose: identifies this as a htt channel change indication message
  14170. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14171. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14172. * Bits 31:0
  14173. * Purpose: identify the (center of the) new 20 MHz primary channel
  14174. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14175. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14176. * Bits 31:0
  14177. * Purpose: identify the (center of the) contiguous frequency range
  14178. * comprising the new channel.
  14179. * For example, if the new channel is a 80 MHz channel extending
  14180. * 60 MHz beyond the primary channel, this field would be 30 larger
  14181. * than the primary channel center frequency field.
  14182. * Value: center frequency of the contiguous frequency range comprising
  14183. * the full channel in MHz units
  14184. * (80+80 channels also use the CONTIG_CHAN2 field)
  14185. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14186. * Bits 31:0
  14187. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14188. * within a VHT 80+80 channel.
  14189. * This field is only relevant for VHT 80+80 channels.
  14190. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14191. * channel (arbitrary value for cases besides VHT 80+80)
  14192. * - PHY_MODE
  14193. * Bits 31:0
  14194. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14195. * and band
  14196. * Value: htt_phy_mode enum value
  14197. */
  14198. PREPACK struct htt_chan_change_t
  14199. {
  14200. /* DWORD 0: flags and meta-data */
  14201. A_UINT32
  14202. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14203. reserved1: 24;
  14204. A_UINT32 primary_chan_center_freq_mhz;
  14205. A_UINT32 contig_chan1_center_freq_mhz;
  14206. A_UINT32 contig_chan2_center_freq_mhz;
  14207. A_UINT32 phy_mode;
  14208. } POSTPACK;
  14209. /*
  14210. * Due to historical / backwards-compatibility reasons, maintain the
  14211. * below htt_chan_change_msg struct definition, which needs to be
  14212. * consistent with the above htt_chan_change_t struct definition
  14213. * (aside from the htt_chan_change_t definition including the msg_type
  14214. * dword within the message, and the htt_chan_change_msg only containing
  14215. * the payload of the message that follows the msg_type dword).
  14216. */
  14217. PREPACK struct htt_chan_change_msg {
  14218. A_UINT32 chan_mhz; /* frequency in mhz */
  14219. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14220. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14221. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14222. } POSTPACK;
  14223. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14224. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14225. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14226. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14227. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14228. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14229. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14230. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14231. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14232. do { \
  14233. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14234. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14235. } while (0)
  14236. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14237. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14238. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14239. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14240. do { \
  14241. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14242. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14243. } while (0)
  14244. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14245. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14246. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14247. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14248. do { \
  14249. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14250. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14251. } while (0)
  14252. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14253. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14254. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14255. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14256. do { \
  14257. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14258. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14259. } while (0)
  14260. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14261. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14262. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14263. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14264. /**
  14265. * @brief rx offload packet error message
  14266. *
  14267. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14268. *
  14269. * @details
  14270. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14271. * of target payload like mic err.
  14272. *
  14273. * |31 24|23 16|15 8|7 0|
  14274. * |----------------+----------------+----------------+----------------|
  14275. * | tid | vdev_id | msg_sub_type | msg_type |
  14276. * |-------------------------------------------------------------------|
  14277. * : (sub-type dependent content) :
  14278. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14279. * Header fields:
  14280. * - msg_type
  14281. * Bits 7:0
  14282. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14283. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14284. * - msg_sub_type
  14285. * Bits 15:8
  14286. * Purpose: Identifies which type of rx error is reported by this message
  14287. * value: htt_rx_ofld_pkt_err_type
  14288. * - vdev_id
  14289. * Bits 23:16
  14290. * Purpose: Identifies which vdev received the erroneous rx frame
  14291. * value:
  14292. * - tid
  14293. * Bits 31:24
  14294. * Purpose: Identifies the traffic type of the rx frame
  14295. * value:
  14296. *
  14297. * - The payload fields used if the sub-type == MIC error are shown below.
  14298. * Note - MIC err is per MSDU, while PN is per MPDU.
  14299. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14300. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14301. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14302. * instead of sending separate HTT messages for each wrong MSDU within
  14303. * the MPDU.
  14304. *
  14305. * |31 24|23 16|15 8|7 0|
  14306. * |----------------+----------------+----------------+----------------|
  14307. * | Rsvd | key_id | peer_id |
  14308. * |-------------------------------------------------------------------|
  14309. * | receiver MAC addr 31:0 |
  14310. * |-------------------------------------------------------------------|
  14311. * | Rsvd | receiver MAC addr 47:32 |
  14312. * |-------------------------------------------------------------------|
  14313. * | transmitter MAC addr 31:0 |
  14314. * |-------------------------------------------------------------------|
  14315. * | Rsvd | transmitter MAC addr 47:32 |
  14316. * |-------------------------------------------------------------------|
  14317. * | PN 31:0 |
  14318. * |-------------------------------------------------------------------|
  14319. * | Rsvd | PN 47:32 |
  14320. * |-------------------------------------------------------------------|
  14321. * - peer_id
  14322. * Bits 15:0
  14323. * Purpose: identifies which peer is frame is from
  14324. * value:
  14325. * - key_id
  14326. * Bits 23:16
  14327. * Purpose: identifies key_id of rx frame
  14328. * value:
  14329. * - RA_31_0 (receiver MAC addr 31:0)
  14330. * Bits 31:0
  14331. * Purpose: identifies by MAC address which vdev received the frame
  14332. * value: MAC address lower 4 bytes
  14333. * - RA_47_32 (receiver MAC addr 47:32)
  14334. * Bits 15:0
  14335. * Purpose: identifies by MAC address which vdev received the frame
  14336. * value: MAC address upper 2 bytes
  14337. * - TA_31_0 (transmitter MAC addr 31:0)
  14338. * Bits 31:0
  14339. * Purpose: identifies by MAC address which peer transmitted the frame
  14340. * value: MAC address lower 4 bytes
  14341. * - TA_47_32 (transmitter MAC addr 47:32)
  14342. * Bits 15:0
  14343. * Purpose: identifies by MAC address which peer transmitted the frame
  14344. * value: MAC address upper 2 bytes
  14345. * - PN_31_0
  14346. * Bits 31:0
  14347. * Purpose: Identifies pn of rx frame
  14348. * value: PN lower 4 bytes
  14349. * - PN_47_32
  14350. * Bits 15:0
  14351. * Purpose: Identifies pn of rx frame
  14352. * value:
  14353. * TKIP or CCMP: PN upper 2 bytes
  14354. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14355. */
  14356. enum htt_rx_ofld_pkt_err_type {
  14357. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14358. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14359. };
  14360. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14361. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14362. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14363. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14364. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14365. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14366. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14367. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14368. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14369. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14370. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14371. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14372. do { \
  14373. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14374. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14375. } while (0)
  14376. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14377. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14378. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14379. do { \
  14380. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14381. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14382. } while (0)
  14383. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14384. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14385. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14386. do { \
  14387. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14388. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14389. } while (0)
  14390. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14391. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14392. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14393. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14394. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14395. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14396. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14397. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14398. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14399. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14400. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14401. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14402. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14403. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14404. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14405. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14406. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14407. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14408. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14409. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14410. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14411. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14412. do { \
  14413. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14414. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14415. } while (0)
  14416. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14417. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14418. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14419. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14420. do { \
  14421. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14422. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14423. } while (0)
  14424. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14425. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14426. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14428. do { \
  14429. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14430. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14431. } while (0)
  14432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14433. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14434. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14436. do { \
  14437. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14438. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14439. } while (0)
  14440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14441. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14442. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14443. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14444. do { \
  14445. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14446. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14447. } while (0)
  14448. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14449. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14450. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14451. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14452. do { \
  14453. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14454. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14455. } while (0)
  14456. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14457. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14458. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14459. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14460. do { \
  14461. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14462. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14463. } while (0)
  14464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14465. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14466. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14467. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14468. do { \
  14469. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14470. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14471. } while (0)
  14472. /**
  14473. * @brief target -> host peer rate report message
  14474. *
  14475. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14476. *
  14477. * @details
  14478. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14479. * justified rate of all the peers.
  14480. *
  14481. * |31 24|23 16|15 8|7 0|
  14482. * |----------------+----------------+----------------+----------------|
  14483. * | peer_count | | msg_type |
  14484. * |-------------------------------------------------------------------|
  14485. * : Payload (variant number of peer rate report) :
  14486. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14487. * Header fields:
  14488. * - msg_type
  14489. * Bits 7:0
  14490. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14491. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14492. * - reserved
  14493. * Bits 15:8
  14494. * Purpose:
  14495. * value:
  14496. * - peer_count
  14497. * Bits 31:16
  14498. * Purpose: Specify how many peer rate report elements are present in the payload.
  14499. * value:
  14500. *
  14501. * Payload:
  14502. * There are variant number of peer rate report follow the first 32 bits.
  14503. * The peer rate report is defined as follows.
  14504. *
  14505. * |31 20|19 16|15 0|
  14506. * |-----------------------+---------+---------------------------------|-
  14507. * | reserved | phy | peer_id | \
  14508. * |-------------------------------------------------------------------| -> report #0
  14509. * | rate | /
  14510. * |-----------------------+---------+---------------------------------|-
  14511. * | reserved | phy | peer_id | \
  14512. * |-------------------------------------------------------------------| -> report #1
  14513. * | rate | /
  14514. * |-----------------------+---------+---------------------------------|-
  14515. * | reserved | phy | peer_id | \
  14516. * |-------------------------------------------------------------------| -> report #2
  14517. * | rate | /
  14518. * |-------------------------------------------------------------------|-
  14519. * : :
  14520. * : :
  14521. * : :
  14522. * :-------------------------------------------------------------------:
  14523. *
  14524. * - peer_id
  14525. * Bits 15:0
  14526. * Purpose: identify the peer
  14527. * value:
  14528. * - phy
  14529. * Bits 19:16
  14530. * Purpose: identify which phy is in use
  14531. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14532. * Please see enum htt_peer_report_phy_type for detail.
  14533. * - reserved
  14534. * Bits 31:20
  14535. * Purpose:
  14536. * value:
  14537. * - rate
  14538. * Bits 31:0
  14539. * Purpose: represent the justified rate of the peer specified by peer_id
  14540. * value:
  14541. */
  14542. enum htt_peer_rate_report_phy_type {
  14543. HTT_PEER_RATE_REPORT_11B = 0,
  14544. HTT_PEER_RATE_REPORT_11A_G,
  14545. HTT_PEER_RATE_REPORT_11N,
  14546. HTT_PEER_RATE_REPORT_11AC,
  14547. };
  14548. #define HTT_PEER_RATE_REPORT_SIZE 8
  14549. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14550. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14551. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14552. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14553. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14554. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14555. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14556. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14557. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14558. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14559. do { \
  14560. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14561. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14562. } while (0)
  14563. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14564. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14565. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14566. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14567. do { \
  14568. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14569. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14570. } while (0)
  14571. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14572. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14573. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14574. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14575. do { \
  14576. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14577. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14578. } while (0)
  14579. /**
  14580. * @brief target -> host flow pool map message
  14581. *
  14582. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14583. *
  14584. * @details
  14585. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14586. * a flow of descriptors.
  14587. *
  14588. * This message is in TLV format and indicates the parameters to be setup a
  14589. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14590. * receive descriptors from a specified pool.
  14591. *
  14592. * The message would appear as follows:
  14593. *
  14594. * |31 24|23 16|15 8|7 0|
  14595. * |----------------+----------------+----------------+----------------|
  14596. * header | reserved | num_flows | msg_type |
  14597. * |-------------------------------------------------------------------|
  14598. * | |
  14599. * : payload :
  14600. * | |
  14601. * |-------------------------------------------------------------------|
  14602. *
  14603. * The header field is one DWORD long and is interpreted as follows:
  14604. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14605. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14606. * this message
  14607. * b'16-31 - reserved: These bits are reserved for future use
  14608. *
  14609. * Payload:
  14610. * The payload would contain multiple objects of the following structure. Each
  14611. * object represents a flow.
  14612. *
  14613. * |31 24|23 16|15 8|7 0|
  14614. * |----------------+----------------+----------------+----------------|
  14615. * header | reserved | num_flows | msg_type |
  14616. * |-------------------------------------------------------------------|
  14617. * payload0| flow_type |
  14618. * |-------------------------------------------------------------------|
  14619. * | flow_id |
  14620. * |-------------------------------------------------------------------|
  14621. * | reserved0 | flow_pool_id |
  14622. * |-------------------------------------------------------------------|
  14623. * | reserved1 | flow_pool_size |
  14624. * |-------------------------------------------------------------------|
  14625. * | reserved2 |
  14626. * |-------------------------------------------------------------------|
  14627. * payload1| flow_type |
  14628. * |-------------------------------------------------------------------|
  14629. * | flow_id |
  14630. * |-------------------------------------------------------------------|
  14631. * | reserved0 | flow_pool_id |
  14632. * |-------------------------------------------------------------------|
  14633. * | reserved1 | flow_pool_size |
  14634. * |-------------------------------------------------------------------|
  14635. * | reserved2 |
  14636. * |-------------------------------------------------------------------|
  14637. * | . |
  14638. * | . |
  14639. * | . |
  14640. * |-------------------------------------------------------------------|
  14641. *
  14642. * Each payload is 5 DWORDS long and is interpreted as follows:
  14643. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14644. * this flow is associated. It can be VDEV, peer,
  14645. * or tid (AC). Based on enum htt_flow_type.
  14646. *
  14647. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14648. * object. For flow_type vdev it is set to the
  14649. * vdevid, for peer it is peerid and for tid, it is
  14650. * tid_num.
  14651. *
  14652. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14653. * in the host for this flow
  14654. * b'16:31 - reserved0: This field in reserved for the future. In case
  14655. * we have a hierarchical implementation (HCM) of
  14656. * pools, it can be used to indicate the ID of the
  14657. * parent-pool.
  14658. *
  14659. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14660. * Descriptors for this flow will be
  14661. * allocated from this pool in the host.
  14662. * b'16:31 - reserved1: This field in reserved for the future. In case
  14663. * we have a hierarchical implementation of pools,
  14664. * it can be used to indicate the max number of
  14665. * descriptors in the pool. The b'0:15 can be used
  14666. * to indicate min number of descriptors in the
  14667. * HCM scheme.
  14668. *
  14669. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14670. * we have a hierarchical implementation of pools,
  14671. * b'0:15 can be used to indicate the
  14672. * priority-based borrowing (PBB) threshold of
  14673. * the flow's pool. The b'16:31 are still left
  14674. * reserved.
  14675. */
  14676. enum htt_flow_type {
  14677. FLOW_TYPE_VDEV = 0,
  14678. /* Insert new flow types above this line */
  14679. };
  14680. PREPACK struct htt_flow_pool_map_payload_t {
  14681. A_UINT32 flow_type;
  14682. A_UINT32 flow_id;
  14683. A_UINT32 flow_pool_id:16,
  14684. reserved0:16;
  14685. A_UINT32 flow_pool_size:16,
  14686. reserved1:16;
  14687. A_UINT32 reserved2;
  14688. } POSTPACK;
  14689. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14690. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14691. (sizeof(struct htt_flow_pool_map_payload_t))
  14692. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14693. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14694. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14695. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14696. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14697. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14698. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14699. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14700. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14701. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14702. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14703. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14704. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14705. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14706. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14707. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14708. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14709. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14710. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14711. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14712. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14713. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14714. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14715. do { \
  14716. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14717. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14718. } while (0)
  14719. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14720. do { \
  14721. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14722. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14723. } while (0)
  14724. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14725. do { \
  14726. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14727. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14728. } while (0)
  14729. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14730. do { \
  14731. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14732. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14733. } while (0)
  14734. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14735. do { \
  14736. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14737. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14738. } while (0)
  14739. /**
  14740. * @brief target -> host flow pool unmap message
  14741. *
  14742. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14743. *
  14744. * @details
  14745. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14746. * down a flow of descriptors.
  14747. * This message indicates that for the flow (whose ID is provided) is wanting
  14748. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14749. * pool of descriptors from where descriptors are being allocated for this
  14750. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14751. * be unmapped by the host.
  14752. *
  14753. * The message would appear as follows:
  14754. *
  14755. * |31 24|23 16|15 8|7 0|
  14756. * |----------------+----------------+----------------+----------------|
  14757. * | reserved0 | msg_type |
  14758. * |-------------------------------------------------------------------|
  14759. * | flow_type |
  14760. * |-------------------------------------------------------------------|
  14761. * | flow_id |
  14762. * |-------------------------------------------------------------------|
  14763. * | reserved1 | flow_pool_id |
  14764. * |-------------------------------------------------------------------|
  14765. *
  14766. * The message is interpreted as follows:
  14767. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14768. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14769. * b'8:31 - reserved0: Reserved for future use
  14770. *
  14771. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14772. * this flow is associated. It can be VDEV, peer,
  14773. * or tid (AC). Based on enum htt_flow_type.
  14774. *
  14775. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14776. * object. For flow_type vdev it is set to the
  14777. * vdevid, for peer it is peerid and for tid, it is
  14778. * tid_num.
  14779. *
  14780. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14781. * used in the host for this flow
  14782. * b'16:31 - reserved0: This field in reserved for the future.
  14783. *
  14784. */
  14785. PREPACK struct htt_flow_pool_unmap_t {
  14786. A_UINT32 msg_type:8,
  14787. reserved0:24;
  14788. A_UINT32 flow_type;
  14789. A_UINT32 flow_id;
  14790. A_UINT32 flow_pool_id:16,
  14791. reserved1:16;
  14792. } POSTPACK;
  14793. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14794. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14795. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14796. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14797. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14798. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14799. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14800. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14801. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14802. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14803. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14804. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14805. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14806. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14807. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14808. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14809. do { \
  14810. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14811. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14812. } while (0)
  14813. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14814. do { \
  14815. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14816. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14817. } while (0)
  14818. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14819. do { \
  14820. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14821. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14822. } while (0)
  14823. /**
  14824. * @brief target -> host SRING setup done message
  14825. *
  14826. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14827. *
  14828. * @details
  14829. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14830. * SRNG ring setup is done
  14831. *
  14832. * This message indicates whether the last setup operation is successful.
  14833. * It will be sent to host when host set respose_required bit in
  14834. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14835. * The message would appear as follows:
  14836. *
  14837. * |31 24|23 16|15 8|7 0|
  14838. * |--------------- +----------------+----------------+----------------|
  14839. * | setup_status | ring_id | pdev_id | msg_type |
  14840. * |-------------------------------------------------------------------|
  14841. *
  14842. * The message is interpreted as follows:
  14843. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14844. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14845. * b'8:15 - pdev_id:
  14846. * 0 (for rings at SOC/UMAC level),
  14847. * 1/2/3 mac id (for rings at LMAC level)
  14848. * b'16:23 - ring_id: Identify the ring which is set up
  14849. * More details can be got from enum htt_srng_ring_id
  14850. * b'24:31 - setup_status: Indicate status of setup operation
  14851. * Refer to htt_ring_setup_status
  14852. */
  14853. PREPACK struct htt_sring_setup_done_t {
  14854. A_UINT32 msg_type: 8,
  14855. pdev_id: 8,
  14856. ring_id: 8,
  14857. setup_status: 8;
  14858. } POSTPACK;
  14859. enum htt_ring_setup_status {
  14860. htt_ring_setup_status_ok = 0,
  14861. htt_ring_setup_status_error,
  14862. };
  14863. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14864. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14865. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14866. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14867. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14868. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14869. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14870. do { \
  14871. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14872. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14873. } while (0)
  14874. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14875. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14876. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14877. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14878. HTT_SRING_SETUP_DONE_RING_ID_S)
  14879. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14880. do { \
  14881. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14882. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14883. } while (0)
  14884. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14885. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14886. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14887. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14888. HTT_SRING_SETUP_DONE_STATUS_S)
  14889. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14890. do { \
  14891. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14892. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14893. } while (0)
  14894. /**
  14895. * @brief target -> flow map flow info
  14896. *
  14897. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14898. *
  14899. * @details
  14900. * HTT TX map flow entry with tqm flow pointer
  14901. * Sent from firmware to host to add tqm flow pointer in corresponding
  14902. * flow search entry. Flow metadata is replayed back to host as part of this
  14903. * struct to enable host to find the specific flow search entry
  14904. *
  14905. * The message would appear as follows:
  14906. *
  14907. * |31 28|27 18|17 14|13 8|7 0|
  14908. * |-------+------------------------------------------+----------------|
  14909. * | rsvd0 | fse_hsh_idx | msg_type |
  14910. * |-------------------------------------------------------------------|
  14911. * | rsvd1 | tid | peer_id |
  14912. * |-------------------------------------------------------------------|
  14913. * | tqm_flow_pntr_lo |
  14914. * |-------------------------------------------------------------------|
  14915. * | tqm_flow_pntr_hi |
  14916. * |-------------------------------------------------------------------|
  14917. * | fse_meta_data |
  14918. * |-------------------------------------------------------------------|
  14919. *
  14920. * The message is interpreted as follows:
  14921. *
  14922. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14923. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14924. *
  14925. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14926. * for this flow entry
  14927. *
  14928. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14929. *
  14930. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14931. *
  14932. * dword1 - b'14:17 - tid
  14933. *
  14934. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14935. *
  14936. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14937. *
  14938. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14939. *
  14940. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14941. * given by host
  14942. */
  14943. PREPACK struct htt_tx_map_flow_info {
  14944. A_UINT32
  14945. msg_type: 8,
  14946. fse_hsh_idx: 20,
  14947. rsvd0: 4;
  14948. A_UINT32
  14949. peer_id: 14,
  14950. tid: 4,
  14951. rsvd1: 14;
  14952. A_UINT32 tqm_flow_pntr_lo;
  14953. A_UINT32 tqm_flow_pntr_hi;
  14954. struct htt_tx_flow_metadata fse_meta_data;
  14955. } POSTPACK;
  14956. /* DWORD 0 */
  14957. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14958. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14959. /* DWORD 1 */
  14960. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14961. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14962. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14963. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14964. /* DWORD 0 */
  14965. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14966. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14967. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14968. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14969. do { \
  14970. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14971. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14972. } while (0)
  14973. /* DWORD 1 */
  14974. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14975. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14976. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14977. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14978. do { \
  14979. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14980. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14981. } while (0)
  14982. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14983. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14984. HTT_TX_MAP_FLOW_INFO_TID_S)
  14985. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14986. do { \
  14987. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14988. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14989. } while (0)
  14990. /*
  14991. * htt_dbg_ext_stats_status -
  14992. * present - The requested stats have been delivered in full.
  14993. * This indicates that either the stats information was contained
  14994. * in its entirety within this message, or else this message
  14995. * completes the delivery of the requested stats info that was
  14996. * partially delivered through earlier STATS_CONF messages.
  14997. * partial - The requested stats have been delivered in part.
  14998. * One or more subsequent STATS_CONF messages with the same
  14999. * cookie value will be sent to deliver the remainder of the
  15000. * information.
  15001. * error - The requested stats could not be delivered, for example due
  15002. * to a shortage of memory to construct a message holding the
  15003. * requested stats.
  15004. * invalid - The requested stat type is either not recognized, or the
  15005. * target is configured to not gather the stats type in question.
  15006. */
  15007. enum htt_dbg_ext_stats_status {
  15008. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15009. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15010. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15011. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15012. };
  15013. /**
  15014. * @brief target -> host ppdu stats upload
  15015. *
  15016. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15017. *
  15018. * @details
  15019. * The following field definitions describe the format of the HTT target
  15020. * to host ppdu stats indication message.
  15021. *
  15022. *
  15023. * |31 16|15 12|11 10|9 8|7 0 |
  15024. * |----------------------------------------------------------------------|
  15025. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15026. * |----------------------------------------------------------------------|
  15027. * | ppdu_id |
  15028. * |----------------------------------------------------------------------|
  15029. * | Timestamp in us |
  15030. * |----------------------------------------------------------------------|
  15031. * | reserved |
  15032. * |----------------------------------------------------------------------|
  15033. * | type-specific stats info |
  15034. * | (see htt_ppdu_stats.h) |
  15035. * |----------------------------------------------------------------------|
  15036. * Header fields:
  15037. * - MSG_TYPE
  15038. * Bits 7:0
  15039. * Purpose: Identifies this is a PPDU STATS indication
  15040. * message.
  15041. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15042. * - mac_id
  15043. * Bits 9:8
  15044. * Purpose: mac_id of this ppdu_id
  15045. * Value: 0-3
  15046. * - pdev_id
  15047. * Bits 11:10
  15048. * Purpose: pdev_id of this ppdu_id
  15049. * Value: 0-3
  15050. * 0 (for rings at SOC level),
  15051. * 1/2/3 PDEV -> 0/1/2
  15052. * - payload_size
  15053. * Bits 31:16
  15054. * Purpose: total tlv size
  15055. * Value: payload_size in bytes
  15056. */
  15057. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15058. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15059. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15060. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15061. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15062. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15063. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15064. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15065. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15066. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15067. do { \
  15068. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15069. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15070. } while (0)
  15071. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15072. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15073. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15074. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15075. do { \
  15076. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15077. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15078. } while (0)
  15079. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15080. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15081. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15082. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15083. do { \
  15084. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15085. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15086. } while (0)
  15087. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15088. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15089. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15090. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15091. do { \
  15092. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15093. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15094. } while (0)
  15095. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15096. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15097. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15098. /* htt_t2h_ppdu_stats_ind_hdr_t
  15099. * This struct contains the fields within the header of the
  15100. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15101. * stats info.
  15102. * This struct assumes little-endian layout, and thus is only
  15103. * suitable for use within processors known to be little-endian
  15104. * (such as the target).
  15105. * In contrast, the above macros provide endian-portable methods
  15106. * to get and set the bitfields within this PPDU_STATS_IND header.
  15107. */
  15108. typedef struct {
  15109. A_UINT32 msg_type: 8, /* bits 7:0 */
  15110. mac_id: 2, /* bits 9:8 */
  15111. pdev_id: 2, /* bits 11:10 */
  15112. reserved1: 4, /* bits 15:12 */
  15113. payload_size: 16; /* bits 31:16 */
  15114. A_UINT32 ppdu_id;
  15115. A_UINT32 timestamp_us;
  15116. A_UINT32 reserved2;
  15117. } htt_t2h_ppdu_stats_ind_hdr_t;
  15118. /**
  15119. * @brief target -> host extended statistics upload
  15120. *
  15121. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15122. *
  15123. * @details
  15124. * The following field definitions describe the format of the HTT target
  15125. * to host stats upload confirmation message.
  15126. * The message contains a cookie echoed from the HTT host->target stats
  15127. * upload request, which identifies which request the confirmation is
  15128. * for, and a single stats can span over multiple HTT stats indication
  15129. * due to the HTT message size limitation so every HTT ext stats indication
  15130. * will have tag-length-value stats information elements.
  15131. * The tag-length header for each HTT stats IND message also includes a
  15132. * status field, to indicate whether the request for the stat type in
  15133. * question was fully met, partially met, unable to be met, or invalid
  15134. * (if the stat type in question is disabled in the target).
  15135. * A Done bit 1's indicate the end of the of stats info elements.
  15136. *
  15137. *
  15138. * |31 16|15 12|11|10 8|7 5|4 0|
  15139. * |--------------------------------------------------------------|
  15140. * | reserved | msg type |
  15141. * |--------------------------------------------------------------|
  15142. * | cookie LSBs |
  15143. * |--------------------------------------------------------------|
  15144. * | cookie MSBs |
  15145. * |--------------------------------------------------------------|
  15146. * | stats entry length | rsvd | D| S | stat type |
  15147. * |--------------------------------------------------------------|
  15148. * | type-specific stats info |
  15149. * | (see htt_stats.h) |
  15150. * |--------------------------------------------------------------|
  15151. * Header fields:
  15152. * - MSG_TYPE
  15153. * Bits 7:0
  15154. * Purpose: Identifies this is a extended statistics upload confirmation
  15155. * message.
  15156. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15157. * - COOKIE_LSBS
  15158. * Bits 31:0
  15159. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15160. * message with its preceding host->target stats request message.
  15161. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15162. * - COOKIE_MSBS
  15163. * Bits 31:0
  15164. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15165. * message with its preceding host->target stats request message.
  15166. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15167. *
  15168. * Stats Information Element tag-length header fields:
  15169. * - STAT_TYPE
  15170. * Bits 7:0
  15171. * Purpose: identifies the type of statistics info held in the
  15172. * following information element
  15173. * Value: htt_dbg_ext_stats_type
  15174. * - STATUS
  15175. * Bits 10:8
  15176. * Purpose: indicate whether the requested stats are present
  15177. * Value: htt_dbg_ext_stats_status
  15178. * - DONE
  15179. * Bits 11
  15180. * Purpose:
  15181. * Indicates the completion of the stats entry, this will be the last
  15182. * stats conf HTT segment for the requested stats type.
  15183. * Value:
  15184. * 0 -> the stats retrieval is ongoing
  15185. * 1 -> the stats retrieval is complete
  15186. * - LENGTH
  15187. * Bits 31:16
  15188. * Purpose: indicate the stats information size
  15189. * Value: This field specifies the number of bytes of stats information
  15190. * that follows the element tag-length header.
  15191. * It is expected but not required that this length is a multiple of
  15192. * 4 bytes.
  15193. */
  15194. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15195. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15196. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15197. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15198. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15199. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15200. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15201. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15202. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15203. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15204. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15205. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15206. do { \
  15207. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15208. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15209. } while (0)
  15210. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15211. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15212. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15213. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15214. do { \
  15215. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15216. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15217. } while (0)
  15218. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15219. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15220. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15221. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15222. do { \
  15223. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15224. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15225. } while (0)
  15226. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15227. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15228. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15229. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15230. do { \
  15231. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15232. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15233. } while (0)
  15234. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15235. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15236. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15237. /**
  15238. * @brief target -> host streaming statistics upload
  15239. *
  15240. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15241. *
  15242. * @details
  15243. * The following field definitions describe the format of the HTT target
  15244. * to host streaming stats upload indication message.
  15245. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15246. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15247. * use the STREAMING_STATS_REQ message to halt the target's production of
  15248. * STREAMING_STATS_IND messages.
  15249. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15250. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15251. *
  15252. * |31 8|7 0|
  15253. * |--------------------------------------------------------------|
  15254. * | reserved | msg type |
  15255. * |--------------------------------------------------------------|
  15256. * | type-specific stats info |
  15257. * | (see htt_stats.h) |
  15258. * |--------------------------------------------------------------|
  15259. * Header fields:
  15260. * - MSG_TYPE
  15261. * Bits 7:0
  15262. * Purpose: Identifies this as a streaming statistics upload indication
  15263. * message.
  15264. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15265. */
  15266. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15267. typedef enum {
  15268. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15269. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15270. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15271. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15272. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15273. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15274. /* Reserved from 128 - 255 for target internal use.*/
  15275. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15276. } HTT_PEER_TYPE;
  15277. /** macro to convert MAC address from char array to HTT word format */
  15278. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15279. (phtt_mac_addr)->mac_addr31to0 = \
  15280. (((c_macaddr)[0] << 0) | \
  15281. ((c_macaddr)[1] << 8) | \
  15282. ((c_macaddr)[2] << 16) | \
  15283. ((c_macaddr)[3] << 24)); \
  15284. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15285. } while (0)
  15286. /**
  15287. * @brief target -> host monitor mac header indication message
  15288. *
  15289. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15290. *
  15291. * @details
  15292. * The following diagram shows the format of the monitor mac header message
  15293. * sent from the target to the host.
  15294. * This message is primarily sent when promiscuous rx mode is enabled.
  15295. * One message is sent per rx PPDU.
  15296. *
  15297. * |31 24|23 16|15 8|7 0|
  15298. * |-------------------------------------------------------------|
  15299. * | peer_id | reserved0 | msg_type |
  15300. * |-------------------------------------------------------------|
  15301. * | reserved1 | num_mpdu |
  15302. * |-------------------------------------------------------------|
  15303. * | struct hw_rx_desc |
  15304. * | (see wal_rx_desc.h) |
  15305. * |-------------------------------------------------------------|
  15306. * | struct ieee80211_frame_addr4 |
  15307. * | (see ieee80211_defs.h) |
  15308. * |-------------------------------------------------------------|
  15309. * | struct ieee80211_frame_addr4 |
  15310. * | (see ieee80211_defs.h) |
  15311. * |-------------------------------------------------------------|
  15312. * | ...... |
  15313. * |-------------------------------------------------------------|
  15314. *
  15315. * Header fields:
  15316. * - msg_type
  15317. * Bits 7:0
  15318. * Purpose: Identifies this is a monitor mac header indication message.
  15319. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15320. * - peer_id
  15321. * Bits 31:16
  15322. * Purpose: Software peer id given by host during association,
  15323. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15324. * for rx PPDUs received from unassociated peers.
  15325. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15326. * - num_mpdu
  15327. * Bits 15:0
  15328. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15329. * delivered within the message.
  15330. * Value: 1 to 32
  15331. * num_mpdu is limited to a maximum value of 32, due to buffer
  15332. * size limits. For PPDUs with more than 32 MPDUs, only the
  15333. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15334. * the PPDU will be provided.
  15335. */
  15336. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15337. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15338. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15339. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15340. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15341. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15342. do { \
  15343. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15344. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15345. } while (0)
  15346. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15347. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15348. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15349. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15350. do { \
  15351. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15352. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15353. } while (0)
  15354. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15355. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15356. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15357. /**
  15358. * @brief target -> host flow pool resize Message
  15359. *
  15360. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15361. *
  15362. * @details
  15363. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15364. * the flow pool associated with the specified ID is resized
  15365. *
  15366. * The message would appear as follows:
  15367. *
  15368. * |31 16|15 8|7 0|
  15369. * |---------------------------------+----------------+----------------|
  15370. * | reserved0 | Msg type |
  15371. * |-------------------------------------------------------------------|
  15372. * | flow pool new size | flow pool ID |
  15373. * |-------------------------------------------------------------------|
  15374. *
  15375. * The message is interpreted as follows:
  15376. * b'0:7 - msg_type: This will be set to 0x21
  15377. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15378. *
  15379. * b'0:15 - flow pool ID: Existing flow pool ID
  15380. *
  15381. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15382. *
  15383. */
  15384. PREPACK struct htt_flow_pool_resize_t {
  15385. A_UINT32 msg_type:8,
  15386. reserved0:24;
  15387. A_UINT32 flow_pool_id:16,
  15388. flow_pool_new_size:16;
  15389. } POSTPACK;
  15390. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15391. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15392. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15393. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15394. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15395. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15396. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15397. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15398. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15399. do { \
  15400. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15401. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15402. } while (0)
  15403. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15404. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15405. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15406. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15407. do { \
  15408. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15409. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15410. } while (0)
  15411. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15412. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15413. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15414. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15415. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15416. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15417. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15418. /*
  15419. * The read and write indices point to the data within the host buffer.
  15420. * Because the first 4 bytes of the host buffer is used for the read index and
  15421. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15422. * The read index and write index are the byte offsets from the base of the
  15423. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15424. * Refer the ASCII text picture below.
  15425. */
  15426. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15427. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15428. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15429. /*
  15430. ***************************************************************************
  15431. *
  15432. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15433. *
  15434. ***************************************************************************
  15435. *
  15436. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15437. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15438. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15439. * written into the Host memory region mentioned below.
  15440. *
  15441. * Read index is updated by the Host. At any point of time, the read index will
  15442. * indicate the index that will next be read by the Host. The read index is
  15443. * in units of bytes offset from the base of the meta-data buffer.
  15444. *
  15445. * Write index is updated by the FW. At any point of time, the write index will
  15446. * indicate from where the FW can start writing any new data. The write index is
  15447. * in units of bytes offset from the base of the meta-data buffer.
  15448. *
  15449. * If the Host is not fast enough in reading the CFR data, any new capture data
  15450. * would be dropped if there is no space left to write the new captures.
  15451. *
  15452. * The last 4 bytes of the memory region will have the magic pattern
  15453. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15454. * not overrun the host buffer.
  15455. *
  15456. * ,--------------------. read and write indices store the
  15457. * | | byte offset from the base of the
  15458. * | ,--------+--------. meta-data buffer to the next
  15459. * | | | | location within the data buffer
  15460. * | | v v that will be read / written
  15461. * ************************************************************************
  15462. * * Read * Write * * Magic *
  15463. * * index * index * CFR data1 ...... CFR data N * pattern *
  15464. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15465. * ************************************************************************
  15466. * |<---------- data buffer ---------->|
  15467. *
  15468. * |<----------------- meta-data buffer allocated in Host ----------------|
  15469. *
  15470. * Note:
  15471. * - Considering the 4 bytes needed to store the Read index (R) and the
  15472. * Write index (W), the initial value is as follows:
  15473. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15474. * - Buffer empty condition:
  15475. * R = W
  15476. *
  15477. * Regarding CFR data format:
  15478. * --------------------------
  15479. *
  15480. * Each CFR tone is stored in HW as 16-bits with the following format:
  15481. * {bits[15:12], bits[11:6], bits[5:0]} =
  15482. * {unsigned exponent (4 bits),
  15483. * signed mantissa_real (6 bits),
  15484. * signed mantissa_imag (6 bits)}
  15485. *
  15486. * CFR_real = mantissa_real * 2^(exponent-5)
  15487. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15488. *
  15489. *
  15490. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15491. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15492. *
  15493. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15494. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15495. * .
  15496. * .
  15497. * .
  15498. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15499. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15500. */
  15501. /* Bandwidth of peer CFR captures */
  15502. typedef enum {
  15503. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15504. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15505. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15506. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15507. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15508. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15509. } HTT_PEER_CFR_CAPTURE_BW;
  15510. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15511. * was captured
  15512. */
  15513. typedef enum {
  15514. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15515. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15516. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15517. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15518. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15519. } HTT_PEER_CFR_CAPTURE_MODE;
  15520. typedef enum {
  15521. /* This message type is currently used for the below purpose:
  15522. *
  15523. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15524. * wmi_peer_cfr_capture_cmd.
  15525. * If payload_present bit is set to 0 then the associated memory region
  15526. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15527. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15528. * message; the CFR dump will be present at the end of the message,
  15529. * after the chan_phy_mode.
  15530. */
  15531. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15532. /* Always keep this last */
  15533. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15534. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15535. /**
  15536. * @brief target -> host CFR dump completion indication message definition
  15537. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15538. *
  15539. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15540. *
  15541. * @details
  15542. * The following diagram shows the format of the Channel Frequency Response
  15543. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15544. * the channel capture of a peer is copied by Firmware into the Host memory
  15545. *
  15546. * **************************************************************************
  15547. *
  15548. * Message format when the CFR capture message type is
  15549. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15550. *
  15551. * **************************************************************************
  15552. *
  15553. * |31 16|15 |8|7 0|
  15554. * |----------------------------------------------------------------|
  15555. * header: | reserved |P| msg_type |
  15556. * word 0 | | | |
  15557. * |----------------------------------------------------------------|
  15558. * payload: | cfr_capture_msg_type |
  15559. * word 1 | |
  15560. * |----------------------------------------------------------------|
  15561. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15562. * word 2 | | | | | | | | |
  15563. * |----------------------------------------------------------------|
  15564. * | mac_addr31to0 |
  15565. * word 3 | |
  15566. * |----------------------------------------------------------------|
  15567. * | unused / reserved | mac_addr47to32 |
  15568. * word 4 | | |
  15569. * |----------------------------------------------------------------|
  15570. * | index |
  15571. * word 5 | |
  15572. * |----------------------------------------------------------------|
  15573. * | length |
  15574. * word 6 | |
  15575. * |----------------------------------------------------------------|
  15576. * | timestamp |
  15577. * word 7 | |
  15578. * |----------------------------------------------------------------|
  15579. * | counter |
  15580. * word 8 | |
  15581. * |----------------------------------------------------------------|
  15582. * | chan_mhz |
  15583. * word 9 | |
  15584. * |----------------------------------------------------------------|
  15585. * | band_center_freq1 |
  15586. * word 10 | |
  15587. * |----------------------------------------------------------------|
  15588. * | band_center_freq2 |
  15589. * word 11 | |
  15590. * |----------------------------------------------------------------|
  15591. * | chan_phy_mode |
  15592. * word 12 | |
  15593. * |----------------------------------------------------------------|
  15594. * where,
  15595. * P - payload present bit (payload_present explained below)
  15596. * req_id - memory request id (mem_req_id explained below)
  15597. * S - status field (status explained below)
  15598. * capbw - capture bandwidth (capture_bw explained below)
  15599. * mode - mode of capture (mode explained below)
  15600. * sts - space time streams (sts_count explained below)
  15601. * chbw - channel bandwidth (channel_bw explained below)
  15602. * captype - capture type (cap_type explained below)
  15603. *
  15604. * The following field definitions describe the format of the CFR dump
  15605. * completion indication sent from the target to the host
  15606. *
  15607. * Header fields:
  15608. *
  15609. * Word 0
  15610. * - msg_type
  15611. * Bits 7:0
  15612. * Purpose: Identifies this as CFR TX completion indication
  15613. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15614. * - payload_present
  15615. * Bit 8
  15616. * Purpose: Identifies how CFR data is sent to host
  15617. * Value: 0 - If CFR Payload is written to host memory
  15618. * 1 - If CFR Payload is sent as part of HTT message
  15619. * (This is the requirement for SDIO/USB where it is
  15620. * not possible to write CFR data to host memory)
  15621. * - reserved
  15622. * Bits 31:9
  15623. * Purpose: Reserved
  15624. * Value: 0
  15625. *
  15626. * Payload fields:
  15627. *
  15628. * Word 1
  15629. * - cfr_capture_msg_type
  15630. * Bits 31:0
  15631. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15632. * to specify the format used for the remainder of the message
  15633. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15634. * (currently only MSG_TYPE_1 is defined)
  15635. *
  15636. * Word 2
  15637. * - mem_req_id
  15638. * Bits 6:0
  15639. * Purpose: Contain the mem request id of the region where the CFR capture
  15640. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15641. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15642. this value is invalid)
  15643. * - status
  15644. * Bit 7
  15645. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15646. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15647. * - capture_bw
  15648. * Bits 10:8
  15649. * Purpose: Carry the bandwidth of the CFR capture
  15650. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15651. * - mode
  15652. * Bits 13:11
  15653. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15654. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15655. * - sts_count
  15656. * Bits 16:14
  15657. * Purpose: Carry the number of space time streams
  15658. * Value: Number of space time streams
  15659. * - channel_bw
  15660. * Bits 19:17
  15661. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15662. * measurement
  15663. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15664. * - cap_type
  15665. * Bits 23:20
  15666. * Purpose: Carry the type of the capture
  15667. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15668. * - vdev_id
  15669. * Bits 31:24
  15670. * Purpose: Carry the virtual device id
  15671. * Value: vdev ID
  15672. *
  15673. * Word 3
  15674. * - mac_addr31to0
  15675. * Bits 31:0
  15676. * Purpose: Contain the bits 31:0 of the peer MAC address
  15677. * Value: Bits 31:0 of the peer MAC address
  15678. *
  15679. * Word 4
  15680. * - mac_addr47to32
  15681. * Bits 15:0
  15682. * Purpose: Contain the bits 47:32 of the peer MAC address
  15683. * Value: Bits 47:32 of the peer MAC address
  15684. *
  15685. * Word 5
  15686. * - index
  15687. * Bits 31:0
  15688. * Purpose: Contain the index at which this CFR dump was written in the Host
  15689. * allocated memory. This index is the number of bytes from the base address.
  15690. * Value: Index position
  15691. *
  15692. * Word 6
  15693. * - length
  15694. * Bits 31:0
  15695. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15696. * Value: Length of the CFR capture of the peer
  15697. *
  15698. * Word 7
  15699. * - timestamp
  15700. * Bits 31:0
  15701. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15702. * clock used for this timestamp is private to the target and not visible to
  15703. * the host i.e., Host can interpret only the relative timestamp deltas from
  15704. * one message to the next, but can't interpret the absolute timestamp from a
  15705. * single message.
  15706. * Value: Timestamp in microseconds
  15707. *
  15708. * Word 8
  15709. * - counter
  15710. * Bits 31:0
  15711. * Purpose: Carry the count of the current CFR capture from FW. This is
  15712. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15713. * in host memory)
  15714. * Value: Count of the current CFR capture
  15715. *
  15716. * Word 9
  15717. * - chan_mhz
  15718. * Bits 31:0
  15719. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15720. * Value: Primary 20 channel frequency
  15721. *
  15722. * Word 10
  15723. * - band_center_freq1
  15724. * Bits 31:0
  15725. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15726. * Value: Center frequency 1 in MHz
  15727. *
  15728. * Word 11
  15729. * - band_center_freq2
  15730. * Bits 31:0
  15731. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15732. * the VDEV
  15733. * 80plus80 mode
  15734. * Value: Center frequency 2 in MHz
  15735. *
  15736. * Word 12
  15737. * - chan_phy_mode
  15738. * Bits 31:0
  15739. * Purpose: Carry the phy mode of the channel, of the VDEV
  15740. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15741. */
  15742. PREPACK struct htt_cfr_dump_ind_type_1 {
  15743. A_UINT32 mem_req_id:7,
  15744. status:1,
  15745. capture_bw:3,
  15746. mode:3,
  15747. sts_count:3,
  15748. channel_bw:3,
  15749. cap_type:4,
  15750. vdev_id:8;
  15751. htt_mac_addr addr;
  15752. A_UINT32 index;
  15753. A_UINT32 length;
  15754. A_UINT32 timestamp;
  15755. A_UINT32 counter;
  15756. struct htt_chan_change_msg chan;
  15757. } POSTPACK;
  15758. PREPACK struct htt_cfr_dump_compl_ind {
  15759. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15760. union {
  15761. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15762. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15763. /* If there is a need to change the memory layout and its associated
  15764. * HTT indication format, a new CFR capture message type can be
  15765. * introduced and added into this union.
  15766. */
  15767. };
  15768. } POSTPACK;
  15769. /*
  15770. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15771. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15772. */
  15773. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15774. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15775. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15776. do { \
  15777. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15778. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15779. } while(0)
  15780. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15781. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15782. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15783. /*
  15784. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15785. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15786. */
  15787. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15788. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15789. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15790. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15791. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15792. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15793. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15794. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15795. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15796. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15797. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15798. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15799. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15800. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15801. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15802. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15803. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15804. do { \
  15805. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15806. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15807. } while (0)
  15808. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15809. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15810. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15811. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15812. do { \
  15813. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15814. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15815. } while (0)
  15816. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15817. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15818. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15819. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15820. do { \
  15821. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15822. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15823. } while (0)
  15824. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15825. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15826. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15827. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15828. do { \
  15829. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15830. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15831. } while (0)
  15832. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15833. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15834. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15835. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15836. do { \
  15837. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15838. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15839. } while (0)
  15840. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15841. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15842. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15843. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15844. do { \
  15845. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15846. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15847. } while (0)
  15848. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15849. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15850. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15851. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15852. do { \
  15853. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15854. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15855. } while (0)
  15856. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15857. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15858. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15859. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15860. do { \
  15861. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15862. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15863. } while (0)
  15864. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15865. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15866. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15867. /**
  15868. * @brief target -> host peer (PPDU) stats message
  15869. *
  15870. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15871. *
  15872. * @details
  15873. * This message is generated by FW when FW is sending stats to host
  15874. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15875. * This message is sent autonomously by the target rather than upon request
  15876. * by the host.
  15877. * The following field definitions describe the format of the HTT target
  15878. * to host peer stats indication message.
  15879. *
  15880. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15881. * or more PPDU stats records.
  15882. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15883. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15884. * then the message would start with the
  15885. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15886. * below.
  15887. *
  15888. * |31 16|15|14|13 11|10 9|8|7 0|
  15889. * |-------------------------------------------------------------|
  15890. * | reserved |MSG_TYPE |
  15891. * |-------------------------------------------------------------|
  15892. * rec 0 | TLV header |
  15893. * rec 0 |-------------------------------------------------------------|
  15894. * rec 0 | ppdu successful bytes |
  15895. * rec 0 |-------------------------------------------------------------|
  15896. * rec 0 | ppdu retry bytes |
  15897. * rec 0 |-------------------------------------------------------------|
  15898. * rec 0 | ppdu failed bytes |
  15899. * rec 0 |-------------------------------------------------------------|
  15900. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15901. * rec 0 |-------------------------------------------------------------|
  15902. * rec 0 | retried MSDUs | successful MSDUs |
  15903. * rec 0 |-------------------------------------------------------------|
  15904. * rec 0 | TX duration | failed MSDUs |
  15905. * rec 0 |-------------------------------------------------------------|
  15906. * ...
  15907. * |-------------------------------------------------------------|
  15908. * rec N | TLV header |
  15909. * rec N |-------------------------------------------------------------|
  15910. * rec N | ppdu successful bytes |
  15911. * rec N |-------------------------------------------------------------|
  15912. * rec N | ppdu retry bytes |
  15913. * rec N |-------------------------------------------------------------|
  15914. * rec N | ppdu failed bytes |
  15915. * rec N |-------------------------------------------------------------|
  15916. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15917. * rec N |-------------------------------------------------------------|
  15918. * rec N | retried MSDUs | successful MSDUs |
  15919. * rec N |-------------------------------------------------------------|
  15920. * rec N | TX duration | failed MSDUs |
  15921. * rec N |-------------------------------------------------------------|
  15922. *
  15923. * where:
  15924. * A = is A-MPDU flag
  15925. * BA = block-ack failure flags
  15926. * BW = bandwidth spec
  15927. * SG = SGI enabled spec
  15928. * S = skipped rate ctrl
  15929. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15930. *
  15931. * Header
  15932. * ------
  15933. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15934. * dword0 - b'8:31 - reserved : Reserved for future use
  15935. *
  15936. * payload include below peer_stats information
  15937. * --------------------------------------------
  15938. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15939. * @tx_success_bytes : total successful bytes in the PPDU.
  15940. * @tx_retry_bytes : total retried bytes in the PPDU.
  15941. * @tx_failed_bytes : total failed bytes in the PPDU.
  15942. * @tx_ratecode : rate code used for the PPDU.
  15943. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15944. * @ba_ack_failed : BA/ACK failed for this PPDU
  15945. * b00 -> BA received
  15946. * b01 -> BA failed once
  15947. * b10 -> BA failed twice, when HW retry is enabled.
  15948. * @bw : BW
  15949. * b00 -> 20 MHz
  15950. * b01 -> 40 MHz
  15951. * b10 -> 80 MHz
  15952. * b11 -> 160 MHz (or 80+80)
  15953. * @sg : SGI enabled
  15954. * @s : skipped ratectrl
  15955. * @peer_id : peer id
  15956. * @tx_success_msdus : successful MSDUs
  15957. * @tx_retry_msdus : retried MSDUs
  15958. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15959. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15960. */
  15961. /**
  15962. * @brief target -> host backpressure event
  15963. *
  15964. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15965. *
  15966. * @details
  15967. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15968. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15969. * This message will only be sent if the backpressure condition has existed
  15970. * continuously for an initial period (100 ms).
  15971. * Repeat messages with updated information will be sent after each
  15972. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15973. * This message indicates the ring id along with current head and tail index
  15974. * locations (i.e. write and read indices).
  15975. * The backpressure time indicates the time in ms for which continuous
  15976. * backpressure has been observed in the ring.
  15977. *
  15978. * The message format is as follows:
  15979. *
  15980. * |31 24|23 16|15 8|7 0|
  15981. * |----------------+----------------+----------------+----------------|
  15982. * | ring_id | ring_type | pdev_id | msg_type |
  15983. * |-------------------------------------------------------------------|
  15984. * | tail_idx | head_idx |
  15985. * |-------------------------------------------------------------------|
  15986. * | backpressure_time_ms |
  15987. * |-------------------------------------------------------------------|
  15988. *
  15989. * The message is interpreted as follows:
  15990. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15991. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15992. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15993. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15994. * the msg is for LMAC ring.
  15995. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15996. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15997. * htt_backpressure_lmac_ring_id. This represents
  15998. * the ring id for which continuous backpressure
  15999. * is seen
  16000. *
  16001. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16002. * the ring indicated by the ring_id
  16003. *
  16004. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16005. * the ring indicated by the ring id
  16006. *
  16007. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16008. * backpressure has been seen in the ring
  16009. * indicated by the ring_id.
  16010. * Units = milliseconds
  16011. */
  16012. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16013. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16014. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16015. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16016. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16017. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16018. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16019. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16020. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16021. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16022. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16023. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16024. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16025. do { \
  16026. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16027. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16028. } while (0)
  16029. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16030. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16031. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16032. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16033. do { \
  16034. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16035. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16036. } while (0)
  16037. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16038. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16039. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16040. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16041. do { \
  16042. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16043. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16044. } while (0)
  16045. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16046. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16047. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16048. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16049. do { \
  16050. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16051. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16052. } while (0)
  16053. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16054. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16055. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16056. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16057. do { \
  16058. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16059. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16060. } while (0)
  16061. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16062. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16063. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16064. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16065. do { \
  16066. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16067. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16068. } while (0)
  16069. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16070. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16071. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16072. enum htt_backpressure_ring_type {
  16073. HTT_SW_RING_TYPE_UMAC,
  16074. HTT_SW_RING_TYPE_LMAC,
  16075. HTT_SW_RING_TYPE_MAX,
  16076. };
  16077. /* Ring id for which the message is sent to host */
  16078. enum htt_backpressure_umac_ringid {
  16079. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16080. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16081. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16082. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16083. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16084. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16085. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16086. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16087. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16088. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16089. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16090. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16091. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16092. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16093. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16094. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16095. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16096. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16097. HTT_SW_UMAC_RING_IDX_MAX,
  16098. };
  16099. enum htt_backpressure_lmac_ringid {
  16100. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16101. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16102. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16103. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16104. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16105. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16106. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16107. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16108. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16109. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16110. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16111. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16112. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16113. HTT_SW_LMAC_RING_IDX_MAX,
  16114. };
  16115. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16116. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16117. pdev_id: 8,
  16118. ring_type: 8, /* htt_backpressure_ring_type */
  16119. /*
  16120. * ring_id holds an enum value from either
  16121. * htt_backpressure_umac_ringid or
  16122. * htt_backpressure_lmac_ringid, based on
  16123. * the ring_type setting.
  16124. */
  16125. ring_id: 8;
  16126. A_UINT16 head_idx;
  16127. A_UINT16 tail_idx;
  16128. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16129. } POSTPACK;
  16130. /*
  16131. * Defines two 32 bit words that can be used by the target to indicate a per
  16132. * user RU allocation and rate information.
  16133. *
  16134. * This information is currently provided in the "sw_response_reference_ptr"
  16135. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16136. * "rx_ppdu_end_user_stats" TLV.
  16137. *
  16138. * VALID:
  16139. * The consumer of these words must explicitly check the valid bit,
  16140. * and only attempt interpretation of any of the remaining fields if
  16141. * the valid bit is set to 1.
  16142. *
  16143. * VERSION:
  16144. * The consumer of these words must also explicitly check the version bit,
  16145. * and only use the V0 definition if the VERSION field is set to 0.
  16146. *
  16147. * Version 1 is currently undefined, with the exception of the VALID and
  16148. * VERSION fields.
  16149. *
  16150. * Version 0:
  16151. *
  16152. * The fields below are duplicated per BW.
  16153. *
  16154. * The consumer must determine which BW field to use, based on the UL OFDMA
  16155. * PPDU BW indicated by HW.
  16156. *
  16157. * RU_START: RU26 start index for the user.
  16158. * Note that this is always using the RU26 index, regardless
  16159. * of the actual RU assigned to the user
  16160. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16161. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16162. *
  16163. * For example, 20MHz (the value in the top row is RU_START)
  16164. *
  16165. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16166. * RU Size 1 (52): | | | | | |
  16167. * RU Size 2 (106): | | | |
  16168. * RU Size 3 (242): | |
  16169. *
  16170. * RU_SIZE: Indicates the RU size, as defined by enum
  16171. * htt_ul_ofdma_user_info_ru_size.
  16172. *
  16173. * LDPC: LDPC enabled (if 0, BCC is used)
  16174. *
  16175. * DCM: DCM enabled
  16176. *
  16177. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16178. * |---------------------------------+--------------------------------|
  16179. * |Ver|Valid| FW internal |
  16180. * |---------------------------------+--------------------------------|
  16181. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16182. * |---------------------------------+--------------------------------|
  16183. */
  16184. enum htt_ul_ofdma_user_info_ru_size {
  16185. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16186. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16187. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16188. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16189. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16190. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16191. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16192. };
  16193. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16194. struct htt_ul_ofdma_user_info_v0 {
  16195. A_UINT32 word0;
  16196. A_UINT32 word1;
  16197. };
  16198. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16199. A_UINT32 w0_fw_rsvd:30; \
  16200. A_UINT32 w0_valid:1; \
  16201. A_UINT32 w0_version:1;
  16202. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16203. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16204. };
  16205. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16206. A_UINT32 w1_nss:3; \
  16207. A_UINT32 w1_mcs:4; \
  16208. A_UINT32 w1_ldpc:1; \
  16209. A_UINT32 w1_dcm:1; \
  16210. A_UINT32 w1_ru_start:7; \
  16211. A_UINT32 w1_ru_size:3; \
  16212. A_UINT32 w1_trig_type:4; \
  16213. A_UINT32 w1_unused:9;
  16214. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16215. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16216. };
  16217. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16218. A_UINT32 w0_fw_rsvd:27; \
  16219. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16220. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16221. 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) */
  16222. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16223. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16224. };
  16225. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16226. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16227. A_UINT32 w1_trig_type:4; \
  16228. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16229. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16230. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16231. };
  16232. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16233. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16234. union {
  16235. A_UINT32 word0;
  16236. struct {
  16237. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16238. };
  16239. };
  16240. union {
  16241. A_UINT32 word1;
  16242. struct {
  16243. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16244. };
  16245. };
  16246. } POSTPACK;
  16247. /*
  16248. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16249. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16250. * this should be picked.
  16251. */
  16252. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16253. union {
  16254. A_UINT32 word0;
  16255. struct {
  16256. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16257. };
  16258. };
  16259. union {
  16260. A_UINT32 word1;
  16261. struct {
  16262. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16263. };
  16264. };
  16265. } POSTPACK;
  16266. enum HTT_UL_OFDMA_TRIG_TYPE {
  16267. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16268. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16269. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16270. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16271. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16272. };
  16273. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16274. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16277. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16278. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16279. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16280. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16281. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16282. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16283. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16284. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16285. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16286. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16287. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16288. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16289. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16291. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16292. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16293. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16294. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16295. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16296. /*--- word 0 ---*/
  16297. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16298. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16299. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16300. do { \
  16301. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16302. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16303. } while (0)
  16304. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16305. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16306. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16307. do { \
  16308. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16309. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16310. } while (0)
  16311. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16312. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16313. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16314. do { \
  16315. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16316. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16317. } while (0)
  16318. /*--- word 1 ---*/
  16319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16320. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16322. do { \
  16323. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16324. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16325. } while (0)
  16326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16327. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16328. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16329. do { \
  16330. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16331. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16332. } while (0)
  16333. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16334. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16335. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16336. do { \
  16337. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16338. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16339. } while (0)
  16340. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16341. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16342. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16343. do { \
  16344. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16345. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16346. } while (0)
  16347. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16348. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16349. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16350. do { \
  16351. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16352. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16353. } while (0)
  16354. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16355. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16356. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16357. do { \
  16358. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16359. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16360. } while (0)
  16361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16362. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16363. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16364. do { \
  16365. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16366. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16367. } while (0)
  16368. /**
  16369. * @brief target -> host channel calibration data message
  16370. *
  16371. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16372. *
  16373. * @brief host -> target channel calibration data message
  16374. *
  16375. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16376. *
  16377. * @details
  16378. * The following field definitions describe the format of the channel
  16379. * calibration data message sent from the target to the host when
  16380. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16381. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16382. * The message is defined as htt_chan_caldata_msg followed by a variable
  16383. * number of 32-bit character values.
  16384. *
  16385. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16386. * |------------------------------------------------------------------|
  16387. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16388. * |------------------------------------------------------------------|
  16389. * | payload size | mhz |
  16390. * |------------------------------------------------------------------|
  16391. * | center frequency 2 | center frequency 1 |
  16392. * |------------------------------------------------------------------|
  16393. * | check sum |
  16394. * |------------------------------------------------------------------|
  16395. * | payload |
  16396. * |------------------------------------------------------------------|
  16397. * message info field:
  16398. * - MSG_TYPE
  16399. * Bits 7:0
  16400. * Purpose: identifies this as a channel calibration data message
  16401. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16402. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16403. * - SUB_TYPE
  16404. * Bits 11:8
  16405. * Purpose: T2H: indicates whether target is providing chan cal data
  16406. * to the host to store, or requesting that the host
  16407. * download previously-stored data.
  16408. * H2T: indicates whether the host is providing the requested
  16409. * channel cal data, or if it is rejecting the data
  16410. * request because it does not have the requested data.
  16411. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16412. * - CHKSUM_VALID
  16413. * Bit 12
  16414. * Purpose: indicates if the checksum field is valid
  16415. * value:
  16416. * - FRAG
  16417. * Bit 19:16
  16418. * Purpose: indicates the fragment index for message
  16419. * value: 0 for first fragment, 1 for second fragment, ...
  16420. * - APPEND
  16421. * Bit 20
  16422. * Purpose: indicates if this is the last fragment
  16423. * value: 0 = final fragment, 1 = more fragments will be appended
  16424. *
  16425. * channel and payload size field
  16426. * - MHZ
  16427. * Bits 15:0
  16428. * Purpose: indicates the channel primary frequency
  16429. * Value:
  16430. * - PAYLOAD_SIZE
  16431. * Bits 31:16
  16432. * Purpose: indicates the bytes of calibration data in payload
  16433. * Value:
  16434. *
  16435. * center frequency field
  16436. * - CENTER FREQUENCY 1
  16437. * Bits 15:0
  16438. * Purpose: indicates the channel center frequency
  16439. * Value: channel center frequency, in MHz units
  16440. * - CENTER FREQUENCY 2
  16441. * Bits 31:16
  16442. * Purpose: indicates the secondary channel center frequency,
  16443. * only for 11acvht 80plus80 mode
  16444. * Value: secondary channel center frequency, in MHz units, if applicable
  16445. *
  16446. * checksum field
  16447. * - CHECK_SUM
  16448. * Bits 31:0
  16449. * Purpose: check the payload data, it is just for this fragment.
  16450. * This is intended for the target to check that the channel
  16451. * calibration data returned by the host is the unmodified data
  16452. * that was previously provided to the host by the target.
  16453. * value: checksum of fragment payload
  16454. */
  16455. PREPACK struct htt_chan_caldata_msg {
  16456. /* DWORD 0: message info */
  16457. A_UINT32
  16458. msg_type: 8,
  16459. sub_type: 4 ,
  16460. chksum_valid: 1, /** 1:valid, 0:invalid */
  16461. reserved1: 3,
  16462. frag_idx: 4, /** fragment index for calibration data */
  16463. appending: 1, /** 0: no fragment appending,
  16464. * 1: extra fragment appending */
  16465. reserved2: 11;
  16466. /* DWORD 1: channel and payload size */
  16467. A_UINT32
  16468. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16469. payload_size: 16; /** unit: bytes */
  16470. /* DWORD 2: center frequency */
  16471. A_UINT32
  16472. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16473. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16474. * valid only for 11acvht 80plus80 mode */
  16475. /* DWORD 3: check sum */
  16476. A_UINT32 chksum;
  16477. /* variable length for calibration data */
  16478. A_UINT32 payload[1/* or more */];
  16479. } POSTPACK;
  16480. /* T2H SUBTYPE */
  16481. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16482. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16483. /* H2T SUBTYPE */
  16484. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16485. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16486. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16487. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16488. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16489. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16490. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16491. do { \
  16492. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16493. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16494. } while (0)
  16495. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16496. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16497. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16498. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16499. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16500. do { \
  16501. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16502. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16503. } while (0)
  16504. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16505. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16506. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16507. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16508. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16509. do { \
  16510. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16511. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16512. } while (0)
  16513. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16514. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16515. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16516. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16517. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16518. do { \
  16519. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16520. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16521. } while (0)
  16522. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16523. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16524. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16525. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16526. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16527. do { \
  16528. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16529. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16530. } while (0)
  16531. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16532. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16533. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16534. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16535. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16536. do { \
  16537. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16538. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16539. } while (0)
  16540. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16541. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16542. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16543. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16544. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16545. do { \
  16546. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16547. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16548. } while (0)
  16549. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16550. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16551. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16552. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16553. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16554. do { \
  16555. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16556. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16557. } while (0)
  16558. /**
  16559. * @brief target -> host FSE CMEM based send
  16560. *
  16561. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16562. *
  16563. * @details
  16564. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16565. * FSE placement in CMEM is enabled.
  16566. *
  16567. * This message sends the non-secure CMEM base address.
  16568. * It will be sent to host in response to message
  16569. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16570. * The message would appear as follows:
  16571. *
  16572. * |31 24|23 16|15 8|7 0|
  16573. * |----------------+----------------+----------------+----------------|
  16574. * | reserved | num_entries | msg_type |
  16575. * |----------------+----------------+----------------+----------------|
  16576. * | base_address_lo |
  16577. * |----------------+----------------+----------------+----------------|
  16578. * | base_address_hi |
  16579. * |-------------------------------------------------------------------|
  16580. *
  16581. * The message is interpreted as follows:
  16582. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16583. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16584. * b'8:15 - number_entries: Indicated the number of entries
  16585. * programmed.
  16586. * b'16:31 - reserved.
  16587. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16588. * CMEM base address
  16589. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16590. * CMEM base address
  16591. */
  16592. PREPACK struct htt_cmem_base_send_t {
  16593. A_UINT32 msg_type: 8,
  16594. num_entries: 8,
  16595. reserved: 16;
  16596. A_UINT32 base_address_lo;
  16597. A_UINT32 base_address_hi;
  16598. } POSTPACK;
  16599. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16600. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16601. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16602. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16603. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16604. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16605. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16606. do { \
  16607. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16608. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16609. } while (0)
  16610. /**
  16611. * @brief - HTT PPDU ID format
  16612. *
  16613. * @details
  16614. * The following field definitions describe the format of the PPDU ID.
  16615. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16616. *
  16617. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16618. * +--------------------------------------------------------------------------
  16619. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16620. * +--------------------------------------------------------------------------
  16621. *
  16622. * sch id :Schedule command id
  16623. * Bits [11 : 0] : monotonically increasing counter to track the
  16624. * PPDU posted to a specific transmit queue.
  16625. *
  16626. * hwq_id: Hardware Queue ID.
  16627. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16628. *
  16629. * mac_id: MAC ID
  16630. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16631. *
  16632. * seq_idx: Sequence index.
  16633. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16634. * a particular TXOP.
  16635. *
  16636. * tqm_cmd: HWSCH/TQM flag.
  16637. * Bit [23] : Always set to 0.
  16638. *
  16639. * seq_cmd_type: Sequence command type.
  16640. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16641. * Refer to enum HTT_STATS_FTYPE for values.
  16642. */
  16643. PREPACK struct htt_ppdu_id {
  16644. A_UINT32
  16645. sch_id: 12,
  16646. hwq_id: 5,
  16647. mac_id: 2,
  16648. seq_idx: 2,
  16649. reserved1: 2,
  16650. tqm_cmd: 1,
  16651. seq_cmd_type: 6,
  16652. reserved2: 2;
  16653. } POSTPACK;
  16654. #define HTT_PPDU_ID_SCH_ID_S 0
  16655. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16656. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16657. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16658. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16659. do { \
  16660. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16661. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16662. } while (0)
  16663. #define HTT_PPDU_ID_HWQ_ID_S 12
  16664. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16665. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16666. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16667. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16668. do { \
  16669. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16670. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16671. } while (0)
  16672. #define HTT_PPDU_ID_MAC_ID_S 17
  16673. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16674. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16675. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16676. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16677. do { \
  16678. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16679. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16680. } while (0)
  16681. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16682. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16683. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16684. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16685. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16686. do { \
  16687. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16688. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16689. } while (0)
  16690. #define HTT_PPDU_ID_TQM_CMD_S 23
  16691. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16692. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16693. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16694. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16695. do { \
  16696. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16697. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16698. } while (0)
  16699. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16700. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16701. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16702. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16703. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16704. do { \
  16705. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16706. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16707. } while (0)
  16708. /**
  16709. * @brief target -> RX PEER METADATA V0 format
  16710. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16711. * message from target, and will confirm to the target which peer metadata
  16712. * version to use in the wmi_init message.
  16713. *
  16714. * The following diagram shows the format of the RX PEER METADATA.
  16715. *
  16716. * |31 24|23 16|15 8|7 0|
  16717. * |-----------------------------------------------------------------------|
  16718. * | Reserved | VDEV ID | PEER ID |
  16719. * |-----------------------------------------------------------------------|
  16720. */
  16721. PREPACK struct htt_rx_peer_metadata_v0 {
  16722. A_UINT32
  16723. peer_id: 16,
  16724. vdev_id: 8,
  16725. reserved1: 8;
  16726. } POSTPACK;
  16727. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16728. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16729. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16730. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16731. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16732. do { \
  16733. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16734. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16735. } while (0)
  16736. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16737. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16738. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16739. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16740. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16741. do { \
  16742. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16743. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16744. } while (0)
  16745. /**
  16746. * @brief target -> RX PEER METADATA V1 format
  16747. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16748. * message from target, and will confirm to the target which peer metadata
  16749. * version to use in the wmi_init message.
  16750. *
  16751. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16752. *
  16753. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16754. * |---------------------------------------------------------------------------|
  16755. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  16756. * |---------------------------------------------------------------------------|
  16757. */
  16758. PREPACK struct htt_rx_peer_metadata_v1 {
  16759. A_UINT32
  16760. peer_id: 13,
  16761. ml_peer_valid: 1,
  16762. logical_link_id: 2,
  16763. vdev_id: 8,
  16764. lmac_id: 2,
  16765. chip_id: 3,
  16766. reserved2: 3;
  16767. } POSTPACK;
  16768. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16769. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16770. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16771. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16772. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16773. do { \
  16774. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16775. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16776. } while (0)
  16777. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16778. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16779. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16780. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16781. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16782. do { \
  16783. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16784. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16785. } while (0)
  16786. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16787. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16788. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16789. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16790. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  16791. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  16792. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  16793. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  16794. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  16795. do { \
  16796. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  16797. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  16798. } while (0)
  16799. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16800. do { \
  16801. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16802. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16803. } while (0)
  16804. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16805. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16806. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16807. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16808. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16809. do { \
  16810. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16811. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16812. } while (0)
  16813. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16814. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16815. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16816. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16817. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16818. do { \
  16819. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16820. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16821. } while (0)
  16822. /*
  16823. * In some systems, the host SW wants to specify priorities between
  16824. * different MSDU / flow queues within the same peer-TID.
  16825. * The below enums are used for the host to identify to the target
  16826. * which MSDU queue's priority it wants to adjust.
  16827. */
  16828. /*
  16829. * The MSDUQ index describe index of TCL HW, where each index is
  16830. * used for queuing particular types of MSDUs.
  16831. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16832. */
  16833. enum HTT_MSDUQ_INDEX {
  16834. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16835. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16836. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16837. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16838. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16839. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16840. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16841. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16842. HTT_MSDUQ_MAX_INDEX,
  16843. };
  16844. /* MSDU qtype definition */
  16845. enum HTT_MSDU_QTYPE {
  16846. /*
  16847. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16848. * relative priority. Instead, the relative priority of CRIT_0 versus
  16849. * CRIT_1 is controlled by the FW, through the configuration parameters
  16850. * it applies to the queues.
  16851. */
  16852. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16853. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16854. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16855. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16856. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16857. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16858. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16859. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16860. /* New MSDU_QTYPE should be added above this line */
  16861. /*
  16862. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16863. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16864. * any host/target message definitions. The QTYPE_MAX value can
  16865. * only be used internally within the host or within the target.
  16866. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16867. * it must regard the unexpected value as a default qtype value,
  16868. * or ignore it.
  16869. */
  16870. HTT_MSDU_QTYPE_MAX,
  16871. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16872. };
  16873. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16874. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16875. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16876. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16877. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16878. };
  16879. /**
  16880. * @brief target -> host mlo timestamp offset indication
  16881. *
  16882. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16883. *
  16884. * @details
  16885. * The following field definitions describe the format of the HTT target
  16886. * to host mlo timestamp offset indication message.
  16887. *
  16888. *
  16889. * |31 16|15 12|11 10|9 8|7 0 |
  16890. * |----------------------------------------------------------------------|
  16891. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16892. * |----------------------------------------------------------------------|
  16893. * | Sync time stamp lo in us |
  16894. * |----------------------------------------------------------------------|
  16895. * | Sync time stamp hi in us |
  16896. * |----------------------------------------------------------------------|
  16897. * | mlo time stamp offset lo in us |
  16898. * |----------------------------------------------------------------------|
  16899. * | mlo time stamp offset hi in us |
  16900. * |----------------------------------------------------------------------|
  16901. * | mlo time stamp offset clocks in clock ticks |
  16902. * |----------------------------------------------------------------------|
  16903. * |31 26|25 16|15 0 |
  16904. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16905. * | | compensation in clks | |
  16906. * |----------------------------------------------------------------------|
  16907. * |31 22|21 0 |
  16908. * | rsvd 3 | mlo time stamp comp timer period |
  16909. * |----------------------------------------------------------------------|
  16910. * The message is interpreted as follows:
  16911. *
  16912. * dword0 - b'0:7 - msg_type: This will be set to
  16913. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16914. * value: 0x28
  16915. *
  16916. * dword0 - b'9:8 - pdev_id
  16917. *
  16918. * dword0 - b'11:10 - chip_id
  16919. *
  16920. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16921. *
  16922. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16923. *
  16924. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16925. * which last sync interrupt was received
  16926. *
  16927. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16928. * which last sync interrupt was received
  16929. *
  16930. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16931. *
  16932. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16933. *
  16934. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16935. *
  16936. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16937. *
  16938. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16939. * for sub us resolution
  16940. *
  16941. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16942. *
  16943. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16944. * is applied, in us
  16945. *
  16946. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16947. */
  16948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16949. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16950. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16952. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16953. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16954. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16955. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16957. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16958. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16960. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16961. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16962. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16963. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16964. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16965. do { \
  16966. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16967. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16968. } while (0)
  16969. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16970. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16971. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16972. do { \
  16973. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16974. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16975. } while (0)
  16976. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16977. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16978. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16979. do { \
  16980. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16981. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16982. } while (0)
  16983. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16984. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16985. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16986. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16987. do { \
  16988. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16989. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16990. } while (0)
  16991. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16992. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16993. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16994. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16995. do { \
  16996. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16997. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16998. } while (0)
  16999. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17000. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17001. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17002. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17003. do { \
  17004. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17005. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17006. } while (0)
  17007. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17008. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17009. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17010. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17011. do { \
  17012. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17013. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17014. } while (0)
  17015. typedef struct {
  17016. A_UINT32 msg_type: 8, /* bits 7:0 */
  17017. pdev_id: 2, /* bits 9:8 */
  17018. chip_id: 2, /* bits 11:10 */
  17019. reserved1: 4, /* bits 15:12 */
  17020. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17021. A_UINT32 sync_timestamp_lo_us;
  17022. A_UINT32 sync_timestamp_hi_us;
  17023. A_UINT32 mlo_timestamp_offset_lo_us;
  17024. A_UINT32 mlo_timestamp_offset_hi_us;
  17025. A_UINT32 mlo_timestamp_offset_clks;
  17026. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17027. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17028. reserved2: 6; /* bits 31:26 */
  17029. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17030. reserved3: 10; /* bits 31:22 */
  17031. } htt_t2h_mlo_offset_ind_t;
  17032. /*
  17033. * @brief target -> host VDEV TX RX STATS
  17034. *
  17035. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17036. *
  17037. * @details
  17038. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17039. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17040. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17041. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17042. * periodically by target even in the absence of any further HTT request
  17043. * messages from host.
  17044. *
  17045. * The message is formatted as follows:
  17046. *
  17047. * |31 16|15 8|7 0|
  17048. * |---------------------------------+----------------+----------------|
  17049. * | payload_size | pdev_id | msg_type |
  17050. * |---------------------------------+----------------+----------------|
  17051. * | reserved0 |
  17052. * |-------------------------------------------------------------------|
  17053. * | reserved1 |
  17054. * |-------------------------------------------------------------------|
  17055. * | reserved2 |
  17056. * |-------------------------------------------------------------------|
  17057. * | |
  17058. * | VDEV specific Tx Rx stats info |
  17059. * | |
  17060. * |-------------------------------------------------------------------|
  17061. *
  17062. * The message is interpreted as follows:
  17063. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17064. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17065. * b'8:15 - pdev_id
  17066. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17067. * message header fields (msg_type through reserved2)
  17068. * dword1 - b'0:31 - reserved0.
  17069. * dword2 - b'0:31 - reserved1.
  17070. * dword3 - b'0:31 - reserved2.
  17071. */
  17072. typedef struct {
  17073. A_UINT32 msg_type: 8,
  17074. pdev_id: 8,
  17075. payload_size: 16;
  17076. A_UINT32 reserved0;
  17077. A_UINT32 reserved1;
  17078. A_UINT32 reserved2;
  17079. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17080. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17081. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17082. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17083. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17084. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17085. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17086. do { \
  17087. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17088. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17089. } while (0)
  17090. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17091. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17092. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17093. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17094. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17095. do { \
  17096. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17097. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17098. } while (0)
  17099. /* SOC related stats */
  17100. typedef struct {
  17101. htt_tlv_hdr_t tlv_hdr;
  17102. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17103. * This can be due to either the peer is deleted or deletion is ongoing
  17104. * */
  17105. A_UINT32 inv_peers_msdu_drop_count_lo;
  17106. A_UINT32 inv_peers_msdu_drop_count_hi;
  17107. } htt_t2h_soc_txrx_stats_common_tlv;
  17108. /* VDEV HW Tx/Rx stats */
  17109. typedef struct {
  17110. htt_tlv_hdr_t tlv_hdr;
  17111. A_UINT32 vdev_id;
  17112. /* Rx msdu byte cnt */
  17113. A_UINT32 rx_msdu_byte_cnt_lo;
  17114. A_UINT32 rx_msdu_byte_cnt_hi;
  17115. /* Rx msdu cnt */
  17116. A_UINT32 rx_msdu_cnt_lo;
  17117. A_UINT32 rx_msdu_cnt_hi;
  17118. /* tx msdu byte cnt */
  17119. A_UINT32 tx_msdu_byte_cnt_lo;
  17120. A_UINT32 tx_msdu_byte_cnt_hi;
  17121. /* tx msdu cnt */
  17122. A_UINT32 tx_msdu_cnt_lo;
  17123. A_UINT32 tx_msdu_cnt_hi;
  17124. /* tx excessive retry discarded msdu cnt */
  17125. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17126. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17127. /* TX congestion ctrl msdu drop cnt */
  17128. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17129. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17130. /* discarded tx msdus cnt coz of time to live expiry */
  17131. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17132. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17133. /* tx excessive retry discarded msdu byte cnt */
  17134. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17135. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17136. /* TX congestion ctrl msdu drop byte cnt */
  17137. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17138. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17139. /* discarded tx msdus byte cnt coz of time to live expiry */
  17140. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17141. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17142. /* TQM bypass frame cnt */
  17143. A_UINT32 tqm_bypass_frame_cnt_lo;
  17144. A_UINT32 tqm_bypass_frame_cnt_hi;
  17145. /* TQM bypass byte cnt */
  17146. A_UINT32 tqm_bypass_byte_cnt_lo;
  17147. A_UINT32 tqm_bypass_byte_cnt_hi;
  17148. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17149. /*
  17150. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17151. *
  17152. * @details
  17153. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17154. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17155. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17156. * the default MSDU queues of each of the specified TIDs for the peer
  17157. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17158. * If the default MSDU queues of a given TID within the peer are not linked
  17159. * to a service class, the svc_class_id field for that TID will have a
  17160. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17161. * queues for that TID are not mapped to any service class.
  17162. *
  17163. * |31 16|15 8|7 0|
  17164. * |------------------------------+--------------+--------------|
  17165. * | peer ID | reserved | msg type |
  17166. * |------------------------------+--------------+------+-------|
  17167. * | reserved | svc class ID | TID |
  17168. * |------------------------------------------------------------|
  17169. * ...
  17170. * |------------------------------------------------------------|
  17171. * | reserved | svc class ID | TID |
  17172. * |------------------------------------------------------------|
  17173. * Header fields:
  17174. * dword0 - b'7:0 - msg_type: This will be set to
  17175. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17176. * b'31:16 - peer ID
  17177. * dword1 - b'7:0 - TID
  17178. * b'15:8 - svc class ID
  17179. * (dword2, etc. same format as dword1)
  17180. */
  17181. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17182. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17183. A_UINT32 msg_type :8,
  17184. reserved0 :8,
  17185. peer_id :16;
  17186. struct {
  17187. A_UINT32 tid :8,
  17188. svc_class_id :8,
  17189. reserved1 :16;
  17190. } tid_reports[1/*or more*/];
  17191. } POSTPACK;
  17192. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17193. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17194. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17195. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17196. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17197. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17198. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17199. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17200. do { \
  17201. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17202. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17203. } while (0)
  17204. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17205. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17206. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17207. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17208. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17209. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17210. do { \
  17211. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17212. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17213. } while (0)
  17214. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17215. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17216. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17217. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17218. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17219. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17220. do { \
  17221. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17222. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17223. } while (0)
  17224. /*
  17225. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17226. *
  17227. * @details
  17228. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17229. * flow if the flow is seen the associated service class is conveyed to the
  17230. * target via TCL Data Command. Target on the other hand internally creates the
  17231. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17232. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17233. * the newly created MSDUQ
  17234. *
  17235. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17236. * |------------------------------+------------------------+--------------|
  17237. * | peer ID | HTT qtype | msg type |
  17238. * |---------------------------------+--------------+--+---+-------+------|
  17239. * | reserved |AST list index|FO|WC | HLOS | remap|
  17240. * | | | | | TID | TID |
  17241. * |---------------------+------------------------------------------------|
  17242. * | reserved1 | tgt_opaque_id |
  17243. * |---------------------+------------------------------------------------|
  17244. *
  17245. * Header fields:
  17246. *
  17247. * dword0 - b'7:0 - msg_type: This will be set to
  17248. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17249. * b'15:8 - HTT qtype
  17250. * b'31:16 - peer ID
  17251. *
  17252. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17253. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17254. * hlos_tid : Common to Lithium and Beryllium
  17255. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17256. * TCL Data Command : Beryllium
  17257. * b10 - flow_override (FO), as sent by host in
  17258. * TCL Data Command: Beryllium
  17259. * b11:14 - ast_list_idx
  17260. * Array index into the list of extension AST entries
  17261. * (not the actual AST 16-bit index).
  17262. * The ast_list_idx is one-based, with the following
  17263. * range of values:
  17264. * - legacy targets supporting 16 user-defined
  17265. * MSDU queues: 1-2
  17266. * - legacy targets supporting 48 user-defined
  17267. * MSDU queues: 1-6
  17268. * - new targets: 0 (peer_id is used instead)
  17269. * Note that since ast_list_idx is one-based,
  17270. * the host will need to subtract 1 to use it as an
  17271. * index into a list of extension AST entries.
  17272. * b15:31 - reserved
  17273. *
  17274. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17275. * unique MSDUQ id in firmware
  17276. * b'24:31 - reserved1
  17277. */
  17278. PREPACK struct htt_t2h_sawf_msduq_event {
  17279. A_UINT32 msg_type : 8,
  17280. htt_qtype : 8,
  17281. peer_id :16;
  17282. A_UINT32 remap_tid : 4,
  17283. hlos_tid : 4,
  17284. who_classify_info_sel : 2,
  17285. flow_override : 1,
  17286. ast_list_idx : 4,
  17287. reserved :17;
  17288. A_UINT32 tgt_opaque_id :24,
  17289. reserved1 : 8;
  17290. } POSTPACK;
  17291. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17292. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17293. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17294. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17295. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17296. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17297. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17298. do { \
  17299. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17300. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17301. } while (0)
  17302. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17303. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17304. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17305. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17306. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17307. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17308. do { \
  17309. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17310. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17311. } while (0)
  17312. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17313. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17314. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17315. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17316. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17317. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17318. do { \
  17319. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17320. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17321. } while (0)
  17322. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17323. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17324. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17325. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17326. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17327. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17328. do { \
  17329. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17330. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17331. } while (0)
  17332. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17333. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17334. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17335. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17336. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17337. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17338. do { \
  17339. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17340. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17341. } while (0)
  17342. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17343. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17344. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17345. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17346. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17347. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17348. do { \
  17349. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17350. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17351. } while (0)
  17352. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17353. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17354. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17355. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17356. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17357. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17358. do { \
  17359. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17360. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17361. } while (0)
  17362. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17363. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17364. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17365. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17366. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17367. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17368. do { \
  17369. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17370. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17371. } while (0)
  17372. /**
  17373. * @brief target -> PPDU id format indication
  17374. *
  17375. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17376. *
  17377. * @details
  17378. * The following field definitions describe the format of the HTT target
  17379. * to host PPDU ID format indication message.
  17380. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17381. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17382. * seq_idx :- Sequence control index of this PPDU.
  17383. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17384. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17385. * tqm_cmd:-
  17386. *
  17387. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17388. * |--------------------------------------------------+------------------------|
  17389. * | rsvd0 | msg type |
  17390. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17391. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17392. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17393. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17394. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17395. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17396. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17397. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17398. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17399. * Where: OF = bit offset, NB = number of bits, V = valid
  17400. * The message is interpreted as follows:
  17401. *
  17402. * dword0 - b'7:0 - msg_type: This will be set to
  17403. * HTT_T2H_PPDU_ID_FMT_IND
  17404. * value: 0x30
  17405. *
  17406. * dword0 - b'31:8 - reserved
  17407. *
  17408. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17409. *
  17410. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17411. *
  17412. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17413. *
  17414. * dword1 - b'15:11 - reserved for future use
  17415. *
  17416. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17417. *
  17418. * dword1 - b'21:17 - number of bits in ring_id
  17419. *
  17420. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17421. *
  17422. * dword1 - b'31:27 - reserved for future use
  17423. *
  17424. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17425. *
  17426. * dword2 - b'5:1 - number of bits in sequence index
  17427. *
  17428. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17429. *
  17430. * dword2 - b'15:11 - reserved for future use
  17431. *
  17432. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17433. *
  17434. * dword2 - b'21:17 - number of bits in link_id
  17435. *
  17436. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17437. *
  17438. * dword2 - b'31:27 - reserved for future use
  17439. *
  17440. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17441. *
  17442. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17443. *
  17444. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17445. *
  17446. * dword3 - b'15:11 - reserved for future use
  17447. *
  17448. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17449. *
  17450. * dword3 - b'21:17 - number of bits in tqm_cmd
  17451. *
  17452. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17453. *
  17454. * dword3 - b'31:27 - reserved for future use
  17455. *
  17456. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17457. *
  17458. * dword4 - b'5:1 - number of bits in mac_id
  17459. *
  17460. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17461. *
  17462. * dword4 - b'15:11 - reserved for future use
  17463. *
  17464. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17465. *
  17466. * dword4 - b'21:17 - number of bits in crc
  17467. *
  17468. * dword4 - b'26:22 - offset of crc (in number of bits)
  17469. *
  17470. * dword4 - b'31:27 - reserved for future use
  17471. *
  17472. */
  17473. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17474. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17475. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17476. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17477. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17478. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17479. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17480. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17481. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17482. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17483. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17484. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17485. /* macros for accessing lower 16 bits in dword */
  17486. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17487. do { \
  17488. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17489. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17490. } while (0)
  17491. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17492. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17493. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17494. do { \
  17495. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17496. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17497. } while (0)
  17498. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17499. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17500. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17501. do { \
  17502. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17503. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17504. } while (0)
  17505. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17506. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17507. /* macros for accessing upper 16 bits in dword */
  17508. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17509. do { \
  17510. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17511. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17512. } while (0)
  17513. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17514. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17515. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17516. do { \
  17517. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17518. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17519. } while (0)
  17520. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17521. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17522. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17523. do { \
  17524. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17525. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17526. } while (0)
  17527. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17528. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17529. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17530. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17531. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17532. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17533. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17534. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17535. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17536. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17537. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17538. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17539. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17540. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17541. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17542. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17543. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17544. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17545. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17546. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17547. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17548. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17549. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17550. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17551. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17552. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17553. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17554. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17555. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17556. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17557. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17558. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17559. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17560. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17561. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17562. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17563. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17564. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17565. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17566. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17567. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17568. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17569. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17570. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17571. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17572. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17573. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17574. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17575. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17576. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17577. /* offsets in number dwords */
  17578. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17579. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17580. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17581. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17582. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17583. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17584. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17585. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17586. typedef struct {
  17587. A_UINT32 msg_type: 8, /* bits 7:0 */
  17588. rsvd0: 24;/* bits 31:8 */
  17589. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17590. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17591. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17592. rsvd1: 5, /* bits 15:11 */
  17593. ring_id_valid: 1, /* bits 16:16 */
  17594. ring_id_bits: 5, /* bits 21:17 */
  17595. ring_id_offset: 5, /* bits 26:22 */
  17596. rsvd2: 5; /* bits 31:27 */
  17597. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17598. seq_idx_bits: 5, /* bits 5:1 */
  17599. seq_idx_offset: 5, /* bits 10:6 */
  17600. rsvd3: 5, /* bits 15:11 */
  17601. link_id_valid: 1, /* bits 16:16 */
  17602. link_id_bits: 5, /* bits 21:17 */
  17603. link_id_offset: 5, /* bits 26:22 */
  17604. rsvd4: 5; /* bits 31:27 */
  17605. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17606. seq_cmd_type_bits: 5, /* bits 5:1 */
  17607. seq_cmd_type_offset: 5, /* bits 10:6 */
  17608. rsvd5: 5, /* bits 15:11 */
  17609. tqm_cmd_valid: 1, /* bits 16:16 */
  17610. tqm_cmd_bits: 5, /* bits 21:17 */
  17611. tqm_cmd_offset: 5, /* bits 26:12 */
  17612. rsvd6: 5; /* bits 31:27 */
  17613. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17614. mac_id_bits: 5, /* bits 5:1 */
  17615. mac_id_offset: 5, /* bits 10:6 */
  17616. rsvd8: 5, /* bits 15:11 */
  17617. crc_valid: 1, /* bits 16:16 */
  17618. crc_bits: 5, /* bits 21:17 */
  17619. crc_offset: 5, /* bits 26:12 */
  17620. rsvd9: 5; /* bits 31:27 */
  17621. } htt_t2h_ppdu_id_fmt_ind_t;
  17622. #endif