htt.h 900 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467
  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_MAX_TAG,
  740. } htt_stats_tlv_tag_t;
  741. /* retain deprecated enum name as an alias for the current enum name */
  742. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  743. #define HTT_STATS_TLV_TAG_M 0x00000fff
  744. #define HTT_STATS_TLV_TAG_S 0
  745. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  746. #define HTT_STATS_TLV_LENGTH_S 12
  747. #define HTT_STATS_TLV_TAG_GET(_var) \
  748. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  749. HTT_STATS_TLV_TAG_S)
  750. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  751. do { \
  752. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  753. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  754. } while (0)
  755. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  756. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  757. HTT_STATS_TLV_LENGTH_S)
  758. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  759. do { \
  760. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  761. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  762. } while (0)
  763. /*=== host -> target messages ===============================================*/
  764. enum htt_h2t_msg_type {
  765. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  766. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  767. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  768. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  769. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  770. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  771. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  772. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  773. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  774. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  775. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  776. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  777. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  778. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  779. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  780. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  781. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  782. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  783. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  784. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  785. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  786. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  787. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  788. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  789. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  790. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  791. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  792. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  793. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  794. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  795. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  796. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  797. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  798. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  799. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  800. /* keep this last */
  801. HTT_H2T_NUM_MSGS
  802. };
  803. /*
  804. * HTT host to target message type -
  805. * stored in bits 7:0 of the first word of the message
  806. */
  807. #define HTT_H2T_MSG_TYPE_M 0xff
  808. #define HTT_H2T_MSG_TYPE_S 0
  809. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  810. do { \
  811. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  812. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  813. } while (0)
  814. #define HTT_H2T_MSG_TYPE_GET(word) \
  815. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  816. /**
  817. * @brief host -> target version number request message definition
  818. *
  819. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  820. *
  821. *
  822. * |31 24|23 16|15 8|7 0|
  823. * |----------------+----------------+----------------+----------------|
  824. * | reserved | msg type |
  825. * |-------------------------------------------------------------------|
  826. * : option request TLV (optional) |
  827. * :...................................................................:
  828. *
  829. * The VER_REQ message may consist of a single 4-byte word, or may be
  830. * extended with TLVs that specify which HTT options the host is requesting
  831. * from the target.
  832. * The following option TLVs may be appended to the VER_REQ message:
  833. * - HL_SUPPRESS_TX_COMPL_IND
  834. * - HL_MAX_TX_QUEUE_GROUPS
  835. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  836. * may be appended to the VER_REQ message (but only one TLV of each type).
  837. *
  838. * Header fields:
  839. * - MSG_TYPE
  840. * Bits 7:0
  841. * Purpose: identifies this as a version number request message
  842. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  843. */
  844. #define HTT_VER_REQ_BYTES 4
  845. /* TBDXXX: figure out a reasonable number */
  846. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  847. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  848. /**
  849. * @brief HTT tx MSDU descriptor
  850. *
  851. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  852. *
  853. * @details
  854. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  855. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  856. * the target firmware needs for the FW's tx processing, particularly
  857. * for creating the HW msdu descriptor.
  858. * The same HTT tx descriptor is used for HL and LL systems, though
  859. * a few fields within the tx descriptor are used only by LL or
  860. * only by HL.
  861. * The HTT tx descriptor is defined in two manners: by a struct with
  862. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  863. * definitions.
  864. * The target should use the struct def, for simplicitly and clarity,
  865. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  866. * neutral. Specifically, the host shall use the get/set macros built
  867. * around the mask + shift defs.
  868. */
  869. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  870. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  871. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  872. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  873. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  874. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  875. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  876. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  877. #define HTT_TX_VDEV_ID_WORD 0
  878. #define HTT_TX_VDEV_ID_MASK 0x3f
  879. #define HTT_TX_VDEV_ID_SHIFT 16
  880. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  881. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  882. #define HTT_TX_MSDU_LEN_DWORD 1
  883. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  884. /*
  885. * HTT_VAR_PADDR macros
  886. * Allow physical / bus addresses to be either a single 32-bit value,
  887. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  888. */
  889. #define HTT_VAR_PADDR32(var_name) \
  890. A_UINT32 var_name
  891. #define HTT_VAR_PADDR64_LE(var_name) \
  892. struct { \
  893. /* little-endian: lo precedes hi */ \
  894. A_UINT32 lo; \
  895. A_UINT32 hi; \
  896. } var_name
  897. /*
  898. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  899. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  900. * addresses are stored in a XXX-bit field.
  901. * This macro is used to define both htt_tx_msdu_desc32_t and
  902. * htt_tx_msdu_desc64_t structs.
  903. */
  904. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  905. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  906. { \
  907. /* DWORD 0: flags and meta-data */ \
  908. A_UINT32 \
  909. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  910. \
  911. /* pkt_subtype - \
  912. * Detailed specification of the tx frame contents, extending the \
  913. * general specification provided by pkt_type. \
  914. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  915. * pkt_type | pkt_subtype \
  916. * ============================================================== \
  917. * 802.3 | bit 0:3 - Reserved \
  918. * | bit 4: 0x0 - Copy-Engine Classification Results \
  919. * | not appended to the HTT message \
  920. * | 0x1 - Copy-Engine Classification Results \
  921. * | appended to the HTT message in the \
  922. * | format: \
  923. * | [HTT tx desc, frame header, \
  924. * | CE classification results] \
  925. * | The CE classification results begin \
  926. * | at the next 4-byte boundary after \
  927. * | the frame header. \
  928. * ------------+------------------------------------------------- \
  929. * Eth2 | bit 0:3 - Reserved \
  930. * | bit 4: 0x0 - Copy-Engine Classification Results \
  931. * | not appended to the HTT message \
  932. * | 0x1 - Copy-Engine Classification Results \
  933. * | appended to the HTT message. \
  934. * | See the above specification of the \
  935. * | CE classification results location. \
  936. * ------------+------------------------------------------------- \
  937. * native WiFi | bit 0:3 - Reserved \
  938. * | bit 4: 0x0 - Copy-Engine Classification Results \
  939. * | not appended to the HTT message \
  940. * | 0x1 - Copy-Engine Classification Results \
  941. * | appended to the HTT message. \
  942. * | See the above specification of the \
  943. * | CE classification results location. \
  944. * ------------+------------------------------------------------- \
  945. * mgmt | 0x0 - 802.11 MAC header absent \
  946. * | 0x1 - 802.11 MAC header present \
  947. * ------------+------------------------------------------------- \
  948. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  949. * | 0x1 - 802.11 MAC header present \
  950. * | bit 1: 0x0 - allow aggregation \
  951. * | 0x1 - don't allow aggregation \
  952. * | bit 2: 0x0 - perform encryption \
  953. * | 0x1 - don't perform encryption \
  954. * | bit 3: 0x0 - perform tx classification / queuing \
  955. * | 0x1 - don't perform tx classification; \
  956. * | insert the frame into the "misc" \
  957. * | tx queue \
  958. * | bit 4: 0x0 - Copy-Engine Classification Results \
  959. * | not appended to the HTT message \
  960. * | 0x1 - Copy-Engine Classification Results \
  961. * | appended to the HTT message. \
  962. * | See the above specification of the \
  963. * | CE classification results location. \
  964. */ \
  965. pkt_subtype: 5, \
  966. \
  967. /* pkt_type - \
  968. * General specification of the tx frame contents. \
  969. * The htt_pkt_type enum should be used to specify and check the \
  970. * value of this field. \
  971. */ \
  972. pkt_type: 3, \
  973. \
  974. /* vdev_id - \
  975. * ID for the vdev that is sending this tx frame. \
  976. * For certain non-standard packet types, e.g. pkt_type == raw \
  977. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  978. * This field is used primarily for determining where to queue \
  979. * broadcast and multicast frames. \
  980. */ \
  981. vdev_id: 6, \
  982. /* ext_tid - \
  983. * The extended traffic ID. \
  984. * If the TID is unknown, the extended TID is set to \
  985. * HTT_TX_EXT_TID_INVALID. \
  986. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  987. * value of the QoS TID. \
  988. * If the tx frame is non-QoS data, then the extended TID is set to \
  989. * HTT_TX_EXT_TID_NON_QOS. \
  990. * If the tx frame is multicast or broadcast, then the extended TID \
  991. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  992. */ \
  993. ext_tid: 5, \
  994. \
  995. /* postponed - \
  996. * This flag indicates whether the tx frame has been downloaded to \
  997. * the target before but discarded by the target, and now is being \
  998. * downloaded again; or if this is a new frame that is being \
  999. * downloaded for the first time. \
  1000. * This flag allows the target to determine the correct order for \
  1001. * transmitting new vs. old frames. \
  1002. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1003. * This flag only applies to HL systems, since in LL systems, \
  1004. * the tx flow control is handled entirely within the target. \
  1005. */ \
  1006. postponed: 1, \
  1007. \
  1008. /* extension - \
  1009. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1010. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1011. * \
  1012. * 0x0 - no extension MSDU descriptor is present \
  1013. * 0x1 - an extension MSDU descriptor immediately follows the \
  1014. * regular MSDU descriptor \
  1015. */ \
  1016. extension: 1, \
  1017. \
  1018. /* cksum_offload - \
  1019. * This flag indicates whether checksum offload is enabled or not \
  1020. * for this frame. Target FW use this flag to turn on HW checksumming \
  1021. * 0x0 - No checksum offload \
  1022. * 0x1 - L3 header checksum only \
  1023. * 0x2 - L4 checksum only \
  1024. * 0x3 - L3 header checksum + L4 checksum \
  1025. */ \
  1026. cksum_offload: 2, \
  1027. \
  1028. /* tx_comp_req - \
  1029. * This flag indicates whether Tx Completion \
  1030. * from fw is required or not. \
  1031. * This flag is only relevant if tx completion is not \
  1032. * universally enabled. \
  1033. * For all LL systems, tx completion is mandatory, \
  1034. * so this flag will be irrelevant. \
  1035. * For HL systems tx completion is optional, but HL systems in which \
  1036. * the bus throughput exceeds the WLAN throughput will \
  1037. * probably want to always use tx completion, and thus \
  1038. * would not check this flag. \
  1039. * This flag is required when tx completions are not used universally, \
  1040. * but are still required for certain tx frames for which \
  1041. * an OTA delivery acknowledgment is needed by the host. \
  1042. * In practice, this would be for HL systems in which the \
  1043. * bus throughput is less than the WLAN throughput. \
  1044. * \
  1045. * 0x0 - Tx Completion Indication from Fw not required \
  1046. * 0x1 - Tx Completion Indication from Fw is required \
  1047. */ \
  1048. tx_compl_req: 1; \
  1049. \
  1050. \
  1051. /* DWORD 1: MSDU length and ID */ \
  1052. A_UINT32 \
  1053. len: 16, /* MSDU length, in bytes */ \
  1054. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1055. * and this id is used to calculate fragmentation \
  1056. * descriptor pointer inside the target based on \
  1057. * the base address, configured inside the target. \
  1058. */ \
  1059. \
  1060. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1061. /* frags_desc_ptr - \
  1062. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1063. * where the tx frame's fragments reside in memory. \
  1064. * This field only applies to LL systems, since in HL systems the \
  1065. * (degenerate single-fragment) fragmentation descriptor is created \
  1066. * within the target. \
  1067. */ \
  1068. _paddr__frags_desc_ptr_; \
  1069. \
  1070. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1071. /* \
  1072. * Peer ID : Target can use this value to know which peer-id packet \
  1073. * destined to. \
  1074. * It's intended to be specified by host in case of NAWDS. \
  1075. */ \
  1076. A_UINT16 peerid; \
  1077. \
  1078. /* \
  1079. * Channel frequency: This identifies the desired channel \
  1080. * frequency (in mhz) for tx frames. This is used by FW to help \
  1081. * determine when it is safe to transmit or drop frames for \
  1082. * off-channel operation. \
  1083. * The default value of zero indicates to FW that the corresponding \
  1084. * VDEV's home channel (if there is one) is the desired channel \
  1085. * frequency. \
  1086. */ \
  1087. A_UINT16 chanfreq; \
  1088. \
  1089. /* Reason reserved is commented is increasing the htt structure size \
  1090. * leads to some weird issues. \
  1091. * A_UINT32 reserved_dword3_bits0_31; \
  1092. */ \
  1093. } POSTPACK
  1094. /* define a htt_tx_msdu_desc32_t type */
  1095. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1096. /* define a htt_tx_msdu_desc64_t type */
  1097. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1098. /*
  1099. * Make htt_tx_msdu_desc_t be an alias for either
  1100. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1101. */
  1102. #if HTT_PADDR64
  1103. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1104. #else
  1105. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1106. #endif
  1107. /* decriptor information for Management frame*/
  1108. /*
  1109. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1110. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1111. */
  1112. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1113. extern A_UINT32 mgmt_hdr_len;
  1114. PREPACK struct htt_mgmt_tx_desc_t {
  1115. A_UINT32 msg_type;
  1116. #if HTT_PADDR64
  1117. A_UINT64 frag_paddr; /* DMAble address of the data */
  1118. #else
  1119. A_UINT32 frag_paddr; /* DMAble address of the data */
  1120. #endif
  1121. A_UINT32 desc_id; /* returned to host during completion
  1122. * to free the meory*/
  1123. A_UINT32 len; /* Fragment length */
  1124. A_UINT32 vdev_id; /* virtual device ID*/
  1125. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1126. } POSTPACK;
  1127. PREPACK struct htt_mgmt_tx_compl_ind {
  1128. A_UINT32 desc_id;
  1129. A_UINT32 status;
  1130. } POSTPACK;
  1131. /*
  1132. * This SDU header size comes from the summation of the following:
  1133. * 1. Max of:
  1134. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1135. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1136. * b. 802.11 header, for raw frames: 36 bytes
  1137. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1138. * QoS header, HT header)
  1139. * c. 802.3 header, for ethernet frames: 14 bytes
  1140. * (destination address, source address, ethertype / length)
  1141. * 2. Max of:
  1142. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1143. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1144. * 3. 802.1Q VLAN header: 4 bytes
  1145. * 4. LLC/SNAP header: 8 bytes
  1146. */
  1147. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1148. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1149. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1150. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1151. A_COMPILE_TIME_ASSERT(
  1152. htt_encap_hdr_size_max_check_nwifi,
  1153. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1154. A_COMPILE_TIME_ASSERT(
  1155. htt_encap_hdr_size_max_check_enet,
  1156. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1157. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1158. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1159. #define HTT_TX_HDR_SIZE_802_1Q 4
  1160. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1161. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1162. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1163. HTT_TX_HDR_SIZE_802_1Q + \
  1164. HTT_TX_HDR_SIZE_LLC_SNAP)
  1165. #define HTT_HL_TX_FRM_HDR_LEN \
  1166. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1167. #define HTT_LL_TX_FRM_HDR_LEN \
  1168. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1169. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1170. /* dword 0 */
  1171. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1172. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1174. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1175. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1178. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1179. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1182. #define HTT_TX_DESC_PKT_TYPE_S 13
  1183. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1184. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1185. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1186. #define HTT_TX_DESC_VDEV_ID_S 16
  1187. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1188. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1189. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1190. #define HTT_TX_DESC_EXT_TID_S 22
  1191. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1192. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1193. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1194. #define HTT_TX_DESC_POSTPONED_S 27
  1195. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1196. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1197. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1198. #define HTT_TX_DESC_EXTENSION_S 28
  1199. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1200. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1201. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1202. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1203. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1204. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1205. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1206. #define HTT_TX_DESC_TX_COMP_S 31
  1207. /* dword 1 */
  1208. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1209. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1210. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1211. #define HTT_TX_DESC_FRM_LEN_S 0
  1212. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1213. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1214. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1215. #define HTT_TX_DESC_FRM_ID_S 16
  1216. /* dword 2 */
  1217. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1218. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1219. /* for systems using 64-bit format for bus addresses */
  1220. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1221. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1222. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1223. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1224. /* for systems using 32-bit format for bus addresses */
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1226. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1227. /* dword 3 */
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1229. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1230. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1231. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1232. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1233. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1234. #if HTT_PADDR64
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1236. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1237. #else
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1239. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1240. #endif
  1241. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1242. #define HTT_TX_DESC_PEER_ID_S 0
  1243. /*
  1244. * TEMPORARY:
  1245. * The original definitions for the PEER_ID fields contained typos
  1246. * (with _DESC_PADDR appended to this PEER_ID field name).
  1247. * Retain deprecated original names for PEER_ID fields until all code that
  1248. * refers to them has been updated.
  1249. */
  1250. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1251. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1252. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1253. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1254. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1255. HTT_TX_DESC_PEER_ID_M
  1256. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1257. HTT_TX_DESC_PEER_ID_S
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1259. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1260. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1261. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1262. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1263. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1264. #if HTT_PADDR64
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1266. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1267. #else
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1269. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1270. #endif
  1271. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1272. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1273. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1274. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1275. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1279. } while (0)
  1280. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1281. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1282. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1286. } while (0)
  1287. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1288. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1289. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1293. } while (0)
  1294. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1295. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1296. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1300. } while (0)
  1301. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1302. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1303. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1307. } while (0)
  1308. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1309. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1310. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1314. } while (0)
  1315. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1316. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1317. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1321. } while (0)
  1322. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1323. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1324. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1328. } while (0)
  1329. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1330. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1331. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1335. } while (0)
  1336. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1337. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1338. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1342. } while (0)
  1343. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1344. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1345. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1349. } while (0)
  1350. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1351. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1352. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1356. } while (0)
  1357. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1358. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1359. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1363. } while (0)
  1364. /* enums used in the HTT tx MSDU extension descriptor */
  1365. enum {
  1366. htt_tx_guard_interval_regular = 0,
  1367. htt_tx_guard_interval_short = 1,
  1368. };
  1369. enum {
  1370. htt_tx_preamble_type_ofdm = 0,
  1371. htt_tx_preamble_type_cck = 1,
  1372. htt_tx_preamble_type_ht = 2,
  1373. htt_tx_preamble_type_vht = 3,
  1374. };
  1375. enum {
  1376. htt_tx_bandwidth_5MHz = 0,
  1377. htt_tx_bandwidth_10MHz = 1,
  1378. htt_tx_bandwidth_20MHz = 2,
  1379. htt_tx_bandwidth_40MHz = 3,
  1380. htt_tx_bandwidth_80MHz = 4,
  1381. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1382. };
  1383. /**
  1384. * @brief HTT tx MSDU extension descriptor
  1385. * @details
  1386. * If the target supports HTT tx MSDU extension descriptors, the host has
  1387. * the option of appending the following struct following the regular
  1388. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1389. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1390. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1391. * tx specs for each frame.
  1392. */
  1393. PREPACK struct htt_tx_msdu_desc_ext_t {
  1394. /* DWORD 0: flags */
  1395. A_UINT32
  1396. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1397. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1398. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1399. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1400. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1401. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1402. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1403. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1404. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1405. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1406. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1407. /* DWORD 1: tx power, tx rate, tx BW */
  1408. A_UINT32
  1409. /* pwr -
  1410. * Specify what power the tx frame needs to be transmitted at.
  1411. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1412. * The value needs to be appropriately sign-extended when extracting
  1413. * the value from the message and storing it in a variable that is
  1414. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1415. * automatically handles this sign-extension.)
  1416. * If the transmission uses multiple tx chains, this power spec is
  1417. * the total transmit power, assuming incoherent combination of
  1418. * per-chain power to produce the total power.
  1419. */
  1420. pwr: 8,
  1421. /* mcs_mask -
  1422. * Specify the allowable values for MCS index (modulation and coding)
  1423. * to use for transmitting the frame.
  1424. *
  1425. * For HT / VHT preamble types, this mask directly corresponds to
  1426. * the HT or VHT MCS indices that are allowed. For each bit N set
  1427. * within the mask, MCS index N is allowed for transmitting the frame.
  1428. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1429. * rates versus OFDM rates, so the host has the option of specifying
  1430. * that the target must transmit the frame with CCK or OFDM rates
  1431. * (not HT or VHT), but leaving the decision to the target whether
  1432. * to use CCK or OFDM.
  1433. *
  1434. * For CCK and OFDM, the bits within this mask are interpreted as
  1435. * follows:
  1436. * bit 0 -> CCK 1 Mbps rate is allowed
  1437. * bit 1 -> CCK 2 Mbps rate is allowed
  1438. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1439. * bit 3 -> CCK 11 Mbps rate is allowed
  1440. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1441. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1442. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1443. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1444. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1445. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1446. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1447. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1448. *
  1449. * The MCS index specification needs to be compatible with the
  1450. * bandwidth mask specification. For example, a MCS index == 9
  1451. * specification is inconsistent with a preamble type == VHT,
  1452. * Nss == 1, and channel bandwidth == 20 MHz.
  1453. *
  1454. * Furthermore, the host has only a limited ability to specify to
  1455. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1456. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1457. */
  1458. mcs_mask: 12,
  1459. /* nss_mask -
  1460. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1461. * Each bit in this mask corresponds to a Nss value:
  1462. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1463. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1464. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1465. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1466. * The values in the Nss mask must be suitable for the recipient, e.g.
  1467. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1468. * recipient which only supports 2x2 MIMO.
  1469. */
  1470. nss_mask: 4,
  1471. /* guard_interval -
  1472. * Specify a htt_tx_guard_interval enum value to indicate whether
  1473. * the transmission should use a regular guard interval or a
  1474. * short guard interval.
  1475. */
  1476. guard_interval: 1,
  1477. /* preamble_type_mask -
  1478. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1479. * may choose from for transmitting this frame.
  1480. * The bits in this mask correspond to the values in the
  1481. * htt_tx_preamble_type enum. For example, to allow the target
  1482. * to transmit the frame as either CCK or OFDM, this field would
  1483. * be set to
  1484. * (1 << htt_tx_preamble_type_ofdm) |
  1485. * (1 << htt_tx_preamble_type_cck)
  1486. */
  1487. preamble_type_mask: 4,
  1488. reserved1_31_29: 3; /* unused, set to 0x0 */
  1489. /* DWORD 2: tx chain mask, tx retries */
  1490. A_UINT32
  1491. /* chain_mask - specify which chains to transmit from */
  1492. chain_mask: 4,
  1493. /* retry_limit -
  1494. * Specify the maximum number of transmissions, including the
  1495. * initial transmission, to attempt before giving up if no ack
  1496. * is received.
  1497. * If the tx rate is specified, then all retries shall use the
  1498. * same rate as the initial transmission.
  1499. * If no tx rate is specified, the target can choose whether to
  1500. * retain the original rate during the retransmissions, or to
  1501. * fall back to a more robust rate.
  1502. */
  1503. retry_limit: 4,
  1504. /* bandwidth_mask -
  1505. * Specify what channel widths may be used for the transmission.
  1506. * A value of zero indicates "don't care" - the target may choose
  1507. * the transmission bandwidth.
  1508. * The bits within this mask correspond to the htt_tx_bandwidth
  1509. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1510. * The bandwidth_mask must be consistent with the preamble_type_mask
  1511. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1512. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1513. */
  1514. bandwidth_mask: 6,
  1515. reserved2_31_14: 18; /* unused, set to 0x0 */
  1516. /* DWORD 3: tx expiry time (TSF) LSBs */
  1517. A_UINT32 expire_tsf_lo;
  1518. /* DWORD 4: tx expiry time (TSF) MSBs */
  1519. A_UINT32 expire_tsf_hi;
  1520. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1521. } POSTPACK;
  1522. /* DWORD 0 */
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1543. /* DWORD 1 */
  1544. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1545. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1546. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1547. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1548. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1549. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1550. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1551. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1552. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1553. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1554. /* DWORD 2 */
  1555. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1556. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1557. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1558. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1559. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1560. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1561. /* DWORD 0 */
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1563. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1564. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1566. do { \
  1567. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1568. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1569. } while (0)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1576. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL( \
  1584. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1585. ((_var) |= ((_val) \
  1586. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL( \
  1594. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1595. ((_var) |= ((_val) \
  1596. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1597. } while (0)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1600. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1604. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1608. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1609. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1616. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1617. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1620. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1624. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1625. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1632. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1633. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1637. } while (0)
  1638. /* DWORD 1 */
  1639. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1641. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1642. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1643. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1644. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1645. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1646. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1647. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1648. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1651. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1658. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1659. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1666. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1667. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1674. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1675. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1678. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1679. } while (0)
  1680. /* DWORD 2 */
  1681. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1683. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1684. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1691. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1692. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1699. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1700. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1704. } while (0)
  1705. typedef enum {
  1706. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1707. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1708. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1709. } htt_11ax_ltf_subtype_t;
  1710. typedef enum {
  1711. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1712. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1713. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1714. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1715. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1716. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1717. } htt_tx_ext2_preamble_type_t;
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1722. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1730. /**
  1731. * @brief HTT tx MSDU extension descriptor v2
  1732. * @details
  1733. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1734. * is received as tcl_exit_base->host_meta_info in firmware.
  1735. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1736. * are already part of tcl_exit_base.
  1737. */
  1738. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1739. /* DWORD 0: flags */
  1740. A_UINT32
  1741. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1742. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1743. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1744. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1745. valid_retries : 1, /* if set, tx retries spec is valid */
  1746. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1747. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1748. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1749. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1750. valid_key_flags : 1, /* if set, key flags is valid */
  1751. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1752. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1753. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1754. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1755. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1756. 1 = ENCRYPT,
  1757. 2 ~ 3 - Reserved */
  1758. /* retry_limit -
  1759. * Specify the maximum number of transmissions, including the
  1760. * initial transmission, to attempt before giving up if no ack
  1761. * is received.
  1762. * If the tx rate is specified, then all retries shall use the
  1763. * same rate as the initial transmission.
  1764. * If no tx rate is specified, the target can choose whether to
  1765. * retain the original rate during the retransmissions, or to
  1766. * fall back to a more robust rate.
  1767. */
  1768. retry_limit : 4,
  1769. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1770. * Valid only for 11ax preamble types HE_SU
  1771. * and HE_EXT_SU
  1772. */
  1773. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1774. * Valid only for 11ax preamble types HE_SU
  1775. * and HE_EXT_SU
  1776. */
  1777. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1778. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1779. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1780. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1781. */
  1782. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1783. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1784. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1785. * Use cases:
  1786. * Any time firmware uses TQM-BYPASS for Data
  1787. * TID, firmware expect host to set this bit.
  1788. */
  1789. /* DWORD 1: tx power, tx rate */
  1790. A_UINT32
  1791. power : 8, /* unit of the power field is 0.5 dbm
  1792. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1793. * signed value ranging from -64dbm to 63.5 dbm
  1794. */
  1795. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1796. * Setting more than one MCS isn't currently
  1797. * supported by the target (but is supported
  1798. * in the interface in case in the future
  1799. * the target supports specifications of
  1800. * a limited set of MCS values.
  1801. */
  1802. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1803. * Setting more than one Nss isn't currently
  1804. * supported by the target (but is supported
  1805. * in the interface in case in the future
  1806. * the target supports specifications of
  1807. * a limited set of Nss values.
  1808. */
  1809. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1810. update_peer_cache : 1; /* When set these custom values will be
  1811. * used for all packets, until the next
  1812. * update via this ext header.
  1813. * This is to make sure not all packets
  1814. * need to include this header.
  1815. */
  1816. /* DWORD 2: tx chain mask, tx retries */
  1817. A_UINT32
  1818. /* chain_mask - specify which chains to transmit from */
  1819. chain_mask : 8,
  1820. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1821. * TODO: Update Enum values for key_flags
  1822. */
  1823. /*
  1824. * Channel frequency: This identifies the desired channel
  1825. * frequency (in MHz) for tx frames. This is used by FW to help
  1826. * determine when it is safe to transmit or drop frames for
  1827. * off-channel operation.
  1828. * The default value of zero indicates to FW that the corresponding
  1829. * VDEV's home channel (if there is one) is the desired channel
  1830. * frequency.
  1831. */
  1832. chanfreq : 16;
  1833. /* DWORD 3: tx expiry time (TSF) LSBs */
  1834. A_UINT32 expire_tsf_lo;
  1835. /* DWORD 4: tx expiry time (TSF) MSBs */
  1836. A_UINT32 expire_tsf_hi;
  1837. /* DWORD 5: flags to control routing / processing of the MSDU */
  1838. A_UINT32
  1839. /* learning_frame
  1840. * When this flag is set, this frame will be dropped by FW
  1841. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1842. */
  1843. learning_frame : 1,
  1844. /* send_as_standalone
  1845. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1846. * i.e. with no A-MSDU or A-MPDU aggregation.
  1847. * The scope is extended to other use-cases.
  1848. */
  1849. send_as_standalone : 1,
  1850. /* is_host_opaque_valid
  1851. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1852. * with valid information.
  1853. */
  1854. is_host_opaque_valid : 1,
  1855. traffic_end_indication: 1,
  1856. rsvd0 : 28;
  1857. /* DWORD 6 : Host opaque cookie for special frames */
  1858. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1859. rsvd1 : 16;
  1860. /*
  1861. * This structure can be expanded further up to 40 bytes
  1862. * by adding further DWORDs as needed.
  1863. */
  1864. } POSTPACK;
  1865. /* DWORD 0 */
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1892. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1893. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1894. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1895. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1896. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1897. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1898. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1899. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1900. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1901. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1902. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1903. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1904. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1905. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1906. /* DWORD 1 */
  1907. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1908. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1909. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1910. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1911. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1912. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1913. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1914. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1915. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1916. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1917. /* DWORD 2 */
  1918. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1919. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1920. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1921. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1922. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1923. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1924. /* DWORD 5 */
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1931. /* DWORD 6 */
  1932. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1933. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1934. /* DWORD 0 */
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL( \
  1965. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1966. ((_var) |= ((_val) \
  1967. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1968. } while (0)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1970. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1971. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1976. } while (0)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1978. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1979. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1984. } while (0)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1986. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1987. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL( \
  1991. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1992. ((_var) |= ((_val) \
  1993. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1994. } while (0)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2021. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2026. } while (0)
  2027. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2028. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2029. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2030. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2034. } while (0)
  2035. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2039. do { \
  2040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2041. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2042. } while (0)
  2043. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2066. } while (0)
  2067. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2074. } while (0)
  2075. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2076. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2077. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2078. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2082. } while (0)
  2083. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2084. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2085. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2086. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2090. } while (0)
  2091. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2092. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2093. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2094. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2098. } while (0)
  2099. /* DWORD 1 */
  2100. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2101. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2102. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2103. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2104. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2105. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2106. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2107. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2108. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2109. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2110. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2111. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2112. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2113. do { \
  2114. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2115. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2116. } while (0)
  2117. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2118. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2119. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2120. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2121. do { \
  2122. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2123. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2124. } while (0)
  2125. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2126. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2127. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2128. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2129. do { \
  2130. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2131. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2132. } while (0)
  2133. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2134. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2135. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2136. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2137. do { \
  2138. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2139. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2140. } while (0)
  2141. /* DWORD 2 */
  2142. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2143. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2144. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2145. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2146. do { \
  2147. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2148. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2149. } while (0)
  2150. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2151. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2152. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2153. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2157. } while (0)
  2158. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2159. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2160. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2161. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2165. } while (0)
  2166. /* DWORD 5 */
  2167. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2168. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2169. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2170. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2174. } while (0)
  2175. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2176. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2177. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2178. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2182. } while (0)
  2183. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2184. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2185. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2186. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2190. } while (0)
  2191. /* DWORD 6 */
  2192. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2193. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2194. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2195. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2196. do { \
  2197. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2198. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2199. } while (0)
  2200. typedef enum {
  2201. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2202. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2203. } htt_tcl_metadata_type;
  2204. /**
  2205. * @brief HTT TCL command number format
  2206. * @details
  2207. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2208. * available to firmware as tcl_exit_base->tcl_status_number.
  2209. * For regular / multicast packets host will send vdev and mac id and for
  2210. * NAWDS packets, host will send peer id.
  2211. * A_UINT32 is used to avoid endianness conversion problems.
  2212. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2213. */
  2214. typedef struct {
  2215. A_UINT32
  2216. type: 1, /* vdev_id based or peer_id based */
  2217. rsvd: 31;
  2218. } htt_tx_tcl_vdev_or_peer_t;
  2219. typedef struct {
  2220. A_UINT32
  2221. type: 1, /* vdev_id based or peer_id based */
  2222. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2223. vdev_id: 8,
  2224. pdev_id: 2,
  2225. host_inspected:1,
  2226. rsvd: 19;
  2227. } htt_tx_tcl_vdev_metadata;
  2228. typedef struct {
  2229. A_UINT32
  2230. type: 1, /* vdev_id based or peer_id based */
  2231. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2232. peer_id: 14,
  2233. rsvd: 16;
  2234. } htt_tx_tcl_peer_metadata;
  2235. PREPACK struct htt_tx_tcl_metadata {
  2236. union {
  2237. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2238. htt_tx_tcl_vdev_metadata vdev_meta;
  2239. htt_tx_tcl_peer_metadata peer_meta;
  2240. };
  2241. } POSTPACK;
  2242. /* DWORD 0 */
  2243. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2244. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2245. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2246. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2247. /* VDEV metadata */
  2248. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2249. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2250. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2251. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2252. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2253. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2254. /* PEER metadata */
  2255. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2256. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2257. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2258. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2259. HTT_TX_TCL_METADATA_TYPE_S)
  2260. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2264. } while (0)
  2265. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2266. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2267. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2268. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2272. } while (0)
  2273. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2274. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2275. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2276. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2280. } while (0)
  2281. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2282. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2283. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2284. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2288. } while (0)
  2289. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2290. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2291. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2292. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2295. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2296. } while (0)
  2297. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2298. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2299. HTT_TX_TCL_METADATA_PEER_ID_S)
  2300. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2301. do { \
  2302. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2303. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2304. } while (0)
  2305. /*------------------------------------------------------------------
  2306. * V2 Version of TCL Data Command
  2307. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2308. * MLO global_seq all flavours of TCL Data Cmd.
  2309. *-----------------------------------------------------------------*/
  2310. typedef enum {
  2311. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2312. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2313. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2314. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2315. } htt_tcl_metadata_type_v2;
  2316. /**
  2317. * @brief HTT TCL command number format
  2318. * @details
  2319. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2320. * available to firmware as tcl_exit_base->tcl_status_number.
  2321. * A_UINT32 is used to avoid endianness conversion problems.
  2322. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2323. */
  2324. typedef struct {
  2325. A_UINT32
  2326. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2327. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2328. vdev_id: 8,
  2329. pdev_id: 2,
  2330. host_inspected:1,
  2331. rsvd: 2,
  2332. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2333. } htt_tx_tcl_vdev_metadata_v2;
  2334. typedef struct {
  2335. A_UINT32
  2336. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2337. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2338. peer_id: 13,
  2339. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2340. } htt_tx_tcl_peer_metadata_v2;
  2341. typedef struct {
  2342. A_UINT32
  2343. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2344. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2345. svc_class_id: 8,
  2346. rsvd: 5,
  2347. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2348. } htt_tx_tcl_svc_class_id_metadata;
  2349. typedef struct {
  2350. A_UINT32
  2351. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2352. host_inspected: 1,
  2353. global_seq_no: 12,
  2354. rsvd: 1,
  2355. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2356. } htt_tx_tcl_global_seq_metadata;
  2357. PREPACK struct htt_tx_tcl_metadata_v2 {
  2358. union {
  2359. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2360. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2361. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2362. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2363. };
  2364. } POSTPACK;
  2365. /* DWORD 0 */
  2366. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2367. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2368. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2369. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2370. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2371. /* VDEV V2 metadata */
  2372. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2373. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2374. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2375. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2376. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2377. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2378. /* PEER V2 metadata */
  2379. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2380. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2381. /* SVC_CLASS_ID metadata */
  2382. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2383. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2384. /* Global Seq no metadata */
  2385. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2386. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2387. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2388. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2389. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2390. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2391. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2392. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2393. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2394. do { \
  2395. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2396. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2397. } while (0)
  2398. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2399. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2400. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2401. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2402. do { \
  2403. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2404. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2405. } while (0)
  2406. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2407. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2408. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2409. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2410. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2411. do { \
  2412. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2413. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2414. } while (0)
  2415. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2416. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2417. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2418. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2422. } while (0)
  2423. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2424. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2425. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2426. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2430. } while (0)
  2431. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2432. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2433. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2434. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2435. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2439. } while (0)
  2440. /*----- Get and Set V2 type field in Service Class fields ----*/
  2441. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2442. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2443. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2444. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2448. } while (0)
  2449. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2450. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2451. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2452. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2453. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2457. } while (0)
  2458. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2459. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2460. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2461. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2464. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2465. } while (0)
  2466. /*------------------------------------------------------------------
  2467. * End V2 Version of TCL Data Command
  2468. *-----------------------------------------------------------------*/
  2469. typedef enum {
  2470. HTT_TX_FW2WBM_TX_STATUS_OK,
  2471. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2472. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2473. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2474. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2475. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2476. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2477. HTT_TX_FW2WBM_TX_STATUS_MAX
  2478. } htt_tx_fw2wbm_tx_status_t;
  2479. typedef enum {
  2480. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2481. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2482. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2483. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2484. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2485. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2486. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2487. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2488. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2489. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2490. } htt_tx_fw2wbm_reinject_reason_t;
  2491. /**
  2492. * @brief HTT TX WBM Completion from firmware to host
  2493. * @details
  2494. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2495. * DWORD 3 and 4 for software based completions (Exception frames and
  2496. * TQM bypass frames)
  2497. * For software based completions, wbm_release_ring->release_source_module will
  2498. * be set to release_source_fw
  2499. */
  2500. PREPACK struct htt_tx_wbm_completion {
  2501. A_UINT32
  2502. sch_cmd_id: 24,
  2503. exception_frame: 1, /* If set, this packet was queued via exception path */
  2504. rsvd0_31_25: 7;
  2505. A_UINT32
  2506. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2507. * reception of an ACK or BA, this field indicates
  2508. * the RSSI of the received ACK or BA frame.
  2509. * When the frame is removed as result of a direct
  2510. * remove command from the SW, this field is set
  2511. * to 0x0 (which is never a valid value when real
  2512. * RSSI is available).
  2513. * Units: dB w.r.t noise floor
  2514. */
  2515. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2516. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2517. rsvd1_31_16: 16;
  2518. } POSTPACK;
  2519. /* DWORD 0 */
  2520. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2521. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2522. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2523. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2524. /* DWORD 1 */
  2525. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2526. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2527. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2528. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2529. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2530. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2531. /* DWORD 0 */
  2532. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2533. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2534. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2535. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2538. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2539. } while (0)
  2540. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2541. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2542. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2543. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2546. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2547. } while (0)
  2548. /* DWORD 1 */
  2549. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2550. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2551. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2552. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2555. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2556. } while (0)
  2557. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2558. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2559. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2560. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2561. do { \
  2562. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2563. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2564. } while (0)
  2565. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2566. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2567. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2568. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2569. do { \
  2570. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2571. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2572. } while (0)
  2573. /**
  2574. * @brief HTT TX WBM Completion from firmware to host
  2575. * @details
  2576. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2577. * (WBM) offload HW.
  2578. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2579. * For software based completions, release_source_module will
  2580. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2581. * struct wbm_release_ring and then switch to this after looking at
  2582. * release_source_module.
  2583. */
  2584. PREPACK struct htt_tx_wbm_completion_v2 {
  2585. A_UINT32
  2586. used_by_hw0; /* Refer to struct wbm_release_ring */
  2587. A_UINT32
  2588. used_by_hw1; /* Refer to struct wbm_release_ring */
  2589. A_UINT32
  2590. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2591. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2592. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2593. exception_frame: 1,
  2594. rsvd0: 12, /* For future use */
  2595. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2596. rsvd1: 1; /* For future use */
  2597. A_UINT32
  2598. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2599. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2600. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2601. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2602. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2603. */
  2604. A_UINT32
  2605. data1: 32;
  2606. A_UINT32
  2607. data2: 32;
  2608. A_UINT32
  2609. used_by_hw3; /* Refer to struct wbm_release_ring */
  2610. } POSTPACK;
  2611. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2612. /* DWORD 3 */
  2613. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2614. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2615. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2616. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2617. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2618. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2619. /* DWORD 3 */
  2620. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2621. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2622. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2623. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2626. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2627. } while (0)
  2628. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2629. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2630. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2631. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2634. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2635. } while (0)
  2636. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2637. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2638. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2639. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2642. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2643. } while (0)
  2644. /**
  2645. * @brief HTT TX WBM Completion from firmware to host (V3)
  2646. * @details
  2647. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2648. * (WBM) offload HW.
  2649. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2650. * For software based completions, release_source_module will
  2651. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2652. * struct wbm_release_ring and then switch to this after looking at
  2653. * release_source_module.
  2654. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2655. * by new generations of targets.
  2656. */
  2657. PREPACK struct htt_tx_wbm_completion_v3 {
  2658. A_UINT32
  2659. used_by_hw0; /* Refer to struct wbm_release_ring */
  2660. A_UINT32
  2661. used_by_hw1; /* Refer to struct wbm_release_ring */
  2662. A_UINT32
  2663. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2664. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2665. used_by_hw3: 15;
  2666. A_UINT32
  2667. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2668. exception_frame: 1,
  2669. rsvd0: 27; /* For future use */
  2670. A_UINT32
  2671. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2672. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2673. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2674. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2675. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2676. */
  2677. A_UINT32
  2678. data1: 32;
  2679. A_UINT32
  2680. data2: 32;
  2681. A_UINT32
  2682. rsvd1: 20,
  2683. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2684. } POSTPACK;
  2685. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2686. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2687. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2688. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2689. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2690. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2691. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2692. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2693. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2694. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2695. do { \
  2696. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2697. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2698. } while (0)
  2699. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2700. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2701. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2702. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2703. do { \
  2704. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2705. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2706. } while (0)
  2707. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2708. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2709. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2710. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2711. do { \
  2712. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2713. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2714. } while (0)
  2715. typedef enum {
  2716. TX_FRAME_TYPE_UNDEFINED = 0,
  2717. TX_FRAME_TYPE_EAPOL = 1,
  2718. } htt_tx_wbm_status_frame_type;
  2719. /**
  2720. * @brief HTT TX WBM transmit status from firmware to host
  2721. * @details
  2722. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2723. * (WBM) offload HW.
  2724. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2725. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2726. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2727. */
  2728. PREPACK struct htt_tx_wbm_transmit_status {
  2729. A_UINT32
  2730. sch_cmd_id: 24,
  2731. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2732. * reception of an ACK or BA, this field indicates
  2733. * the RSSI of the received ACK or BA frame.
  2734. * When the frame is removed as result of a direct
  2735. * remove command from the SW, this field is set
  2736. * to 0x0 (which is never a valid value when real
  2737. * RSSI is available).
  2738. * Units: dB w.r.t noise floor
  2739. */
  2740. A_UINT32
  2741. sw_peer_id: 16,
  2742. tid_num: 5,
  2743. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2744. * and tid_num fields contain valid data.
  2745. * If this "valid" flag is not set, the
  2746. * sw_peer_id and tid_num fields must be ignored.
  2747. */
  2748. mcast: 1,
  2749. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2750. * contains valid data.
  2751. */
  2752. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2753. reserved: 4;
  2754. A_UINT32
  2755. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2756. * packets in the wbm completion path
  2757. */
  2758. } POSTPACK;
  2759. /* DWORD 4 */
  2760. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2761. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2762. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2763. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2764. /* DWORD 5 */
  2765. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2766. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2767. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2768. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2769. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2770. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2771. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2772. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2774. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2775. /* DWORD 4 */
  2776. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2777. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2778. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2779. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2780. do { \
  2781. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2782. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2783. } while (0)
  2784. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2785. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2786. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2787. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2788. do { \
  2789. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2790. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2791. } while (0)
  2792. /* DWORD 5 */
  2793. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2794. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2795. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2796. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2800. } while (0)
  2801. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2802. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2803. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2804. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2807. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2808. } while (0)
  2809. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2810. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2811. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2812. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2815. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2816. } while (0)
  2817. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2818. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2819. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2820. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2823. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2824. } while (0)
  2825. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2826. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2827. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2828. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2831. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2832. } while (0)
  2833. /**
  2834. * @brief HTT TX WBM reinject status from firmware to host
  2835. * @details
  2836. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2837. * (WBM) offload HW.
  2838. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2839. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2840. */
  2841. PREPACK struct htt_tx_wbm_reinject_status {
  2842. A_UINT32
  2843. reserved0: 32;
  2844. A_UINT32
  2845. reserved1: 32;
  2846. A_UINT32
  2847. reserved2: 32;
  2848. } POSTPACK;
  2849. /**
  2850. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2851. * @details
  2852. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2853. * (WBM) offload HW.
  2854. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2855. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2856. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2857. * STA side.
  2858. */
  2859. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2860. A_UINT32
  2861. mec_sa_addr_31_0;
  2862. A_UINT32
  2863. mec_sa_addr_47_32: 16,
  2864. sa_ast_index: 16;
  2865. A_UINT32
  2866. vdev_id: 8,
  2867. reserved0: 24;
  2868. } POSTPACK;
  2869. /* DWORD 4 - mec_sa_addr_31_0 */
  2870. /* DWORD 5 */
  2871. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2872. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2873. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2874. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2875. /* DWORD 6 */
  2876. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2877. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2878. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2879. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2880. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2881. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2884. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2885. } while (0)
  2886. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2887. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2888. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2889. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2892. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2893. } while (0)
  2894. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2895. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2896. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2897. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2900. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2901. } while (0)
  2902. typedef enum {
  2903. TX_FLOW_PRIORITY_BE,
  2904. TX_FLOW_PRIORITY_HIGH,
  2905. TX_FLOW_PRIORITY_LOW,
  2906. } htt_tx_flow_priority_t;
  2907. typedef enum {
  2908. TX_FLOW_LATENCY_SENSITIVE,
  2909. TX_FLOW_LATENCY_INSENSITIVE,
  2910. } htt_tx_flow_latency_t;
  2911. typedef enum {
  2912. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2913. TX_FLOW_INTERACTIVE_TRAFFIC,
  2914. TX_FLOW_PERIODIC_TRAFFIC,
  2915. TX_FLOW_BURSTY_TRAFFIC,
  2916. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2917. } htt_tx_flow_traffic_pattern_t;
  2918. /**
  2919. * @brief HTT TX Flow search metadata format
  2920. * @details
  2921. * Host will set this metadata in flow table's flow search entry along with
  2922. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2923. * firmware and TQM ring if the flow search entry wins.
  2924. * This metadata is available to firmware in that first MSDU's
  2925. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2926. * to one of the available flows for specific tid and returns the tqm flow
  2927. * pointer as part of htt_tx_map_flow_info message.
  2928. */
  2929. PREPACK struct htt_tx_flow_metadata {
  2930. A_UINT32
  2931. rsvd0_1_0: 2,
  2932. tid: 4,
  2933. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2934. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2935. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2936. * Else choose final tid based on latency, priority.
  2937. */
  2938. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2939. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2940. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2941. } POSTPACK;
  2942. /* DWORD 0 */
  2943. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2944. #define HTT_TX_FLOW_METADATA_TID_S 2
  2945. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2946. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2947. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2948. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2949. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2950. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2951. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2952. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2953. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2954. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2955. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2956. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2957. /* DWORD 0 */
  2958. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2959. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2960. HTT_TX_FLOW_METADATA_TID_S)
  2961. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2964. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2965. } while (0)
  2966. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2967. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2968. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2969. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2972. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2973. } while (0)
  2974. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2975. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2976. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2977. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2980. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2981. } while (0)
  2982. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2983. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2984. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2985. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2988. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2989. } while (0)
  2990. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2991. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2992. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2993. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2996. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2997. } while (0)
  2998. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2999. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3000. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3001. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3004. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3005. } while (0)
  3006. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3007. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3008. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3009. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3012. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3013. } while (0)
  3014. /**
  3015. * @brief host -> target ADD WDS Entry
  3016. *
  3017. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3018. *
  3019. * @brief host -> target DELETE WDS Entry
  3020. *
  3021. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3022. *
  3023. * @details
  3024. * HTT wds entry from source port learning
  3025. * Host will learn wds entries from rx and send this message to firmware
  3026. * to enable firmware to configure/delete AST entries for wds clients.
  3027. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3028. * and when SA's entry is deleted, firmware removes this AST entry
  3029. *
  3030. * The message would appear as follows:
  3031. *
  3032. * |31 30|29 |17 16|15 8|7 0|
  3033. * |----------------+----------------+----------------+----------------|
  3034. * | rsvd0 |PDVID| vdev_id | msg_type |
  3035. * |-------------------------------------------------------------------|
  3036. * | sa_addr_31_0 |
  3037. * |-------------------------------------------------------------------|
  3038. * | | ta_peer_id | sa_addr_47_32 |
  3039. * |-------------------------------------------------------------------|
  3040. * Where PDVID = pdev_id
  3041. *
  3042. * The message is interpreted as follows:
  3043. *
  3044. * dword0 - b'0:7 - msg_type: This will be set to
  3045. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3046. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3047. *
  3048. * dword0 - b'8:15 - vdev_id
  3049. *
  3050. * dword0 - b'16:17 - pdev_id
  3051. *
  3052. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3053. *
  3054. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3055. *
  3056. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3057. *
  3058. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3059. */
  3060. PREPACK struct htt_wds_entry {
  3061. A_UINT32
  3062. msg_type: 8,
  3063. vdev_id: 8,
  3064. pdev_id: 2,
  3065. rsvd0: 14;
  3066. A_UINT32 sa_addr_31_0;
  3067. A_UINT32
  3068. sa_addr_47_32: 16,
  3069. ta_peer_id: 14,
  3070. rsvd2: 2;
  3071. } POSTPACK;
  3072. /* DWORD 0 */
  3073. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3074. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3075. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3076. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3077. /* DWORD 2 */
  3078. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3079. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3080. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3081. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3082. /* DWORD 0 */
  3083. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3084. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3085. HTT_WDS_ENTRY_VDEV_ID_S)
  3086. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3087. do { \
  3088. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3089. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3090. } while (0)
  3091. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3092. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3093. HTT_WDS_ENTRY_PDEV_ID_S)
  3094. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3095. do { \
  3096. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3097. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3098. } while (0)
  3099. /* DWORD 2 */
  3100. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3101. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3102. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3103. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3106. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3107. } while (0)
  3108. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3109. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3110. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3111. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3112. do { \
  3113. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3114. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3115. } while (0)
  3116. /**
  3117. * @brief MAC DMA rx ring setup specification
  3118. *
  3119. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3120. *
  3121. * @details
  3122. * To allow for dynamic rx ring reconfiguration and to avoid race
  3123. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3124. * it uses. Instead, it sends this message to the target, indicating how
  3125. * the rx ring used by the host should be set up and maintained.
  3126. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3127. * specifications.
  3128. *
  3129. * |31 16|15 8|7 0|
  3130. * |---------------------------------------------------------------|
  3131. * header: | reserved | num rings | msg type |
  3132. * |---------------------------------------------------------------|
  3133. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3134. #if HTT_PADDR64
  3135. * | FW_IDX shadow register physical address (bits 63:32) |
  3136. #endif
  3137. * |---------------------------------------------------------------|
  3138. * | rx ring base physical address (bits 31:0) |
  3139. #if HTT_PADDR64
  3140. * | rx ring base physical address (bits 63:32) |
  3141. #endif
  3142. * |---------------------------------------------------------------|
  3143. * | rx ring buffer size | rx ring length |
  3144. * |---------------------------------------------------------------|
  3145. * | FW_IDX initial value | enabled flags |
  3146. * |---------------------------------------------------------------|
  3147. * | MSDU payload offset | 802.11 header offset |
  3148. * |---------------------------------------------------------------|
  3149. * | PPDU end offset | PPDU start offset |
  3150. * |---------------------------------------------------------------|
  3151. * | MPDU end offset | MPDU start offset |
  3152. * |---------------------------------------------------------------|
  3153. * | MSDU end offset | MSDU start offset |
  3154. * |---------------------------------------------------------------|
  3155. * | frag info offset | rx attention offset |
  3156. * |---------------------------------------------------------------|
  3157. * payload 2, if present, has the same format as payload 1
  3158. * Header fields:
  3159. * - MSG_TYPE
  3160. * Bits 7:0
  3161. * Purpose: identifies this as an rx ring configuration message
  3162. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3163. * - NUM_RINGS
  3164. * Bits 15:8
  3165. * Purpose: indicates whether the host is setting up one rx ring or two
  3166. * Value: 1 or 2
  3167. * Payload:
  3168. * for systems using 64-bit format for bus addresses:
  3169. * - IDX_SHADOW_REG_PADDR_LO
  3170. * Bits 31:0
  3171. * Value: lower 4 bytes of physical address of the host's
  3172. * FW_IDX shadow register
  3173. * - IDX_SHADOW_REG_PADDR_HI
  3174. * Bits 31:0
  3175. * Value: upper 4 bytes of physical address of the host's
  3176. * FW_IDX shadow register
  3177. * - RING_BASE_PADDR_LO
  3178. * Bits 31:0
  3179. * Value: lower 4 bytes of physical address of the host's rx ring
  3180. * - RING_BASE_PADDR_HI
  3181. * Bits 31:0
  3182. * Value: uppper 4 bytes of physical address of the host's rx ring
  3183. * for systems using 32-bit format for bus addresses:
  3184. * - IDX_SHADOW_REG_PADDR
  3185. * Bits 31:0
  3186. * Value: physical address of the host's FW_IDX shadow register
  3187. * - RING_BASE_PADDR
  3188. * Bits 31:0
  3189. * Value: physical address of the host's rx ring
  3190. * - RING_LEN
  3191. * Bits 15:0
  3192. * Value: number of elements in the rx ring
  3193. * - RING_BUF_SZ
  3194. * Bits 31:16
  3195. * Value: size of the buffers referenced by the rx ring, in byte units
  3196. * - ENABLED_FLAGS
  3197. * Bits 15:0
  3198. * Value: 1-bit flags to show whether different rx fields are enabled
  3199. * bit 0: 802.11 header enabled (1) or disabled (0)
  3200. * bit 1: MSDU payload enabled (1) or disabled (0)
  3201. * bit 2: PPDU start enabled (1) or disabled (0)
  3202. * bit 3: PPDU end enabled (1) or disabled (0)
  3203. * bit 4: MPDU start enabled (1) or disabled (0)
  3204. * bit 5: MPDU end enabled (1) or disabled (0)
  3205. * bit 6: MSDU start enabled (1) or disabled (0)
  3206. * bit 7: MSDU end enabled (1) or disabled (0)
  3207. * bit 8: rx attention enabled (1) or disabled (0)
  3208. * bit 9: frag info enabled (1) or disabled (0)
  3209. * bit 10: unicast rx enabled (1) or disabled (0)
  3210. * bit 11: multicast rx enabled (1) or disabled (0)
  3211. * bit 12: ctrl rx enabled (1) or disabled (0)
  3212. * bit 13: mgmt rx enabled (1) or disabled (0)
  3213. * bit 14: null rx enabled (1) or disabled (0)
  3214. * bit 15: phy data rx enabled (1) or disabled (0)
  3215. * - IDX_INIT_VAL
  3216. * Bits 31:16
  3217. * Purpose: Specify the initial value for the FW_IDX.
  3218. * Value: the number of buffers initially present in the host's rx ring
  3219. * - OFFSET_802_11_HDR
  3220. * Bits 15:0
  3221. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3222. * - OFFSET_MSDU_PAYLOAD
  3223. * Bits 31:16
  3224. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3225. * - OFFSET_PPDU_START
  3226. * Bits 15:0
  3227. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3228. * - OFFSET_PPDU_END
  3229. * Bits 31:16
  3230. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3231. * - OFFSET_MPDU_START
  3232. * Bits 15:0
  3233. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3234. * - OFFSET_MPDU_END
  3235. * Bits 31:16
  3236. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3237. * - OFFSET_MSDU_START
  3238. * Bits 15:0
  3239. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3240. * - OFFSET_MSDU_END
  3241. * Bits 31:16
  3242. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3243. * - OFFSET_RX_ATTN
  3244. * Bits 15:0
  3245. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3246. * - OFFSET_FRAG_INFO
  3247. * Bits 31:16
  3248. * Value: offset in QUAD-bytes of frag info table
  3249. */
  3250. /* header fields */
  3251. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3252. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3253. /* payload fields */
  3254. /* for systems using a 64-bit format for bus addresses */
  3255. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3256. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3257. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3258. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3259. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3260. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3261. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3262. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3263. /* for systems using a 32-bit format for bus addresses */
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3265. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3266. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3267. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3268. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3269. #define HTT_RX_RING_CFG_LEN_S 0
  3270. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3271. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3272. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3273. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3275. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3276. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3277. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3278. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3279. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3280. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3281. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3282. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3283. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3284. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3285. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3286. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3287. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3288. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3289. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3290. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3291. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3292. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3293. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3294. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3295. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3296. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3297. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3298. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3299. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3300. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3301. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3302. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3303. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3304. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3305. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3306. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3307. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3309. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3310. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3311. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3312. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3313. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3314. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3315. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3316. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3317. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3318. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3319. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3320. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3321. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3322. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3323. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3324. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3325. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3326. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3327. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3328. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3329. #if HTT_PADDR64
  3330. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3331. #else
  3332. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3333. #endif
  3334. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3335. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3336. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3337. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3338. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3339. do { \
  3340. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3341. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3342. } while (0)
  3343. /* degenerate case for 32-bit fields */
  3344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3345. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3346. ((_var) = (_val))
  3347. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3348. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3349. ((_var) = (_val))
  3350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3351. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3352. ((_var) = (_val))
  3353. /* degenerate case for 32-bit fields */
  3354. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3355. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3356. ((_var) = (_val))
  3357. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3358. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3359. ((_var) = (_val))
  3360. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3361. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3362. ((_var) = (_val))
  3363. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3365. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3368. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3369. } while (0)
  3370. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3372. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3376. } while (0)
  3377. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3378. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3379. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3380. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3383. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3384. } while (0)
  3385. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3386. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3387. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3388. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3391. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3392. } while (0)
  3393. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3394. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3395. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3396. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3399. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3400. } while (0)
  3401. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3402. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3403. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3404. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3407. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3408. } while (0)
  3409. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3410. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3411. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3412. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3415. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3416. } while (0)
  3417. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3418. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3419. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3420. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3421. do { \
  3422. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3423. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3424. } while (0)
  3425. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3426. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3427. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3428. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3429. do { \
  3430. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3431. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3432. } while (0)
  3433. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3434. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3435. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3436. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3439. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3440. } while (0)
  3441. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3442. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3443. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3444. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3447. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3448. } while (0)
  3449. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3450. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3451. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3452. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3455. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3456. } while (0)
  3457. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3458. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3459. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3460. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3463. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3464. } while (0)
  3465. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3466. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3467. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3468. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3471. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3472. } while (0)
  3473. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3474. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3475. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3476. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3479. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3480. } while (0)
  3481. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3483. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3484. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3487. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3488. } while (0)
  3489. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3490. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3491. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3492. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3496. } while (0)
  3497. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3498. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3499. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3500. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3503. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3504. } while (0)
  3505. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3506. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3507. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3508. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3511. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3512. } while (0)
  3513. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3514. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3515. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3516. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3519. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3520. } while (0)
  3521. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3522. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3523. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3524. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3527. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3528. } while (0)
  3529. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3530. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3531. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3532. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3535. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3536. } while (0)
  3537. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3538. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3539. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3540. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3543. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3544. } while (0)
  3545. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3546. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3547. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3548. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3551. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3552. } while (0)
  3553. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3554. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3555. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3556. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3559. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3560. } while (0)
  3561. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3562. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3563. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3564. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3567. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3568. } while (0)
  3569. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3570. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3571. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3572. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3575. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3576. } while (0)
  3577. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3578. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3579. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3580. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3583. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3584. } while (0)
  3585. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3586. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3587. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3588. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3591. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3592. } while (0)
  3593. /**
  3594. * @brief host -> target FW statistics retrieve
  3595. *
  3596. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3597. *
  3598. * @details
  3599. * The following field definitions describe the format of the HTT host
  3600. * to target FW stats retrieve message. The message specifies the type of
  3601. * stats host wants to retrieve.
  3602. *
  3603. * |31 24|23 16|15 8|7 0|
  3604. * |-----------------------------------------------------------|
  3605. * | stats types request bitmask | msg type |
  3606. * |-----------------------------------------------------------|
  3607. * | stats types reset bitmask | reserved |
  3608. * |-----------------------------------------------------------|
  3609. * | stats type | config value |
  3610. * |-----------------------------------------------------------|
  3611. * | cookie LSBs |
  3612. * |-----------------------------------------------------------|
  3613. * | cookie MSBs |
  3614. * |-----------------------------------------------------------|
  3615. * Header fields:
  3616. * - MSG_TYPE
  3617. * Bits 7:0
  3618. * Purpose: identifies this is a stats upload request message
  3619. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3620. * - UPLOAD_TYPES
  3621. * Bits 31:8
  3622. * Purpose: identifies which types of FW statistics to upload
  3623. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3624. * - RESET_TYPES
  3625. * Bits 31:8
  3626. * Purpose: identifies which types of FW statistics to reset
  3627. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3628. * - CFG_VAL
  3629. * Bits 23:0
  3630. * Purpose: give an opaque configuration value to the specified stats type
  3631. * Value: stats-type specific configuration value
  3632. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3633. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3634. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3635. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3636. * - CFG_STAT_TYPE
  3637. * Bits 31:24
  3638. * Purpose: specify which stats type (if any) the config value applies to
  3639. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3640. * a valid configuration specification
  3641. * - COOKIE_LSBS
  3642. * Bits 31:0
  3643. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3644. * message with its preceding host->target stats request message.
  3645. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3646. * - COOKIE_MSBS
  3647. * Bits 31:0
  3648. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3649. * message with its preceding host->target stats request message.
  3650. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3651. */
  3652. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3653. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3654. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3655. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3656. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3657. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3658. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3659. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3660. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3661. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3662. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3663. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3664. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3665. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3668. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3669. } while (0)
  3670. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3671. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3672. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3673. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3676. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3677. } while (0)
  3678. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3679. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3680. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3681. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3684. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3685. } while (0)
  3686. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3687. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3688. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3689. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3692. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3693. } while (0)
  3694. /**
  3695. * @brief host -> target HTT out-of-band sync request
  3696. *
  3697. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3698. *
  3699. * @details
  3700. * The HTT SYNC tells the target to suspend processing of subsequent
  3701. * HTT host-to-target messages until some other target agent locally
  3702. * informs the target HTT FW that the current sync counter is equal to
  3703. * or greater than (in a modulo sense) the sync counter specified in
  3704. * the SYNC message.
  3705. * This allows other host-target components to synchronize their operation
  3706. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3707. * security key has been downloaded to and activated by the target.
  3708. * In the absence of any explicit synchronization counter value
  3709. * specification, the target HTT FW will use zero as the default current
  3710. * sync value.
  3711. *
  3712. * |31 24|23 16|15 8|7 0|
  3713. * |-----------------------------------------------------------|
  3714. * | reserved | sync count | msg type |
  3715. * |-----------------------------------------------------------|
  3716. * Header fields:
  3717. * - MSG_TYPE
  3718. * Bits 7:0
  3719. * Purpose: identifies this as a sync message
  3720. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3721. * - SYNC_COUNT
  3722. * Bits 15:8
  3723. * Purpose: specifies what sync value the HTT FW will wait for from
  3724. * an out-of-band specification to resume its operation
  3725. * Value: in-band sync counter value to compare against the out-of-band
  3726. * counter spec.
  3727. * The HTT target FW will suspend its host->target message processing
  3728. * as long as
  3729. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3730. */
  3731. #define HTT_H2T_SYNC_MSG_SZ 4
  3732. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3733. #define HTT_H2T_SYNC_COUNT_S 8
  3734. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3735. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3736. HTT_H2T_SYNC_COUNT_S)
  3737. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3738. do { \
  3739. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3740. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3741. } while (0)
  3742. /**
  3743. * @brief host -> target HTT aggregation configuration
  3744. *
  3745. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3746. */
  3747. #define HTT_AGGR_CFG_MSG_SZ 4
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3749. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3750. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3751. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3752. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3753. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3754. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3755. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3756. do { \
  3757. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3758. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3759. } while (0)
  3760. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3761. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3762. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3763. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3764. do { \
  3765. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3766. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3767. } while (0)
  3768. /**
  3769. * @brief host -> target HTT configure max amsdu info per vdev
  3770. *
  3771. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3772. *
  3773. * @details
  3774. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3775. *
  3776. * |31 21|20 16|15 8|7 0|
  3777. * |-----------------------------------------------------------|
  3778. * | reserved | vdev id | max amsdu | msg type |
  3779. * |-----------------------------------------------------------|
  3780. * Header fields:
  3781. * - MSG_TYPE
  3782. * Bits 7:0
  3783. * Purpose: identifies this as a aggr cfg ex message
  3784. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3785. * - MAX_NUM_AMSDU_SUBFRM
  3786. * Bits 15:8
  3787. * Purpose: max MSDUs per A-MSDU
  3788. * - VDEV_ID
  3789. * Bits 20:16
  3790. * Purpose: ID of the vdev to which this limit is applied
  3791. */
  3792. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3793. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3794. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3795. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3796. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3797. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3798. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3799. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3800. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3803. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3804. } while (0)
  3805. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3806. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3807. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3808. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3809. do { \
  3810. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3811. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3812. } while (0)
  3813. /**
  3814. * @brief HTT WDI_IPA Config Message
  3815. *
  3816. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3817. *
  3818. * @details
  3819. * The HTT WDI_IPA config message is created/sent by host at driver
  3820. * init time. It contains information about data structures used on
  3821. * WDI_IPA TX and RX path.
  3822. * TX CE ring is used for pushing packet metadata from IPA uC
  3823. * to WLAN FW
  3824. * TX Completion ring is used for generating TX completions from
  3825. * WLAN FW to IPA uC
  3826. * RX Indication ring is used for indicating RX packets from FW
  3827. * to IPA uC
  3828. * RX Ring2 is used as either completion ring or as second
  3829. * indication ring. when Ring2 is used as completion ring, IPA uC
  3830. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3831. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3832. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3833. * indicated in RX Indication ring. Please see WDI_IPA specification
  3834. * for more details.
  3835. * |31 24|23 16|15 8|7 0|
  3836. * |----------------+----------------+----------------+----------------|
  3837. * | tx pkt pool size | Rsvd | msg_type |
  3838. * |-------------------------------------------------------------------|
  3839. * | tx comp ring base (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | tx comp ring base (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. * | tx comp ring size |
  3845. * |-------------------------------------------------------------------|
  3846. * | tx comp WR_IDX physical address (bits 31:0) |
  3847. #if HTT_PADDR64
  3848. * | tx comp WR_IDX physical address (bits 63:32) |
  3849. #endif
  3850. * |-------------------------------------------------------------------|
  3851. * | tx CE WR_IDX physical address (bits 31:0) |
  3852. #if HTT_PADDR64
  3853. * | tx CE WR_IDX physical address (bits 63:32) |
  3854. #endif
  3855. * |-------------------------------------------------------------------|
  3856. * | rx indication ring base (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | rx indication ring base (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. * | rx indication ring size |
  3862. * |-------------------------------------------------------------------|
  3863. * | rx ind RD_IDX physical address (bits 31:0) |
  3864. #if HTT_PADDR64
  3865. * | rx ind RD_IDX physical address (bits 63:32) |
  3866. #endif
  3867. * |-------------------------------------------------------------------|
  3868. * | rx ind WR_IDX physical address (bits 31:0) |
  3869. #if HTT_PADDR64
  3870. * | rx ind WR_IDX physical address (bits 63:32) |
  3871. #endif
  3872. * |-------------------------------------------------------------------|
  3873. * |-------------------------------------------------------------------|
  3874. * | rx ring2 base (bits 31:0) |
  3875. #if HTT_PADDR64
  3876. * | rx ring2 base (bits 63:32) |
  3877. #endif
  3878. * |-------------------------------------------------------------------|
  3879. * | rx ring2 size |
  3880. * |-------------------------------------------------------------------|
  3881. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3882. #if HTT_PADDR64
  3883. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3884. #endif
  3885. * |-------------------------------------------------------------------|
  3886. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3887. #if HTT_PADDR64
  3888. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3889. #endif
  3890. * |-------------------------------------------------------------------|
  3891. *
  3892. * Header fields:
  3893. * Header fields:
  3894. * - MSG_TYPE
  3895. * Bits 7:0
  3896. * Purpose: Identifies this as WDI_IPA config message
  3897. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3898. * - TX_PKT_POOL_SIZE
  3899. * Bits 15:0
  3900. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3901. * WDI_IPA TX path
  3902. * For systems using 32-bit format for bus addresses:
  3903. * - TX_COMP_RING_BASE_ADDR
  3904. * Bits 31:0
  3905. * Purpose: TX Completion Ring base address in DDR
  3906. * - TX_COMP_RING_SIZE
  3907. * Bits 31:0
  3908. * Purpose: TX Completion Ring size (must be power of 2)
  3909. * - TX_COMP_WR_IDX_ADDR
  3910. * Bits 31:0
  3911. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3912. * updates the Write Index for WDI_IPA TX completion ring
  3913. * - TX_CE_WR_IDX_ADDR
  3914. * Bits 31:0
  3915. * Purpose: DDR address where IPA uC
  3916. * updates the WR Index for TX CE ring
  3917. * (needed for fusion platforms)
  3918. * - RX_IND_RING_BASE_ADDR
  3919. * Bits 31:0
  3920. * Purpose: RX Indication Ring base address in DDR
  3921. * - RX_IND_RING_SIZE
  3922. * Bits 31:0
  3923. * Purpose: RX Indication Ring size
  3924. * - RX_IND_RD_IDX_ADDR
  3925. * Bits 31:0
  3926. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3927. * RX indication ring
  3928. * - RX_IND_WR_IDX_ADDR
  3929. * Bits 31:0
  3930. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3931. * updates the Write Index for WDI_IPA RX indication ring
  3932. * - RX_RING2_BASE_ADDR
  3933. * Bits 31:0
  3934. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3935. * - RX_RING2_SIZE
  3936. * Bits 31:0
  3937. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3938. * - RX_RING2_RD_IDX_ADDR
  3939. * Bits 31:0
  3940. * Purpose: If Second RX ring is Indication ring, DDR address where
  3941. * IPA uC updates the Read Index for Ring2.
  3942. * If Second RX ring is completion ring, this is NOT used
  3943. * - RX_RING2_WR_IDX_ADDR
  3944. * Bits 31:0
  3945. * Purpose: If Second RX ring is Indication ring, DDR address where
  3946. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3947. * If second RX ring is completion ring, DDR address where
  3948. * IPA uC updates the Write Index for Ring 2.
  3949. * For systems using 64-bit format for bus addresses:
  3950. * - TX_COMP_RING_BASE_ADDR_LO
  3951. * Bits 31:0
  3952. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3953. * - TX_COMP_RING_BASE_ADDR_HI
  3954. * Bits 31:0
  3955. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3956. * - TX_COMP_RING_SIZE
  3957. * Bits 31:0
  3958. * Purpose: TX Completion Ring size (must be power of 2)
  3959. * - TX_COMP_WR_IDX_ADDR_LO
  3960. * Bits 31:0
  3961. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3962. * Lower 4 bytes of DDR address where WIFI FW
  3963. * updates the Write Index for WDI_IPA TX completion ring
  3964. * - TX_COMP_WR_IDX_ADDR_HI
  3965. * Bits 31:0
  3966. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3967. * Higher 4 bytes of DDR address where WIFI FW
  3968. * updates the Write Index for WDI_IPA TX completion ring
  3969. * - TX_CE_WR_IDX_ADDR_LO
  3970. * Bits 31:0
  3971. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3972. * updates the WR Index for TX CE ring
  3973. * (needed for fusion platforms)
  3974. * - TX_CE_WR_IDX_ADDR_HI
  3975. * Bits 31:0
  3976. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3977. * updates the WR Index for TX CE ring
  3978. * (needed for fusion platforms)
  3979. * - RX_IND_RING_BASE_ADDR_LO
  3980. * Bits 31:0
  3981. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3982. * - RX_IND_RING_BASE_ADDR_HI
  3983. * Bits 31:0
  3984. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3985. * - RX_IND_RING_SIZE
  3986. * Bits 31:0
  3987. * Purpose: RX Indication Ring size
  3988. * - RX_IND_RD_IDX_ADDR_LO
  3989. * Bits 31:0
  3990. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3991. * for WDI_IPA RX indication ring
  3992. * - RX_IND_RD_IDX_ADDR_HI
  3993. * Bits 31:0
  3994. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3995. * for WDI_IPA RX indication ring
  3996. * - RX_IND_WR_IDX_ADDR_LO
  3997. * Bits 31:0
  3998. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3999. * Lower 4 bytes of DDR address where WIFI FW
  4000. * updates the Write Index for WDI_IPA RX indication ring
  4001. * - RX_IND_WR_IDX_ADDR_HI
  4002. * Bits 31:0
  4003. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4004. * Higher 4 bytes of DDR address where WIFI FW
  4005. * updates the Write Index for WDI_IPA RX indication ring
  4006. * - RX_RING2_BASE_ADDR_LO
  4007. * Bits 31:0
  4008. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4009. * - RX_RING2_BASE_ADDR_HI
  4010. * Bits 31:0
  4011. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4012. * - RX_RING2_SIZE
  4013. * Bits 31:0
  4014. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4015. * - RX_RING2_RD_IDX_ADDR_LO
  4016. * Bits 31:0
  4017. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4018. * DDR address where IPA uC updates the Read Index for Ring2.
  4019. * If Second RX ring is completion ring, this is NOT used
  4020. * - RX_RING2_RD_IDX_ADDR_HI
  4021. * Bits 31:0
  4022. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4023. * DDR address where IPA uC updates the Read Index for Ring2.
  4024. * If Second RX ring is completion ring, this is NOT used
  4025. * - RX_RING2_WR_IDX_ADDR_LO
  4026. * Bits 31:0
  4027. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4028. * DDR address where WIFI FW updates the Write Index
  4029. * for WDI_IPA RX ring2
  4030. * If second RX ring is completion ring, lower 4 bytes of
  4031. * DDR address where IPA uC updates the Write Index for Ring 2.
  4032. * - RX_RING2_WR_IDX_ADDR_HI
  4033. * Bits 31:0
  4034. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4035. * DDR address where WIFI FW updates the Write Index
  4036. * for WDI_IPA RX ring2
  4037. * If second RX ring is completion ring, higher 4 bytes of
  4038. * DDR address where IPA uC updates the Write Index for Ring 2.
  4039. */
  4040. #if HTT_PADDR64
  4041. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4042. #else
  4043. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4044. #endif
  4045. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4046. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4063. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4065. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4107. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4108. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4109. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4112. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4113. } while (0)
  4114. /* for systems using 32-bit format for bus addr */
  4115. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4116. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4117. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4120. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4121. } while (0)
  4122. /* for systems using 64-bit format for bus addr */
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4129. } while (0)
  4130. /* for systems using 64-bit format for bus addr */
  4131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4137. } while (0)
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4139. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4143. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4144. } while (0)
  4145. /* for systems using 32-bit format for bus addr */
  4146. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4147. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4148. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4151. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4152. } while (0)
  4153. /* for systems using 64-bit format for bus addr */
  4154. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4155. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4156. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4159. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4160. } while (0)
  4161. /* for systems using 64-bit format for bus addr */
  4162. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4163. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4164. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4167. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4168. } while (0)
  4169. /* for systems using 32-bit format for bus addr */
  4170. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4172. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4176. } while (0)
  4177. /* for systems using 64-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4180. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4184. } while (0)
  4185. /* for systems using 64-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4188. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4192. } while (0)
  4193. /* for systems using 32-bit format for bus addr */
  4194. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4195. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4196. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4199. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4200. } while (0)
  4201. /* for systems using 64-bit format for bus addr */
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4208. } while (0)
  4209. /* for systems using 64-bit format for bus addr */
  4210. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4216. } while (0)
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4218. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4223. } while (0)
  4224. /* for systems using 32-bit format for bus addr */
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4226. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4231. } while (0)
  4232. /* for systems using 64-bit format for bus addr */
  4233. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4234. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4235. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4238. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4239. } while (0)
  4240. /* for systems using 64-bit format for bus addr */
  4241. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4242. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4243. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4246. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4247. } while (0)
  4248. /* for systems using 32-bit format for bus addr */
  4249. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4251. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4255. } while (0)
  4256. /* for systems using 64-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4259. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4263. } while (0)
  4264. /* for systems using 64-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4267. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4271. } while (0)
  4272. /* for systems using 32-bit format for bus addr */
  4273. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4274. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4278. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4279. } while (0)
  4280. /* for systems using 64-bit format for bus addr */
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4287. } while (0)
  4288. /* for systems using 64-bit format for bus addr */
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4295. } while (0)
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4297. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4301. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4302. } while (0)
  4303. /* for systems using 32-bit format for bus addr */
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4305. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4309. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4310. } while (0)
  4311. /* for systems using 64-bit format for bus addr */
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4313. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4317. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4318. } while (0)
  4319. /* for systems using 64-bit format for bus addr */
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4321. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4325. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4326. } while (0)
  4327. /* for systems using 32-bit format for bus addr */
  4328. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4329. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4331. do { \
  4332. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4333. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4334. } while (0)
  4335. /* for systems using 64-bit format for bus addr */
  4336. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4337. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4341. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4342. } while (0)
  4343. /* for systems using 64-bit format for bus addr */
  4344. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4345. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4346. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4349. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4350. } while (0)
  4351. /*
  4352. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4353. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4354. * addresses are stored in a XXX-bit field.
  4355. * This macro is used to define both htt_wdi_ipa_config32_t and
  4356. * htt_wdi_ipa_config64_t structs.
  4357. */
  4358. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4359. _paddr__tx_comp_ring_base_addr_, \
  4360. _paddr__tx_comp_wr_idx_addr_, \
  4361. _paddr__tx_ce_wr_idx_addr_, \
  4362. _paddr__rx_ind_ring_base_addr_, \
  4363. _paddr__rx_ind_rd_idx_addr_, \
  4364. _paddr__rx_ind_wr_idx_addr_, \
  4365. _paddr__rx_ring2_base_addr_,\
  4366. _paddr__rx_ring2_rd_idx_addr_,\
  4367. _paddr__rx_ring2_wr_idx_addr_) \
  4368. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4369. { \
  4370. /* DWORD 0: flags and meta-data */ \
  4371. A_UINT32 \
  4372. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4373. reserved: 8, \
  4374. tx_pkt_pool_size: 16;\
  4375. /* DWORD 1 */\
  4376. _paddr__tx_comp_ring_base_addr_;\
  4377. /* DWORD 2 (or 3)*/\
  4378. A_UINT32 tx_comp_ring_size;\
  4379. /* DWORD 3 (or 4)*/\
  4380. _paddr__tx_comp_wr_idx_addr_;\
  4381. /* DWORD 4 (or 6)*/\
  4382. _paddr__tx_ce_wr_idx_addr_;\
  4383. /* DWORD 5 (or 8)*/\
  4384. _paddr__rx_ind_ring_base_addr_;\
  4385. /* DWORD 6 (or 10)*/\
  4386. A_UINT32 rx_ind_ring_size;\
  4387. /* DWORD 7 (or 11)*/\
  4388. _paddr__rx_ind_rd_idx_addr_;\
  4389. /* DWORD 8 (or 13)*/\
  4390. _paddr__rx_ind_wr_idx_addr_;\
  4391. /* DWORD 9 (or 15)*/\
  4392. _paddr__rx_ring2_base_addr_;\
  4393. /* DWORD 10 (or 17) */\
  4394. A_UINT32 rx_ring2_size;\
  4395. /* DWORD 11 (or 18) */\
  4396. _paddr__rx_ring2_rd_idx_addr_;\
  4397. /* DWORD 12 (or 20) */\
  4398. _paddr__rx_ring2_wr_idx_addr_;\
  4399. } POSTPACK
  4400. /* define a htt_wdi_ipa_config32_t type */
  4401. 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));
  4402. /* define a htt_wdi_ipa_config64_t type */
  4403. 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));
  4404. #if HTT_PADDR64
  4405. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4406. #else
  4407. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4408. #endif
  4409. enum htt_wdi_ipa_op_code {
  4410. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4411. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4412. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4413. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4414. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4415. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4416. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4417. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4418. /* keep this last */
  4419. HTT_WDI_IPA_OPCODE_MAX
  4420. };
  4421. /**
  4422. * @brief HTT WDI_IPA Operation Request Message
  4423. *
  4424. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4425. *
  4426. * @details
  4427. * HTT WDI_IPA Operation Request message is sent by host
  4428. * to either suspend or resume WDI_IPA TX or RX path.
  4429. * |31 24|23 16|15 8|7 0|
  4430. * |----------------+----------------+----------------+----------------|
  4431. * | op_code | Rsvd | msg_type |
  4432. * |-------------------------------------------------------------------|
  4433. *
  4434. * Header fields:
  4435. * - MSG_TYPE
  4436. * Bits 7:0
  4437. * Purpose: Identifies this as WDI_IPA Operation Request message
  4438. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4439. * - OP_CODE
  4440. * Bits 31:16
  4441. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4442. * value: = enum htt_wdi_ipa_op_code
  4443. */
  4444. PREPACK struct htt_wdi_ipa_op_request_t
  4445. {
  4446. /* DWORD 0: flags and meta-data */
  4447. A_UINT32
  4448. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4449. reserved: 8,
  4450. op_code: 16;
  4451. } POSTPACK;
  4452. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4453. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4454. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4455. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4456. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4457. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4458. do { \
  4459. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4460. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4461. } while (0)
  4462. /*
  4463. * @brief host -> target HTT_MSI_SETUP message
  4464. *
  4465. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4466. *
  4467. * @details
  4468. * After target is booted up, host can send MSI setup message so that
  4469. * target sets up HW registers based on setup message.
  4470. *
  4471. * The message would appear as follows:
  4472. * |31 24|23 16|15|14 8|7 0|
  4473. * |---------------+-----------------+-----------------+-----------------|
  4474. * | reserved | msi_type | pdev_id | msg_type |
  4475. * |---------------------------------------------------------------------|
  4476. * | msi_addr_lo |
  4477. * |---------------------------------------------------------------------|
  4478. * | msi_addr_hi |
  4479. * |---------------------------------------------------------------------|
  4480. * | msi_data |
  4481. * |---------------------------------------------------------------------|
  4482. *
  4483. * The message is interpreted as follows:
  4484. * dword0 - b'0:7 - msg_type: This will be set to
  4485. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4486. * b'8:15 - pdev_id:
  4487. * 0 (for rings at SOC/UMAC level),
  4488. * 1/2/3 mac id (for rings at LMAC level)
  4489. * b'16:23 - msi_type: identify which msi registers need to be setup
  4490. * more details can be got from enum htt_msi_setup_type
  4491. * b'24:31 - reserved
  4492. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4493. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4494. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4495. */
  4496. PREPACK struct htt_msi_setup_t {
  4497. A_UINT32 msg_type: 8,
  4498. pdev_id: 8,
  4499. msi_type: 8,
  4500. reserved: 8;
  4501. A_UINT32 msi_addr_lo;
  4502. A_UINT32 msi_addr_hi;
  4503. A_UINT32 msi_data;
  4504. } POSTPACK;
  4505. enum htt_msi_setup_type {
  4506. HTT_PPDU_END_MSI_SETUP_TYPE,
  4507. /* Insert new types here*/
  4508. };
  4509. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4510. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4511. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4512. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4513. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4514. HTT_MSI_SETUP_PDEV_ID_S)
  4515. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4516. do { \
  4517. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4518. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4519. } while (0)
  4520. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4521. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4522. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4523. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4524. HTT_MSI_SETUP_MSI_TYPE_S)
  4525. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4528. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4529. } while (0)
  4530. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4531. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4532. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4533. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4534. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4535. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4538. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4539. } while (0)
  4540. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4541. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4542. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4543. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4544. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4545. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4548. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4549. } while (0)
  4550. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4551. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4552. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4553. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4554. HTT_MSI_SETUP_MSI_DATA_S)
  4555. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4556. do { \
  4557. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4558. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4559. } while (0)
  4560. /*
  4561. * @brief host -> target HTT_SRING_SETUP message
  4562. *
  4563. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4564. *
  4565. * @details
  4566. * After target is booted up, Host can send SRING setup message for
  4567. * each host facing LMAC SRING. Target setups up HW registers based
  4568. * on setup message and confirms back to Host if response_required is set.
  4569. * Host should wait for confirmation message before sending new SRING
  4570. * setup message
  4571. *
  4572. * The message would appear as follows:
  4573. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4574. * |--------------- +-----------------+-----------------+-----------------|
  4575. * | ring_type | ring_id | pdev_id | msg_type |
  4576. * |----------------------------------------------------------------------|
  4577. * | ring_base_addr_lo |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_base_addr_hi |
  4580. * |----------------------------------------------------------------------|
  4581. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_head_offset32_remote_addr_lo |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_head_offset32_remote_addr_hi |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_tail_offset32_remote_addr_lo |
  4588. * |----------------------------------------------------------------------|
  4589. * | ring_tail_offset32_remote_addr_hi |
  4590. * |----------------------------------------------------------------------|
  4591. * | ring_msi_addr_lo |
  4592. * |----------------------------------------------------------------------|
  4593. * | ring_msi_addr_hi |
  4594. * |----------------------------------------------------------------------|
  4595. * | ring_msi_data |
  4596. * |----------------------------------------------------------------------|
  4597. * | intr_timer_th |IM| intr_batch_counter_th |
  4598. * |----------------------------------------------------------------------|
  4599. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4600. * |----------------------------------------------------------------------|
  4601. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4602. * |----------------------------------------------------------------------|
  4603. * Where
  4604. * IM = sw_intr_mode
  4605. * RR = response_required
  4606. * PTCF = prefetch_timer_cfg
  4607. * IP = IPA drop flag
  4608. *
  4609. * The message is interpreted as follows:
  4610. * dword0 - b'0:7 - msg_type: This will be set to
  4611. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4612. * b'8:15 - pdev_id:
  4613. * 0 (for rings at SOC/UMAC level),
  4614. * 1/2/3 mac id (for rings at LMAC level)
  4615. * b'16:23 - ring_id: identify which ring is to setup,
  4616. * more details can be got from enum htt_srng_ring_id
  4617. * b'24:31 - ring_type: identify type of host rings,
  4618. * more details can be got from enum htt_srng_ring_type
  4619. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4620. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4621. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4622. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4623. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4624. * SW_TO_HW_RING.
  4625. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4626. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4627. * Lower 32 bits of memory address of the remote variable
  4628. * storing the 4-byte word offset that identifies the head
  4629. * element within the ring.
  4630. * (The head offset variable has type A_UINT32.)
  4631. * Valid for HW_TO_SW and SW_TO_SW rings.
  4632. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4633. * Upper 32 bits of memory address of the remote variable
  4634. * storing the 4-byte word offset that identifies the head
  4635. * element within the ring.
  4636. * (The head offset variable has type A_UINT32.)
  4637. * Valid for HW_TO_SW and SW_TO_SW rings.
  4638. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4639. * Lower 32 bits of memory address of the remote variable
  4640. * storing the 4-byte word offset that identifies the tail
  4641. * element within the ring.
  4642. * (The tail offset variable has type A_UINT32.)
  4643. * Valid for HW_TO_SW and SW_TO_SW rings.
  4644. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4645. * Upper 32 bits of memory address of the remote variable
  4646. * storing the 4-byte word offset that identifies the tail
  4647. * element within the ring.
  4648. * (The tail offset variable has type A_UINT32.)
  4649. * Valid for HW_TO_SW and SW_TO_SW rings.
  4650. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4651. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4652. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4653. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4654. * dword10 - b'0:31 - ring_msi_data: MSI data
  4655. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4656. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4657. * dword11 - b'0:14 - intr_batch_counter_th:
  4658. * batch counter threshold is in units of 4-byte words.
  4659. * HW internally maintains and increments batch count.
  4660. * (see SRING spec for detail description).
  4661. * When batch count reaches threshold value, an interrupt
  4662. * is generated by HW.
  4663. * b'15 - sw_intr_mode:
  4664. * This configuration shall be static.
  4665. * Only programmed at power up.
  4666. * 0: generate pulse style sw interrupts
  4667. * 1: generate level style sw interrupts
  4668. * b'16:31 - intr_timer_th:
  4669. * The timer init value when timer is idle or is
  4670. * initialized to start downcounting.
  4671. * In 8us units (to cover a range of 0 to 524 ms)
  4672. * dword12 - b'0:15 - intr_low_threshold:
  4673. * Used only by Consumer ring to generate ring_sw_int_p.
  4674. * Ring entries low threshold water mark, that is used
  4675. * in combination with the interrupt timer as well as
  4676. * the the clearing of the level interrupt.
  4677. * b'16:18 - prefetch_timer_cfg:
  4678. * Used only by Consumer ring to set timer mode to
  4679. * support Application prefetch handling.
  4680. * The external tail offset/pointer will be updated
  4681. * at following intervals:
  4682. * 3'b000: (Prefetch feature disabled; used only for debug)
  4683. * 3'b001: 1 usec
  4684. * 3'b010: 4 usec
  4685. * 3'b011: 8 usec (default)
  4686. * 3'b100: 16 usec
  4687. * Others: Reserved
  4688. * b'19 - response_required:
  4689. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4690. * b'20 - ipa_drop_flag:
  4691. Indicates that host will config ipa drop threshold percentage
  4692. * b'21:31 - reserved: reserved for future use
  4693. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4694. * b'8:15 - ipa drop high threshold percentage:
  4695. * b'16:31 - Reserved
  4696. */
  4697. PREPACK struct htt_sring_setup_t {
  4698. A_UINT32 msg_type: 8,
  4699. pdev_id: 8,
  4700. ring_id: 8,
  4701. ring_type: 8;
  4702. A_UINT32 ring_base_addr_lo;
  4703. A_UINT32 ring_base_addr_hi;
  4704. A_UINT32 ring_size: 16,
  4705. ring_entry_size: 8,
  4706. ring_misc_cfg_flag: 8;
  4707. A_UINT32 ring_head_offset32_remote_addr_lo;
  4708. A_UINT32 ring_head_offset32_remote_addr_hi;
  4709. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4710. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4711. A_UINT32 ring_msi_addr_lo;
  4712. A_UINT32 ring_msi_addr_hi;
  4713. A_UINT32 ring_msi_data;
  4714. A_UINT32 intr_batch_counter_th: 15,
  4715. sw_intr_mode: 1,
  4716. intr_timer_th: 16;
  4717. A_UINT32 intr_low_threshold: 16,
  4718. prefetch_timer_cfg: 3,
  4719. response_required: 1,
  4720. ipa_drop_flag: 1,
  4721. reserved1: 11;
  4722. A_UINT32 ipa_drop_low_threshold: 8,
  4723. ipa_drop_high_threshold: 8,
  4724. reserved: 16;
  4725. } POSTPACK;
  4726. enum htt_srng_ring_type {
  4727. HTT_HW_TO_SW_RING = 0,
  4728. HTT_SW_TO_HW_RING,
  4729. HTT_SW_TO_SW_RING,
  4730. /* Insert new ring types above this line */
  4731. };
  4732. enum htt_srng_ring_id {
  4733. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4734. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4735. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4736. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4737. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4738. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4739. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4740. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4741. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4742. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4743. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4744. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4745. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4746. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4747. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4748. /* Add Other SRING which can't be directly configured by host software above this line */
  4749. };
  4750. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4751. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4752. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4753. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4754. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4755. HTT_SRING_SETUP_PDEV_ID_S)
  4756. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4759. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4760. } while (0)
  4761. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4762. #define HTT_SRING_SETUP_RING_ID_S 16
  4763. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4764. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4765. HTT_SRING_SETUP_RING_ID_S)
  4766. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4769. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4770. } while (0)
  4771. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4772. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4773. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4774. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4775. HTT_SRING_SETUP_RING_TYPE_S)
  4776. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4779. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4780. } while (0)
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4782. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4783. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4784. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4785. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4786. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4789. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4790. } while (0)
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4793. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4794. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4795. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4796. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4797. do { \
  4798. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4799. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4800. } while (0)
  4801. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4802. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4803. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4804. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4805. HTT_SRING_SETUP_RING_SIZE_S)
  4806. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4809. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4810. } while (0)
  4811. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4812. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4813. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4814. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4815. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4816. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4817. do { \
  4818. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4819. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4820. } while (0)
  4821. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4822. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4823. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4824. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4825. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4826. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4827. do { \
  4828. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4829. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4830. } while (0)
  4831. /* This control bit is applicable to only Producer, which updates Ring ID field
  4832. * of each descriptor before pushing into the ring.
  4833. * 0: updates ring_id(default)
  4834. * 1: ring_id updating disabled */
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4838. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4839. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4840. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4841. do { \
  4842. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4843. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4844. } while (0)
  4845. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4846. * of each descriptor before pushing into the ring.
  4847. * 0: updates Loopcnt(default)
  4848. * 1: Loopcnt updating disabled */
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4852. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4853. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4855. do { \
  4856. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4857. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4858. } while (0)
  4859. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4860. * into security_id port of GXI/AXI. */
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4864. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4865. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4867. do { \
  4868. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4869. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4870. } while (0)
  4871. /* During MSI write operation, SRNG drives value of this register bit into
  4872. * swap bit of GXI/AXI. */
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4876. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4877. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4879. do { \
  4880. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4881. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4882. } while (0)
  4883. /* During Pointer write operation, SRNG drives value of this register bit into
  4884. * swap bit of GXI/AXI. */
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4888. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4889. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4893. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4894. } while (0)
  4895. /* During any data or TLV write operation, SRNG drives value of this register
  4896. * bit into swap bit of GXI/AXI. */
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4898. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4899. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4900. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4901. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4902. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4905. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4906. } while (0)
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4908. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4910. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4911. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4912. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4913. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4914. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4917. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4918. } while (0)
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4921. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4922. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4923. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4924. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4927. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4928. } while (0)
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4930. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4931. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4932. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4933. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4934. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4937. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4938. } while (0)
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4941. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4942. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4943. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4944. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4945. do { \
  4946. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4947. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4948. } while (0)
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4950. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4951. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4952. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4953. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4954. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4957. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4958. } while (0)
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4961. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4962. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4963. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4964. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4967. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4968. } while (0)
  4969. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4970. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4971. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4972. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4973. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4974. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4977. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4978. } while (0)
  4979. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4980. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4981. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4982. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4983. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4984. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4987. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4988. } while (0)
  4989. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4990. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4991. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4992. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4993. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4994. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4997. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4998. } while (0)
  4999. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5000. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5001. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5002. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5003. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5004. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5005. do { \
  5006. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5007. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5008. } while (0)
  5009. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5010. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5011. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5012. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5013. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5014. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5017. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5018. } while (0)
  5019. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5020. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5021. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5022. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5023. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5024. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5027. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5028. } while (0)
  5029. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5030. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5031. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5032. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5033. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5034. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5035. do { \
  5036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5037. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5038. } while (0)
  5039. /**
  5040. * @brief host -> target RX ring selection config message
  5041. *
  5042. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5043. *
  5044. * @details
  5045. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5046. * configure RXDMA rings.
  5047. * The configuration is per ring based and includes both packet subtypes
  5048. * and PPDU/MPDU TLVs.
  5049. *
  5050. * The message would appear as follows:
  5051. *
  5052. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5053. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5054. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5055. * |-----------------------+-----+-----+--------------------------------|
  5056. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5057. * |--------------------------------------------------------------------|
  5058. * | packet_type_enable_flags_0 |
  5059. * |--------------------------------------------------------------------|
  5060. * | packet_type_enable_flags_1 |
  5061. * |--------------------------------------------------------------------|
  5062. * | packet_type_enable_flags_2 |
  5063. * |--------------------------------------------------------------------|
  5064. * | packet_type_enable_flags_3 |
  5065. * |--------------------------------------------------------------------|
  5066. * | tlv_filter_in_flags |
  5067. * |-----------------------------------+--------------------------------|
  5068. * | rx_header_offset | rx_packet_offset |
  5069. * |-----------------------------------+--------------------------------|
  5070. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5071. * |-----------------------------------+--------------------------------|
  5072. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5073. * |-----------------------------------+--------------------------------|
  5074. * | rsvd3 | rx_attention_offset |
  5075. * |--------------------------------------------------------------------|
  5076. * | rsvd4 | mo| fp| rx_drop_threshold |
  5077. * | |ndp|ndp| |
  5078. * |--------------------------------------------------------------------|
  5079. * Where:
  5080. * PS = pkt_swap
  5081. * SS = status_swap
  5082. * OV = rx_offsets_valid
  5083. * DT = drop_thresh_valid
  5084. * CLM = config_length_mgmt
  5085. * CLC = config_length_ctrl
  5086. * CLD = config_length_data
  5087. * RXHDL = rx_hdr_len
  5088. * RX = rxpcu_filter_enable_flag
  5089. * The message is interpreted as follows:
  5090. * dword0 - b'0:7 - msg_type: This will be set to
  5091. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5092. * b'8:15 - pdev_id:
  5093. * 0 (for rings at SOC/UMAC level),
  5094. * 1/2/3 mac id (for rings at LMAC level)
  5095. * b'16:23 - ring_id : Identify the ring to configure.
  5096. * More details can be got from enum htt_srng_ring_id
  5097. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5098. * BUF_RING_CFG_0 defs within HW .h files,
  5099. * e.g. wmac_top_reg_seq_hwioreg.h
  5100. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5101. * BUF_RING_CFG_0 defs within HW .h files,
  5102. * e.g. wmac_top_reg_seq_hwioreg.h
  5103. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5104. * configuration fields are valid
  5105. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5106. * rx_drop_threshold field is valid
  5107. * b'28 - rx_mon_global_en: Enable/Disable global register
  5108. 8 configuration in Rx monitor module.
  5109. * b'29:31 - rsvd1: reserved for future use
  5110. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5111. * in byte units.
  5112. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5113. * b'16:18 - config_length_mgmt (MGMT):
  5114. * Represents the length of mpdu bytes for mgmt pkt.
  5115. * valid values:
  5116. * 001 - 64bytes
  5117. * 010 - 128bytes
  5118. * 100 - 256bytes
  5119. * 111 - Full mpdu bytes
  5120. * b'19:21 - config_length_ctrl (CTRL):
  5121. * Represents the length of mpdu bytes for ctrl pkt.
  5122. * valid values:
  5123. * 001 - 64bytes
  5124. * 010 - 128bytes
  5125. * 100 - 256bytes
  5126. * 111 - Full mpdu bytes
  5127. * b'22:24 - config_length_data (DATA):
  5128. * Represents the length of mpdu bytes for data pkt.
  5129. * valid values:
  5130. * 001 - 64bytes
  5131. * 010 - 128bytes
  5132. * 100 - 256bytes
  5133. * 111 - Full mpdu bytes
  5134. * b'25:26 - rx_hdr_len:
  5135. * Specifies the number of bytes of recvd packet to copy
  5136. * into the rx_hdr tlv.
  5137. * supported values for now by host:
  5138. * 01 - 64bytes
  5139. * 10 - 128bytes
  5140. * 11 - 256bytes
  5141. * default - 128 bytes
  5142. * b'27 - rxpcu_filter_enable_flag
  5143. * For Scan Radio Host CPU utilization is very high.
  5144. * In order to reduce CPU utilization we need to filter out
  5145. * certain configured MAC frames.
  5146. * To filter out configured MAC address frames, RxPCU should
  5147. * be zero which means allow all frames for MD at RxOLE
  5148. * host wil fiter out frames.
  5149. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5150. * b'28:31 - rsvd2: Reserved for future use
  5151. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5152. * Enable MGMT packet from 0b0000 to 0b1001
  5153. * bits from low to high: FP, MD, MO - 3 bits
  5154. * FP: Filter_Pass
  5155. * MD: Monitor_Direct
  5156. * MO: Monitor_Other
  5157. * 10 mgmt subtypes * 3 bits -> 30 bits
  5158. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5159. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5160. * Enable MGMT packet from 0b1010 to 0b1111
  5161. * bits from low to high: FP, MD, MO - 3 bits
  5162. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5163. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5164. * Enable CTRL packet from 0b0000 to 0b1001
  5165. * bits from low to high: FP, MD, MO - 3 bits
  5166. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5167. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5168. * Enable CTRL packet from 0b1010 to 0b1111,
  5169. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5170. * bits from low to high: FP, MD, MO - 3 bits
  5171. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5172. * dword6 - b'0:31 - tlv_filter_in_flags:
  5173. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5174. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5175. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5176. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5177. * A value of 0 will be considered as ignore this config.
  5178. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5179. * e.g. wmac_top_reg_seq_hwioreg.h
  5180. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5181. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5182. * A value of 0 will be considered as ignore this config.
  5183. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5184. * e.g. wmac_top_reg_seq_hwioreg.h
  5185. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5186. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5187. * A value of 0 will be considered as ignore this config.
  5188. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5189. * e.g. wmac_top_reg_seq_hwioreg.h
  5190. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5191. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5192. * A value of 0 will be considered as ignore this config.
  5193. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5194. * e.g. wmac_top_reg_seq_hwioreg.h
  5195. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5196. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5197. * A value of 0 will be considered as ignore this config.
  5198. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5199. * e.g. wmac_top_reg_seq_hwioreg.h
  5200. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5201. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5202. * A value of 0 will be considered as ignore this config.
  5203. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5204. * e.g. wmac_top_reg_seq_hwioreg.h
  5205. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5206. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5207. * A value of 0 will be considered as ignore this config.
  5208. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5209. * e.g. wmac_top_reg_seq_hwioreg.h
  5210. * - b'16:31 - rsvd3 for future use
  5211. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5212. * to source rings. Consumer drops packets if the available
  5213. * words in the ring falls below the configured threshold
  5214. * value.
  5215. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5216. * by host. 1 -> subscribed
  5217. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5218. * by host. 1 -> subscribed
  5219. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5220. * subscribed by host. 1 -> subscribed
  5221. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5222. * selection for the FP PHY ERR status tlv.
  5223. * 0 - wbm2rxdma_buf_source_ring
  5224. * 1 - fw2rxdma_buf_source_ring
  5225. * 2 - sw2rxdma_buf_source_ring
  5226. * 3 - no_buffer_ring
  5227. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5228. * selection for the FP PHY ERR status tlv.
  5229. * 0 - rxdma_release_ring
  5230. * 1 - rxdma2fw_ring
  5231. * 2 - rxdma2sw_ring
  5232. * 3 - rxdma2reo_ring
  5233. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5234. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5235. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5236. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5237. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5238. * 0: MSDU level logging
  5239. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5240. * 0: MSDU level logging
  5241. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5242. * 0: MSDU level logging
  5243. * - b'23 - word_mask_compaction: enable/disable word mask for
  5244. * mpdu/msdu start/end tlvs
  5245. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5246. * manager override
  5247. * - b'25:28 - rbm_override_val: return buffer manager override value
  5248. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5249. * which have to be posted to host from phy.
  5250. * Corresponding to errors defined in
  5251. * phyrx_abort_request_reason enums 0 to 31.
  5252. * Refer to RXPCU register definition header files for the
  5253. * phyrx_abort_request_reason enum definition.
  5254. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5255. * errors which have to be posted to host from phy.
  5256. * Corresponding to errors defined in
  5257. * phyrx_abort_request_reason enums 32 to 63.
  5258. * Refer to RXPCU register definition header files for the
  5259. * phyrx_abort_request_reason enum definition.
  5260. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5261. * applicable if word mask enabled
  5262. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5263. * applicable if word mask enabled
  5264. * - b'19:31 - rsvd7
  5265. * dword15- b'0:16 - rx_msdu_end_word_mask
  5266. * - b'17:31 - rsvd5
  5267. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5268. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5269. * buffer
  5270. * 1: RX_PKT TLV logging at specified offset for the
  5271. * subsequent buffer
  5272. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5273. */
  5274. PREPACK struct htt_rx_ring_selection_cfg_t {
  5275. A_UINT32 msg_type: 8,
  5276. pdev_id: 8,
  5277. ring_id: 8,
  5278. status_swap: 1,
  5279. pkt_swap: 1,
  5280. rx_offsets_valid: 1,
  5281. drop_thresh_valid: 1,
  5282. rx_mon_global_en: 1,
  5283. rsvd1: 3;
  5284. A_UINT32 ring_buffer_size: 16,
  5285. config_length_mgmt:3,
  5286. config_length_ctrl:3,
  5287. config_length_data:3,
  5288. rx_hdr_len: 2,
  5289. rxpcu_filter_enable_flag:1,
  5290. rsvd2: 4;
  5291. A_UINT32 packet_type_enable_flags_0;
  5292. A_UINT32 packet_type_enable_flags_1;
  5293. A_UINT32 packet_type_enable_flags_2;
  5294. A_UINT32 packet_type_enable_flags_3;
  5295. A_UINT32 tlv_filter_in_flags;
  5296. A_UINT32 rx_packet_offset: 16,
  5297. rx_header_offset: 16;
  5298. A_UINT32 rx_mpdu_end_offset: 16,
  5299. rx_mpdu_start_offset: 16;
  5300. A_UINT32 rx_msdu_end_offset: 16,
  5301. rx_msdu_start_offset: 16;
  5302. A_UINT32 rx_attn_offset: 16,
  5303. rsvd3: 16;
  5304. A_UINT32 rx_drop_threshold: 10,
  5305. fp_ndp: 1,
  5306. mo_ndp: 1,
  5307. fp_phy_err: 1,
  5308. fp_phy_err_buf_src: 2,
  5309. fp_phy_err_buf_dest: 2,
  5310. pkt_type_enable_msdu_or_mpdu_logging:3,
  5311. dma_mpdu_mgmt: 1,
  5312. dma_mpdu_ctrl: 1,
  5313. dma_mpdu_data: 1,
  5314. word_mask_compaction_enable:1,
  5315. rbm_override_enable: 1,
  5316. rbm_override_val: 4,
  5317. rsvd4: 3;
  5318. A_UINT32 phy_err_mask;
  5319. A_UINT32 phy_err_mask_cont;
  5320. A_UINT32 rx_mpdu_start_word_mask:16,
  5321. rx_mpdu_end_word_mask: 3,
  5322. rsvd7: 13;
  5323. A_UINT32 rx_msdu_end_word_mask: 17,
  5324. rsvd5: 15;
  5325. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5326. rx_pkt_tlv_offset: 15,
  5327. rsvd6: 16;
  5328. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5329. rx_mpdu_end_word_mask_v2: 8,
  5330. rsvd8: 4;
  5331. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5332. rsvd9: 12;
  5333. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5334. rsvd10: 12;
  5335. A_UINT32 packet_type_enable_fpmo_flags0;
  5336. A_UINT32 packet_type_enable_fpmo_flags1;
  5337. } POSTPACK;
  5338. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5339. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5340. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5341. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5342. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5343. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5344. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5345. do { \
  5346. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5347. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5348. } while (0)
  5349. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5350. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5351. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5352. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5353. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5354. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5355. do { \
  5356. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5357. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5358. } while (0)
  5359. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5360. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5361. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5362. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5363. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5364. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5365. do { \
  5366. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5367. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5368. } while (0)
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5372. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5373. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5375. do { \
  5376. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5377. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5378. } while (0)
  5379. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5380. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5381. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5382. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5383. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5384. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5385. do { \
  5386. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5387. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5388. } while (0)
  5389. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5390. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5391. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5392. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5393. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5394. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5395. do { \
  5396. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5397. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5398. } while (0)
  5399. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5400. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5401. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5402. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5403. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5404. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5405. do { \
  5406. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5407. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5408. } while (0)
  5409. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5410. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5411. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5412. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5413. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5414. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5417. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5418. } while (0)
  5419. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5420. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5421. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5422. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5423. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5424. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5425. do { \
  5426. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5427. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5428. } while (0)
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5430. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5431. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5432. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5433. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5434. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5437. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5438. } while (0)
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5440. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5441. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5442. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5443. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5444. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5445. do { \
  5446. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5447. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5448. } while (0)
  5449. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5450. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5451. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5452. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5453. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5455. do { \
  5456. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5457. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5458. } while(0)
  5459. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5460. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5461. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5462. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5463. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5464. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5467. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5468. } while(0)
  5469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5472. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5473. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5477. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5478. } while (0)
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5482. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5483. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5487. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5488. } while (0)
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5492. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5493. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5495. do { \
  5496. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5497. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5498. } while (0)
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5502. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5503. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5505. do { \
  5506. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5507. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5508. } while (0)
  5509. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5510. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5511. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5512. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5513. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5514. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5517. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5518. } while (0)
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5520. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5522. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5523. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5528. } while (0)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5532. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5533. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5538. } while (0)
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5542. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5543. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5548. } while (0)
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5552. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5553. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5554. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5558. } while (0)
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5560. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5561. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5562. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5563. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5564. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5568. } while (0)
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5570. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5571. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5572. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5573. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5574. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5578. } while (0)
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5580. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5581. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5582. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5583. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5584. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5588. } while (0)
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5590. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5591. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5592. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5593. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5594. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5598. } while (0)
  5599. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5600. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5601. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5602. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5603. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5604. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5605. do { \
  5606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5608. } while (0)
  5609. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5610. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5611. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5612. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5613. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5614. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5615. do { \
  5616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5618. } while (0)
  5619. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5620. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5621. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5622. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5623. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5624. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5628. } while (0)
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5630. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5631. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5632. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5633. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5634. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5638. } while (0)
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5640. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5641. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5642. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5643. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5644. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5645. do { \
  5646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5648. } while (0)
  5649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5652. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5653. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5655. do { \
  5656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5658. } while (0)
  5659. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5660. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5661. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5662. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5663. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5664. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5665. do { \
  5666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5668. } while (0)
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5670. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5671. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5672. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5673. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5674. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5675. do { \
  5676. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5677. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5678. } while (0)
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5680. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5681. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5682. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5683. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5684. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5687. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5688. } while (0)
  5689. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5690. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5691. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5692. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5693. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5694. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5695. do { \
  5696. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5697. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5698. } while (0)
  5699. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5700. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5701. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5702. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5703. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5704. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5707. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5708. } while (0)
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5710. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5711. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5712. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5713. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5714. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5717. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5718. } while (0)
  5719. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5720. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5721. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5722. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5723. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5724. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5725. do { \
  5726. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5727. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5728. } while (0)
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5730. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5731. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5732. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5733. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5734. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5735. do { \
  5736. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5737. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5738. } while (0)
  5739. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5740. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5741. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5742. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5743. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5744. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5747. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5748. } while (0)
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5750. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5751. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5752. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5753. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5754. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5755. do { \
  5756. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5757. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5758. } while (0)
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5760. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5761. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5762. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5763. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5764. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5765. do { \
  5766. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5767. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5768. } while (0)
  5769. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5770. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5771. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5772. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5773. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5774. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5775. do { \
  5776. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5777. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5778. } while (0)
  5779. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5780. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5781. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5782. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5783. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5784. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5785. do { \
  5786. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5787. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5788. } while (0)
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5790. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5791. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5792. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5793. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5794. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5797. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5798. } while (0)
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5800. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5801. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5802. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5803. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5804. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5807. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5808. } while (0)
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5810. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5811. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5812. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5813. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5814. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5815. do { \
  5816. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5817. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5818. } while (0)
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5820. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5821. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5822. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5823. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5824. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5825. do { \
  5826. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5827. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5828. } while (0)
  5829. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5830. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5831. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5832. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5833. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5834. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5835. do { \
  5836. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5837. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5838. } while (0)
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5840. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5841. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5842. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5843. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5844. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5845. do { \
  5846. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5847. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5848. } while (0)
  5849. /*
  5850. * Subtype based MGMT frames enable bits.
  5851. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5852. */
  5853. /* association request */
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5860. /* association response */
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5867. /* Reassociation request */
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5874. /* Reassociation response */
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5881. /* Probe request */
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5888. /* Probe response */
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5895. /* Timing Advertisement */
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5902. /* Reserved */
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5909. /* Beacon */
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5916. /* ATIM */
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5923. /* Disassociation */
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5930. /* Authentication */
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5937. /* Deauthentication */
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5944. /* Action */
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5951. /* Action No Ack */
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5958. /* Reserved */
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5965. /*
  5966. * Subtype based CTRL frames enable bits.
  5967. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5968. */
  5969. /* Reserved */
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5976. /* Reserved */
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5983. /* Reserved */
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5990. /* Reserved */
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5997. /* Reserved */
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6004. /* Reserved */
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6011. /* Reserved */
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6018. /* Control Wrapper */
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6025. /* Block Ack Request */
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6032. /* Block Ack*/
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6039. /* PS-POLL */
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6046. /* RTS */
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6053. /* CTS */
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6060. /* ACK */
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6067. /* CF-END */
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6074. /* CF-END + CF-ACK */
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6081. /* Multicast data */
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6088. /* Unicast data */
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6095. /* NULL data */
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6102. /* FPMO mode flags */
  6103. /* MGMT */
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6136. /* CTRL */
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6169. /* DATA */
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6181. do { \
  6182. HTT_CHECK_SET_VAL(httsym, value); \
  6183. (word) |= (value) << httsym##_S; \
  6184. } while (0)
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6186. (((word) & httsym##_M) >> httsym##_S)
  6187. #define htt_rx_ring_pkt_enable_subtype_set( \
  6188. word, flag, mode, type, subtype, val) \
  6189. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6190. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6191. #define htt_rx_ring_pkt_enable_subtype_get( \
  6192. word, flag, mode, type, subtype) \
  6193. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6194. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6195. /* Definition to filter in TLVs */
  6196. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6197. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6198. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6199. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6200. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6201. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6202. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6224. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6225. do { \
  6226. HTT_CHECK_SET_VAL(httsym, enable); \
  6227. (word) |= (enable) << httsym##_S; \
  6228. } while (0)
  6229. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6230. (((word) & httsym##_M) >> httsym##_S)
  6231. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6232. HTT_RX_RING_TLV_ENABLE_SET( \
  6233. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6234. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6235. HTT_RX_RING_TLV_ENABLE_GET( \
  6236. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6237. /**
  6238. * @brief host -> target TX monitor config message
  6239. *
  6240. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6241. *
  6242. * @details
  6243. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6244. * configure RXDMA rings.
  6245. * The configuration is per ring based and includes both packet types
  6246. * and PPDU/MPDU TLVs.
  6247. *
  6248. * The message would appear as follows:
  6249. *
  6250. * |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|
  6251. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6252. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6253. * |-----------+--------+--------+-----+------------------------------------|
  6254. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6255. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6256. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6257. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6258. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6259. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6260. * |------------------------------------------------------------------------|
  6261. * | tlv_filter_mask_in0 |
  6262. * |------------------------------------------------------------------------|
  6263. * | tlv_filter_mask_in1 |
  6264. * |------------------------------------------------------------------------|
  6265. * | tlv_filter_mask_in2 |
  6266. * |------------------------------------------------------------------------|
  6267. * | tlv_filter_mask_in3 |
  6268. * |-----------------+-----------------+---------------------+--------------|
  6269. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6270. * |------------------------------------------------------------------------|
  6271. * | pcu_ppdu_setup_word_mask |
  6272. * |--------------------+--+--+--+-----+---------------------+--------------|
  6273. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6274. * |------------------------------------------------------------------------|
  6275. *
  6276. * Where:
  6277. * PS = pkt_swap
  6278. * SS = status_swap
  6279. * The message is interpreted as follows:
  6280. * dword0 - b'0:7 - msg_type: This will be set to
  6281. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6282. * b'8:15 - pdev_id:
  6283. * 0 (for rings at SOC level),
  6284. * 1/2/3 mac id (for rings at LMAC level)
  6285. * b'16:23 - ring_id : Identify the ring to configure.
  6286. * More details can be got from enum htt_srng_ring_id
  6287. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6288. * BUF_RING_CFG_0 defs within HW .h files,
  6289. * e.g. wmac_top_reg_seq_hwioreg.h
  6290. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6291. * BUF_RING_CFG_0 defs within HW .h files,
  6292. * e.g. wmac_top_reg_seq_hwioreg.h
  6293. * b'26 - tx_mon_global_en: Enable/Disable global register
  6294. * configuration in Tx monitor module.
  6295. * b'27:31 - rsvd1: reserved for future use
  6296. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6297. * in byte units.
  6298. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6299. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6300. * 64, 128, 256.
  6301. * If all 3 bits are set config length is > 256.
  6302. * if val is '0', then ignore this field.
  6303. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6304. * 64, 128, 256.
  6305. * If all 3 bits are set config length is > 256.
  6306. * if val is '0', then ignore this field.
  6307. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6308. * 64, 128, 256.
  6309. * If all 3 bits are set config length is > 256.
  6310. * If val is '0', then ignore this field.
  6311. * - b'25:31 - rsvd2: Reserved for future use
  6312. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6313. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6314. * If packet_type_enable_flags is '1' for MGMT type,
  6315. * monitor will ignore this bit and allow this TLV.
  6316. * If packet_type_enable_flags is '0' for MGMT type,
  6317. * monitor will use this bit to enable/disable logging
  6318. * of this TLV.
  6319. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6320. * If packet_type_enable_flags is '1' for CTRL type,
  6321. * monitor will ignore this bit and allow this TLV.
  6322. * If packet_type_enable_flags is '0' for CTRL type,
  6323. * monitor will use this bit to enable/disable logging
  6324. * of this TLV.
  6325. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6326. * If packet_type_enable_flags is '1' for DATA type,
  6327. * monitor will ignore this bit and allow this TLV.
  6328. * If packet_type_enable_flags is '0' for DATA type,
  6329. * monitor will use this bit to enable/disable logging
  6330. * of this TLV.
  6331. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6332. * If packet_type_enable_flags is '1' for MGMT type,
  6333. * monitor will ignore this bit and allow this TLV.
  6334. * If packet_type_enable_flags is '0' for MGMT type,
  6335. * monitor will use this bit to enable/disable logging
  6336. * of this TLV.
  6337. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6338. * If packet_type_enable_flags is '1' for CTRL type,
  6339. * monitor will ignore this bit and allow this TLV.
  6340. * If packet_type_enable_flags is '0' for CTRL type,
  6341. * monitor will use this bit to enable/disable logging
  6342. * of this TLV.
  6343. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6344. * If packet_type_enable_flags is '1' for DATA type,
  6345. * monitor will ignore this bit and allow this TLV.
  6346. * If packet_type_enable_flags is '0' for DATA type,
  6347. * monitor will use this bit to enable/disable logging
  6348. * of this TLV.
  6349. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6350. * If packet_type_enable_flags is '1' for MGMT type,
  6351. * monitor will ignore this bit and allow this TLV.
  6352. * If packet_type_enable_flags is '0' for MGMT type,
  6353. * monitor will use this bit to enable/disable logging
  6354. * of this TLV.
  6355. * If filter_in_TX_MPDU_START = 1 it is recommended
  6356. * to set this bit.
  6357. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6358. * If packet_type_enable_flags is '1' for CTRL type,
  6359. * monitor will ignore this bit and allow this TLV.
  6360. * If packet_type_enable_flags is '0' for CTRL type,
  6361. * monitor will use this bit to enable/disable logging
  6362. * of this TLV.
  6363. * If filter_in_TX_MPDU_START = 1 it is recommended
  6364. * to set this bit.
  6365. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6366. * If packet_type_enable_flags is '1' for DATA type,
  6367. * monitor will ignore this bit and allow this TLV.
  6368. * If packet_type_enable_flags is '0' for DATA type,
  6369. * monitor will use this bit to enable/disable logging
  6370. * of this TLV.
  6371. * If filter_in_TX_MPDU_START = 1 it is recommended
  6372. * to set this bit.
  6373. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6374. * If packet_type_enable_flags is '1' for MGMT type,
  6375. * monitor will ignore this bit and allow this TLV.
  6376. * If packet_type_enable_flags is '0' for MGMT type,
  6377. * monitor will use this bit to enable/disable logging
  6378. * of this TLV.
  6379. * If filter_in_TX_MSDU_START = 1 it is recommended
  6380. * to set this bit.
  6381. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6382. * If packet_type_enable_flags is '1' for CTRL type,
  6383. * monitor will ignore this bit and allow this TLV.
  6384. * If packet_type_enable_flags is '0' for CTRL type,
  6385. * monitor will use this bit to enable/disable logging
  6386. * of this TLV.
  6387. * If filter_in_TX_MSDU_START = 1 it is recommended
  6388. * to set this bit.
  6389. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6390. * If packet_type_enable_flags is '1' for DATA type,
  6391. * monitor will ignore this bit and allow this TLV.
  6392. * If packet_type_enable_flags is '0' for DATA type,
  6393. * monitor will use this bit to enable/disable logging
  6394. * of this TLV.
  6395. * If filter_in_TX_MSDU_START = 1 it is recommended
  6396. * to set this bit.
  6397. * b'15:31 - rsvd3: Reserved for future use
  6398. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6399. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6400. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6401. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6402. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6403. * - b'8:15 - tx_peer_entry_word_mask:
  6404. * - b'16:23 - tx_queue_ext_word_mask:
  6405. * - b'24:31 - tx_msdu_start_word_mask:
  6406. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6407. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6408. * - b'8:15 - rxpcu_user_setup_word_mask:
  6409. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6410. * MGMT, CTRL, DATA
  6411. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6412. * 0 -> MSDU level logging is enabled
  6413. * (valid only if bit is set in
  6414. * pkt_type_enable_msdu_or_mpdu_logging)
  6415. * 1 -> MPDU level logging is enabled
  6416. * (valid only if bit is set in
  6417. * pkt_type_enable_msdu_or_mpdu_logging)
  6418. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6419. * 0 -> MSDU level logging is enabled
  6420. * (valid only if bit is set in
  6421. * pkt_type_enable_msdu_or_mpdu_logging)
  6422. * 1 -> MPDU level logging is enabled
  6423. * (valid only if bit is set in
  6424. * pkt_type_enable_msdu_or_mpdu_logging)
  6425. * - b'21 - dma_mpdu_data(D) : For DATA
  6426. * 0 -> MSDU level logging is enabled
  6427. * (valid only if bit is set in
  6428. * pkt_type_enable_msdu_or_mpdu_logging)
  6429. * 1 -> MPDU level logging is enabled
  6430. * (valid only if bit is set in
  6431. * pkt_type_enable_msdu_or_mpdu_logging)
  6432. * - b'22:31 - rsvd4 for future use
  6433. */
  6434. PREPACK struct htt_tx_monitor_cfg_t {
  6435. A_UINT32 msg_type: 8,
  6436. pdev_id: 8,
  6437. ring_id: 8,
  6438. status_swap: 1,
  6439. pkt_swap: 1,
  6440. tx_mon_global_en: 1,
  6441. rsvd1: 5;
  6442. A_UINT32 ring_buffer_size: 16,
  6443. config_length_mgmt: 3,
  6444. config_length_ctrl: 3,
  6445. config_length_data: 3,
  6446. rsvd2: 7;
  6447. A_UINT32 pkt_type_enable_flags: 3,
  6448. filter_in_tx_mpdu_start_mgmt: 1,
  6449. filter_in_tx_mpdu_start_ctrl: 1,
  6450. filter_in_tx_mpdu_start_data: 1,
  6451. filter_in_tx_msdu_start_mgmt: 1,
  6452. filter_in_tx_msdu_start_ctrl: 1,
  6453. filter_in_tx_msdu_start_data: 1,
  6454. filter_in_tx_mpdu_end_mgmt: 1,
  6455. filter_in_tx_mpdu_end_ctrl: 1,
  6456. filter_in_tx_mpdu_end_data: 1,
  6457. filter_in_tx_msdu_end_mgmt: 1,
  6458. filter_in_tx_msdu_end_ctrl: 1,
  6459. filter_in_tx_msdu_end_data: 1,
  6460. rsvd3: 17;
  6461. A_UINT32 tlv_filter_mask_in0;
  6462. A_UINT32 tlv_filter_mask_in1;
  6463. A_UINT32 tlv_filter_mask_in2;
  6464. A_UINT32 tlv_filter_mask_in3;
  6465. A_UINT32 tx_fes_setup_word_mask: 8,
  6466. tx_peer_entry_word_mask: 8,
  6467. tx_queue_ext_word_mask: 8,
  6468. tx_msdu_start_word_mask: 8;
  6469. A_UINT32 pcu_ppdu_setup_word_mask;
  6470. A_UINT32 tx_mpdu_start_word_mask: 8,
  6471. rxpcu_user_setup_word_mask: 8,
  6472. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6473. dma_mpdu_mgmt: 1,
  6474. dma_mpdu_ctrl: 1,
  6475. dma_mpdu_data: 1,
  6476. rsvd4: 10;
  6477. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6478. tx_peer_entry_v2_word_mask: 12,
  6479. rsvd5: 10;
  6480. A_UINT32 fes_status_end_word_mask: 16,
  6481. response_end_status_word_mask: 16;
  6482. A_UINT32 fes_status_prot_word_mask: 11,
  6483. rsvd6: 21;
  6484. } POSTPACK;
  6485. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6486. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6487. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6488. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6489. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6490. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6491. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6492. do { \
  6493. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6494. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6495. } while (0)
  6496. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6497. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6498. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6499. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6500. HTT_TX_MONITOR_CFG_RING_ID_S)
  6501. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6504. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6507. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6508. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6509. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6510. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6511. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6512. do { \
  6513. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6514. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6515. } while (0)
  6516. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6517. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6518. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6519. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6520. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6521. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6524. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6525. } while (0)
  6526. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6527. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6528. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6529. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6530. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6531. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6534. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6535. } while (0)
  6536. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6537. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6538. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6539. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6540. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6541. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6544. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6545. } while (0)
  6546. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6547. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6548. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6549. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6550. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6551. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6554. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6555. } while (0)
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6557. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6558. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6559. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6560. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6561. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6564. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6565. } while (0)
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6567. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6568. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6569. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6570. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6571. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6574. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6575. } while (0)
  6576. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6577. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6578. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6579. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6580. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6581. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6584. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6585. } while (0)
  6586. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6587. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6588. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6589. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6590. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6591. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6594. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6595. } while (0)
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6597. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6598. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6599. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6600. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6601. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6604. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6605. } while (0)
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6607. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6608. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6609. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6610. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6611. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6614. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6615. } while (0)
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6619. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6620. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6621. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6622. do { \
  6623. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6624. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6625. } while (0)
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6629. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6630. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6631. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6632. do { \
  6633. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6634. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6635. } while (0)
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6639. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6640. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6641. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6642. do { \
  6643. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6644. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6645. } while (0)
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6649. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6650. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6651. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6652. do { \
  6653. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6654. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6655. } while (0)
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6659. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6660. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6661. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6664. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6665. } while (0)
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6669. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6670. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6671. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6672. do { \
  6673. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6674. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6675. } while (0)
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6679. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6680. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6681. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6682. do { \
  6683. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6684. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6685. } while (0)
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6689. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6690. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6691. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6692. do { \
  6693. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6694. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6695. } while (0)
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6699. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6700. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6701. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6702. do { \
  6703. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6704. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6705. } while (0)
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6709. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6710. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6712. do { \
  6713. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6714. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6715. } while (0)
  6716. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6717. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6718. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6719. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6720. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6721. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6724. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6725. } while (0)
  6726. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6727. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6728. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6729. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6730. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6731. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6732. do { \
  6733. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6734. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6735. } while (0)
  6736. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6737. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6738. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6739. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6740. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6741. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6742. do { \
  6743. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6744. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6745. } while (0)
  6746. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6747. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6748. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6749. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6750. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6751. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6752. do { \
  6753. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6754. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6755. } while (0)
  6756. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6757. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6758. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6759. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6760. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6761. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6762. do { \
  6763. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6764. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6765. } while (0)
  6766. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6767. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6768. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6769. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6770. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6771. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6772. do { \
  6773. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6774. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6775. } while (0)
  6776. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6777. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6778. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6779. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6780. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6781. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6782. do { \
  6783. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6784. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6785. } while (0)
  6786. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6787. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6788. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6789. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6790. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6791. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6792. do { \
  6793. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6794. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6795. } while (0)
  6796. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6797. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6798. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6799. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6800. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6801. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6802. do { \
  6803. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6804. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6805. } while (0)
  6806. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6807. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6808. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6809. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6810. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6811. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6812. do { \
  6813. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6814. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6815. } while (0)
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6817. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6818. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6819. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6820. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6821. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6822. do { \
  6823. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6824. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6825. } while (0)
  6826. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6827. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6828. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6829. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6830. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6831. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6832. do { \
  6833. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6834. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6835. } while (0)
  6836. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6837. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6838. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6839. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6840. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6841. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6842. do { \
  6843. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6844. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6845. } while (0)
  6846. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6847. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6848. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6849. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6850. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6851. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6852. do { \
  6853. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6854. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6855. } while (0)
  6856. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6857. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6858. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6859. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6860. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6861. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6862. do { \
  6863. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6864. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6865. } while (0)
  6866. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6867. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6868. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6869. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6870. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6871. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6872. do { \
  6873. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6874. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6875. } while (0)
  6876. /*
  6877. * pkt_type_enable_flags
  6878. */
  6879. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6880. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6881. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6882. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6883. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6884. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6885. /*
  6886. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6887. */
  6888. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6889. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6890. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6891. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6892. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6893. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6894. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6895. do { \
  6896. HTT_CHECK_SET_VAL(httsym, value); \
  6897. (word) |= (value) << httsym##_S; \
  6898. } while (0)
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6900. (((word) & httsym##_M) >> httsym##_S)
  6901. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6902. * type -> MGMT, CTRL, DATA*/
  6903. #define htt_tx_ring_pkt_type_set( \
  6904. word, mode, type, val) \
  6905. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6906. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6907. #define htt_tx_ring_pkt_type_get( \
  6908. word, mode, type) \
  6909. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6910. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6911. /* Definition to filter in TLVs */
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6976. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(httsym, enable); \
  6979. (word) |= (enable) << httsym##_S; \
  6980. } while (0)
  6981. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6982. (((word) & httsym##_M) >> httsym##_S)
  6983. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6984. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6985. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6986. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6987. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6988. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7053. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7054. do { \
  7055. HTT_CHECK_SET_VAL(httsym, enable); \
  7056. (word) |= (enable) << httsym##_S; \
  7057. } while (0)
  7058. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7059. (((word) & httsym##_M) >> httsym##_S)
  7060. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7061. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7062. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7063. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7064. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7065. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7130. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7131. do { \
  7132. HTT_CHECK_SET_VAL(httsym, enable); \
  7133. (word) |= (enable) << httsym##_S; \
  7134. } while (0)
  7135. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7136. (((word) & httsym##_M) >> httsym##_S)
  7137. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7138. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7139. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7140. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7141. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7142. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7187. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7188. do { \
  7189. HTT_CHECK_SET_VAL(httsym, enable); \
  7190. (word) |= (enable) << httsym##_S; \
  7191. } while (0)
  7192. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7193. (((word) & httsym##_M) >> httsym##_S)
  7194. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7195. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7196. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7197. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7198. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7199. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7200. /**
  7201. * @brief host --> target Receive Flow Steering configuration message definition
  7202. *
  7203. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7204. *
  7205. * host --> target Receive Flow Steering configuration message definition.
  7206. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7207. * The reason for this is we want RFS to be configured and ready before MAC
  7208. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7209. *
  7210. * |31 24|23 16|15 9|8|7 0|
  7211. * |----------------+----------------+----------------+----------------|
  7212. * | reserved |E| msg type |
  7213. * |-------------------------------------------------------------------|
  7214. * Where E = RFS enable flag
  7215. *
  7216. * The RFS_CONFIG message consists of a single 4-byte word.
  7217. *
  7218. * Header fields:
  7219. * - MSG_TYPE
  7220. * Bits 7:0
  7221. * Purpose: identifies this as a RFS config msg
  7222. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7223. * - RFS_CONFIG
  7224. * Bit 8
  7225. * Purpose: Tells target whether to enable (1) or disable (0)
  7226. * flow steering feature when sending rx indication messages to host
  7227. */
  7228. #define HTT_H2T_RFS_CONFIG_M 0x100
  7229. #define HTT_H2T_RFS_CONFIG_S 8
  7230. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7231. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7232. HTT_H2T_RFS_CONFIG_S)
  7233. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7234. do { \
  7235. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7236. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7237. } while (0)
  7238. #define HTT_RFS_CFG_REQ_BYTES 4
  7239. /**
  7240. * @brief host -> target FW extended statistics request
  7241. *
  7242. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7243. *
  7244. * @details
  7245. * The following field definitions describe the format of the HTT host
  7246. * to target FW extended stats retrieve message.
  7247. * The message specifies the type of stats the host wants to retrieve.
  7248. *
  7249. * |31 24|23 16|15 8|7 0|
  7250. * |-----------------------------------------------------------|
  7251. * | reserved | stats type | pdev_mask | msg type |
  7252. * |-----------------------------------------------------------|
  7253. * | config param [0] |
  7254. * |-----------------------------------------------------------|
  7255. * | config param [1] |
  7256. * |-----------------------------------------------------------|
  7257. * | config param [2] |
  7258. * |-----------------------------------------------------------|
  7259. * | config param [3] |
  7260. * |-----------------------------------------------------------|
  7261. * | reserved |
  7262. * |-----------------------------------------------------------|
  7263. * | cookie LSBs |
  7264. * |-----------------------------------------------------------|
  7265. * | cookie MSBs |
  7266. * |-----------------------------------------------------------|
  7267. * Header fields:
  7268. * - MSG_TYPE
  7269. * Bits 7:0
  7270. * Purpose: identifies this is a extended stats upload request message
  7271. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7272. * - PDEV_MASK
  7273. * Bits 8:15
  7274. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7275. * Value: This is a overloaded field, refer to usage and interpretation of
  7276. * PDEV in interface document.
  7277. * Bit 8 : Reserved for SOC stats
  7278. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7279. * Indicates MACID_MASK in DBS
  7280. * - STATS_TYPE
  7281. * Bits 23:16
  7282. * Purpose: identifies which FW statistics to upload
  7283. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7284. * - Reserved
  7285. * Bits 31:24
  7286. * - CONFIG_PARAM [0]
  7287. * Bits 31:0
  7288. * Purpose: give an opaque configuration value to the specified stats type
  7289. * Value: stats-type specific configuration value
  7290. * Refer to htt_stats.h for interpretation for each stats sub_type
  7291. * - CONFIG_PARAM [1]
  7292. * Bits 31:0
  7293. * Purpose: give an opaque configuration value to the specified stats type
  7294. * Value: stats-type specific configuration value
  7295. * Refer to htt_stats.h for interpretation for each stats sub_type
  7296. * - CONFIG_PARAM [2]
  7297. * Bits 31:0
  7298. * Purpose: give an opaque configuration value to the specified stats type
  7299. * Value: stats-type specific configuration value
  7300. * Refer to htt_stats.h for interpretation for each stats sub_type
  7301. * - CONFIG_PARAM [3]
  7302. * Bits 31:0
  7303. * Purpose: give an opaque configuration value to the specified stats type
  7304. * Value: stats-type specific configuration value
  7305. * Refer to htt_stats.h for interpretation for each stats sub_type
  7306. * - Reserved [31:0] for future use.
  7307. * - COOKIE_LSBS
  7308. * Bits 31:0
  7309. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7310. * message with its preceding host->target stats request message.
  7311. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7312. * - COOKIE_MSBS
  7313. * Bits 31:0
  7314. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7315. * message with its preceding host->target stats request message.
  7316. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7317. */
  7318. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7319. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7320. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7321. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7322. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7323. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7324. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7325. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7326. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7327. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7328. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7329. do { \
  7330. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7331. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7332. } while (0)
  7333. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7334. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7335. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7336. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7337. do { \
  7338. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7339. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7340. } while (0)
  7341. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7342. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7343. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7344. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7347. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7348. } while (0)
  7349. /**
  7350. * @brief host -> target FW streaming statistics request
  7351. *
  7352. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7353. *
  7354. * @details
  7355. * The following field definitions describe the format of the HTT host
  7356. * to target message that requests the target to start or stop producing
  7357. * ongoing stats of the specified type.
  7358. *
  7359. * |31|30 |23 16|15 8|7 0|
  7360. * |-----------------------------------------------------------|
  7361. * |EN| reserved | stats type | reserved | msg type |
  7362. * |-----------------------------------------------------------|
  7363. * | config param [0] |
  7364. * |-----------------------------------------------------------|
  7365. * | config param [1] |
  7366. * |-----------------------------------------------------------|
  7367. * | config param [2] |
  7368. * |-----------------------------------------------------------|
  7369. * | config param [3] |
  7370. * |-----------------------------------------------------------|
  7371. * Where:
  7372. * - EN is an enable/disable flag
  7373. * Header fields:
  7374. * - MSG_TYPE
  7375. * Bits 7:0
  7376. * Purpose: identifies this is a streaming stats upload request message
  7377. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7378. * - STATS_TYPE
  7379. * Bits 23:16
  7380. * Purpose: identifies which FW statistics to upload
  7381. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7382. * Only the htt_dbg_ext_stats_type values identified as streaming
  7383. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7384. * - ENABLE
  7385. * Bit 31
  7386. * Purpose: enable/disable the target's ongoing stats of the specified type
  7387. * Value:
  7388. * 0 - disable ongoing production of the specified stats type
  7389. * 1 - enable ongoing production of the specified stats type
  7390. * - CONFIG_PARAM [0]
  7391. * Bits 31:0
  7392. * Purpose: give an opaque configuration value to the specified stats type
  7393. * Value: stats-type specific configuration value
  7394. * Refer to htt_stats.h for interpretation for each stats sub_type
  7395. * - CONFIG_PARAM [1]
  7396. * Bits 31:0
  7397. * Purpose: give an opaque configuration value to the specified stats type
  7398. * Value: stats-type specific configuration value
  7399. * Refer to htt_stats.h for interpretation for each stats sub_type
  7400. * - CONFIG_PARAM [2]
  7401. * Bits 31:0
  7402. * Purpose: give an opaque configuration value to the specified stats type
  7403. * Value: stats-type specific configuration value
  7404. * Refer to htt_stats.h for interpretation for each stats sub_type
  7405. * - CONFIG_PARAM [3]
  7406. * Bits 31:0
  7407. * Purpose: give an opaque configuration value to the specified stats type
  7408. * Value: stats-type specific configuration value
  7409. * Refer to htt_stats.h for interpretation for each stats sub_type
  7410. */
  7411. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7412. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7413. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7414. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7415. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7416. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7417. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7418. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7419. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7420. do { \
  7421. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7422. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7423. } while (0)
  7424. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7425. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7426. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7427. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7428. do { \
  7429. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7430. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7431. } while (0)
  7432. /**
  7433. * @brief host -> target FW PPDU_STATS request message
  7434. *
  7435. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7436. *
  7437. * @details
  7438. * The following field definitions describe the format of the HTT host
  7439. * to target FW for PPDU_STATS_CFG msg.
  7440. * The message allows the host to configure the PPDU_STATS_IND messages
  7441. * produced by the target.
  7442. *
  7443. * |31 24|23 16|15 8|7 0|
  7444. * |-----------------------------------------------------------|
  7445. * | REQ bit mask | pdev_mask | msg type |
  7446. * |-----------------------------------------------------------|
  7447. * Header fields:
  7448. * - MSG_TYPE
  7449. * Bits 7:0
  7450. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7451. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7452. * - PDEV_MASK
  7453. * Bits 8:15
  7454. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7455. * Value: This is a overloaded field, refer to usage and interpretation of
  7456. * PDEV in interface document.
  7457. * Bit 8 : Reserved for SOC stats
  7458. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7459. * Indicates MACID_MASK in DBS
  7460. * - REQ_TLV_BIT_MASK
  7461. * Bits 16:31
  7462. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7463. * needs to be included in the target's PPDU_STATS_IND messages.
  7464. * Value: refer htt_ppdu_stats_tlv_tag_t
  7465. *
  7466. */
  7467. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7468. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7469. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7470. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7471. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7472. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7473. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7474. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7475. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7476. do { \
  7477. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7478. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7479. } while (0)
  7480. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7481. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7482. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7483. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7486. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7487. } while (0)
  7488. /**
  7489. * @brief Host-->target HTT RX FSE setup message
  7490. *
  7491. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7492. *
  7493. * @details
  7494. * Through this message, the host will provide details of the flow tables
  7495. * in host DDR along with hash keys.
  7496. * This message can be sent per SOC or per PDEV, which is differentiated
  7497. * by pdev id values.
  7498. * The host will allocate flow search table and sends table size,
  7499. * physical DMA address of flow table, and hash keys to firmware to
  7500. * program into the RXOLE FSE HW block.
  7501. *
  7502. * The following field definitions describe the format of the RX FSE setup
  7503. * message sent from the host to target
  7504. *
  7505. * Header fields:
  7506. * dword0 - b'7:0 - msg_type: This will be set to
  7507. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7508. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7509. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7510. * pdev's LMAC ring.
  7511. * b'31:16 - reserved : Reserved for future use
  7512. * dword1 - b'19:0 - number of records: This field indicates the number of
  7513. * entries in the flow table. For example: 8k number of
  7514. * records is equivalent to
  7515. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7516. * b'27:20 - max search: This field specifies the skid length to FSE
  7517. * parser HW module whenever match is not found at the
  7518. * exact index pointed by hash.
  7519. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7520. * Refer htt_ip_da_sa_prefix below for more details.
  7521. * b'31:30 - reserved: Reserved for future use
  7522. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7523. * table allocated by host in DDR
  7524. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7525. * table allocated by host in DDR
  7526. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7527. * entry hashing
  7528. *
  7529. *
  7530. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7531. * |---------------------------------------------------------------|
  7532. * | reserved | pdev_id | MSG_TYPE |
  7533. * |---------------------------------------------------------------|
  7534. * |resvd|IPDSA| max_search | Number of records |
  7535. * |---------------------------------------------------------------|
  7536. * | base address lo |
  7537. * |---------------------------------------------------------------|
  7538. * | base address high |
  7539. * |---------------------------------------------------------------|
  7540. * | toeplitz key 31_0 |
  7541. * |---------------------------------------------------------------|
  7542. * | toeplitz key 63_32 |
  7543. * |---------------------------------------------------------------|
  7544. * | toeplitz key 95_64 |
  7545. * |---------------------------------------------------------------|
  7546. * | toeplitz key 127_96 |
  7547. * |---------------------------------------------------------------|
  7548. * | toeplitz key 159_128 |
  7549. * |---------------------------------------------------------------|
  7550. * | toeplitz key 191_160 |
  7551. * |---------------------------------------------------------------|
  7552. * | toeplitz key 223_192 |
  7553. * |---------------------------------------------------------------|
  7554. * | toeplitz key 255_224 |
  7555. * |---------------------------------------------------------------|
  7556. * | toeplitz key 287_256 |
  7557. * |---------------------------------------------------------------|
  7558. * | reserved | toeplitz key 314_288(26:0 bits) |
  7559. * |---------------------------------------------------------------|
  7560. * where:
  7561. * IPDSA = ip_da_sa
  7562. */
  7563. /**
  7564. * @brief: htt_ip_da_sa_prefix
  7565. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7566. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7567. * documentation per RFC3849
  7568. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7569. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7570. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7571. */
  7572. enum htt_ip_da_sa_prefix {
  7573. HTT_RX_IPV6_20010db8,
  7574. HTT_RX_IPV4_MAPPED_IPV6,
  7575. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7576. HTT_RX_IPV6_64FF9B,
  7577. };
  7578. /**
  7579. * @brief Host-->target HTT RX FISA configure and enable
  7580. *
  7581. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7582. *
  7583. * @details
  7584. * The host will send this command down to configure and enable the FISA
  7585. * operational params.
  7586. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7587. * register.
  7588. * Should configure both the MACs.
  7589. *
  7590. * dword0 - b'7:0 - msg_type:
  7591. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7592. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7593. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7594. * pdev's LMAC ring.
  7595. * b'31:16 - reserved : Reserved for future use
  7596. *
  7597. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7598. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7599. * packets. 1 flow search will be skipped
  7600. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7601. * tcp,udp packets
  7602. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7603. * calculation
  7604. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7605. * calculation
  7606. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7607. * calculation
  7608. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7609. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7610. * length
  7611. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7612. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7613. * length
  7614. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7615. * num jump
  7616. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7617. * num jump
  7618. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7619. * data type switch has happened for MPDU Sequence num jump
  7620. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7621. * for MPDU Sequence num jump
  7622. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7623. * for decrypt errors
  7624. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7625. * while aggregating a msdu
  7626. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7627. * The aggregation is done until (number of MSDUs aggregated
  7628. * < LIMIT + 1)
  7629. * b'31:18 - Reserved
  7630. *
  7631. * fisa_control_value - 32bit value FW can write to register
  7632. *
  7633. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7634. * Threshold value for FISA timeout (units are microseconds).
  7635. * When the global timestamp exceeds this threshold, FISA
  7636. * aggregation will be restarted.
  7637. * A value of 0 means timeout is disabled.
  7638. * Compare the threshold register with timestamp field in
  7639. * flow entry to generate timeout for the flow.
  7640. *
  7641. * |31 18 |17 16|15 8|7 0|
  7642. * |-------------------------------------------------------------|
  7643. * | reserved | pdev_mask | msg type |
  7644. * |-------------------------------------------------------------|
  7645. * | reserved | FISA_CTRL |
  7646. * |-------------------------------------------------------------|
  7647. * | FISA_TIMEOUT_THRESH |
  7648. * |-------------------------------------------------------------|
  7649. */
  7650. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7651. A_UINT32 msg_type:8,
  7652. pdev_id:8,
  7653. reserved0:16;
  7654. /**
  7655. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7656. * [17:0]
  7657. */
  7658. union {
  7659. /*
  7660. * fisa_control_bits structure is deprecated.
  7661. * Please use fisa_control_bits_v2 going forward.
  7662. */
  7663. struct {
  7664. A_UINT32 fisa_enable: 1,
  7665. ipsec_skip_search: 1,
  7666. nontcp_skip_search: 1,
  7667. add_ipv4_fixed_hdr_len: 1,
  7668. add_ipv6_fixed_hdr_len: 1,
  7669. add_tcp_fixed_hdr_len: 1,
  7670. add_udp_hdr_len: 1,
  7671. chksum_cum_ip_len_en: 1,
  7672. disable_tid_check: 1,
  7673. disable_ta_check: 1,
  7674. disable_qos_check: 1,
  7675. disable_raw_check: 1,
  7676. disable_decrypt_err_check: 1,
  7677. disable_msdu_drop_check: 1,
  7678. fisa_aggr_limit: 4,
  7679. reserved: 14;
  7680. } fisa_control_bits;
  7681. struct {
  7682. A_UINT32 fisa_enable: 1,
  7683. fisa_aggr_limit: 4,
  7684. reserved: 27;
  7685. } fisa_control_bits_v2;
  7686. A_UINT32 fisa_control_value;
  7687. } u_fisa_control;
  7688. /**
  7689. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7690. * timeout threshold for aggregation. Unit in usec.
  7691. * [31:0]
  7692. */
  7693. A_UINT32 fisa_timeout_threshold;
  7694. } POSTPACK;
  7695. /* DWord 0: pdev-ID */
  7696. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7697. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7698. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7699. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7700. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7701. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7704. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7705. } while (0)
  7706. /* Dword 1: fisa_control_value fisa config */
  7707. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7708. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7709. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7710. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7711. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7712. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7715. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7716. } while (0)
  7717. /* Dword 1: fisa_control_value ipsec_skip_search */
  7718. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7719. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7720. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7721. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7722. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7723. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7726. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7727. } while (0)
  7728. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7729. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7730. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7731. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7732. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7733. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7734. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7737. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7738. } while (0)
  7739. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7740. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7741. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7742. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7743. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7744. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7745. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7748. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7749. } while (0)
  7750. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7751. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7752. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7753. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7754. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7755. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7756. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7757. do { \
  7758. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7759. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7760. } while (0)
  7761. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7762. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7763. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7764. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7765. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7766. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7767. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7770. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7771. } while (0)
  7772. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7773. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7774. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7775. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7776. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7777. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7778. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7779. do { \
  7780. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7781. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7782. } while (0)
  7783. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7784. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7785. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7786. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7787. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7788. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7789. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7790. do { \
  7791. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7792. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7793. } while (0)
  7794. /* Dword 1: fisa_control_value disable_tid_check */
  7795. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7796. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7797. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7798. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7799. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7800. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7801. do { \
  7802. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7803. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7804. } while (0)
  7805. /* Dword 1: fisa_control_value disable_ta_check */
  7806. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7807. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7808. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7809. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7810. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7811. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7812. do { \
  7813. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7814. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7815. } while (0)
  7816. /* Dword 1: fisa_control_value disable_qos_check */
  7817. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7818. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7819. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7820. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7821. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7822. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7823. do { \
  7824. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7825. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7826. } while (0)
  7827. /* Dword 1: fisa_control_value disable_raw_check */
  7828. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7829. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7830. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7831. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7832. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7833. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7834. do { \
  7835. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7836. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7837. } while (0)
  7838. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7840. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7841. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7842. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7843. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7844. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7845. do { \
  7846. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7847. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7848. } while (0)
  7849. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7851. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7852. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7853. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7854. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7855. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7856. do { \
  7857. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7858. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7859. } while (0)
  7860. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7861. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7862. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7863. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7864. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7865. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7866. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7867. do { \
  7868. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7869. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7870. } while (0)
  7871. /* Dword 1: fisa_control_value fisa config */
  7872. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7873. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7874. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7875. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7876. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7877. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7878. do { \
  7879. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7880. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7881. } while (0)
  7882. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7883. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7884. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7885. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7886. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7887. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7888. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7889. do { \
  7890. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7891. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7892. } while (0)
  7893. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7894. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7895. pdev_id:8,
  7896. reserved0:16;
  7897. A_UINT32 num_records:20,
  7898. max_search:8,
  7899. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7900. reserved1:2;
  7901. A_UINT32 base_addr_lo;
  7902. A_UINT32 base_addr_hi;
  7903. A_UINT32 toeplitz31_0;
  7904. A_UINT32 toeplitz63_32;
  7905. A_UINT32 toeplitz95_64;
  7906. A_UINT32 toeplitz127_96;
  7907. A_UINT32 toeplitz159_128;
  7908. A_UINT32 toeplitz191_160;
  7909. A_UINT32 toeplitz223_192;
  7910. A_UINT32 toeplitz255_224;
  7911. A_UINT32 toeplitz287_256;
  7912. A_UINT32 toeplitz314_288:27,
  7913. reserved2:5;
  7914. } POSTPACK;
  7915. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7916. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7917. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7918. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7919. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7920. /* DWORD 0: Pdev ID */
  7921. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7922. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7923. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7924. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7925. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7926. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7927. do { \
  7928. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7929. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7930. } while (0)
  7931. /* DWORD 1:num of records */
  7932. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7933. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7934. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7935. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7936. HTT_RX_FSE_SETUP_NUM_REC_S)
  7937. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7938. do { \
  7939. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7940. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7941. } while (0)
  7942. /* DWORD 1:max_search */
  7943. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7944. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7945. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7946. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7947. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7948. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7949. do { \
  7950. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7951. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7952. } while (0)
  7953. /* DWORD 1:ip_da_sa prefix */
  7954. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7955. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7956. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7957. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7958. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7959. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7960. do { \
  7961. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7962. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7963. } while (0)
  7964. /* DWORD 2: Base Address LO */
  7965. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7966. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7967. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7968. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7969. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7970. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7973. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7974. } while (0)
  7975. /* DWORD 3: Base Address High */
  7976. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7977. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7978. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7979. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7980. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7981. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7982. do { \
  7983. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7984. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7985. } while (0)
  7986. /* DWORD 4-12: Hash Value */
  7987. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7988. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7989. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7990. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7991. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7992. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7993. do { \
  7994. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7995. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7996. } while (0)
  7997. /* DWORD 13: Hash Value 314:288 bits */
  7998. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7999. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8000. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8001. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8002. do { \
  8003. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8004. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8005. } while (0)
  8006. /**
  8007. * @brief Host-->target HTT RX FSE operation message
  8008. *
  8009. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8010. *
  8011. * @details
  8012. * The host will send this Flow Search Engine (FSE) operation message for
  8013. * every flow add/delete operation.
  8014. * The FSE operation includes FSE full cache invalidation or individual entry
  8015. * invalidation.
  8016. * This message can be sent per SOC or per PDEV which is differentiated
  8017. * by pdev id values.
  8018. *
  8019. * |31 16|15 8|7 1|0|
  8020. * |-------------------------------------------------------------|
  8021. * | reserved | pdev_id | MSG_TYPE |
  8022. * |-------------------------------------------------------------|
  8023. * | reserved | operation |I|
  8024. * |-------------------------------------------------------------|
  8025. * | ip_src_addr_31_0 |
  8026. * |-------------------------------------------------------------|
  8027. * | ip_src_addr_63_32 |
  8028. * |-------------------------------------------------------------|
  8029. * | ip_src_addr_95_64 |
  8030. * |-------------------------------------------------------------|
  8031. * | ip_src_addr_127_96 |
  8032. * |-------------------------------------------------------------|
  8033. * | ip_dst_addr_31_0 |
  8034. * |-------------------------------------------------------------|
  8035. * | ip_dst_addr_63_32 |
  8036. * |-------------------------------------------------------------|
  8037. * | ip_dst_addr_95_64 |
  8038. * |-------------------------------------------------------------|
  8039. * | ip_dst_addr_127_96 |
  8040. * |-------------------------------------------------------------|
  8041. * | l4_dst_port | l4_src_port |
  8042. * | (32-bit SPI incase of IPsec) |
  8043. * |-------------------------------------------------------------|
  8044. * | reserved | l4_proto |
  8045. * |-------------------------------------------------------------|
  8046. *
  8047. * where I is 1-bit ipsec_valid.
  8048. *
  8049. * The following field definitions describe the format of the RX FSE operation
  8050. * message sent from the host to target for every add/delete flow entry to flow
  8051. * table.
  8052. *
  8053. * Header fields:
  8054. * dword0 - b'7:0 - msg_type: This will be set to
  8055. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8056. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8057. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8058. * specified pdev's LMAC ring.
  8059. * b'31:16 - reserved : Reserved for future use
  8060. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8061. * (Internet Protocol Security).
  8062. * IPsec describes the framework for providing security at
  8063. * IP layer. IPsec is defined for both versions of IP:
  8064. * IPV4 and IPV6.
  8065. * Please refer to htt_rx_flow_proto enumeration below for
  8066. * more info.
  8067. * ipsec_valid = 1 for IPSEC packets
  8068. * ipsec_valid = 0 for IP Packets
  8069. * b'7:1 - operation: This indicates types of FSE operation.
  8070. * Refer to htt_rx_fse_operation enumeration:
  8071. * 0 - No Cache Invalidation required
  8072. * 1 - Cache invalidate only one entry given by IP
  8073. * src/dest address at DWORD[2:9]
  8074. * 2 - Complete FSE Cache Invalidation
  8075. * 3 - FSE Disable
  8076. * 4 - FSE Enable
  8077. * b'31:8 - reserved: Reserved for future use
  8078. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8079. * for per flow addition/deletion
  8080. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8081. * and the subsequent 3 A_UINT32 will be padding bytes.
  8082. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8083. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8084. * from 0 to 65535 but only 0 to 1023 are designated as
  8085. * well-known ports. Refer to [RFC1700] for more details.
  8086. * This field is valid only if
  8087. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8088. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8089. * range from 0 to 65535 but only 0 to 1023 are designated
  8090. * as well-known ports. Refer to [RFC1700] for more details.
  8091. * This field is valid only if
  8092. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8093. * - SPI (31:0): Security Parameters Index is an
  8094. * identification tag added to the header while using IPsec
  8095. * for tunneling the IP traffici.
  8096. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8097. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8098. * Assigned Internet Protocol Numbers.
  8099. * l4_proto numbers for standard protocol like UDP/TCP
  8100. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8101. * l4_proto = 17 for UDP etc.
  8102. * b'31:8 - reserved: Reserved for future use.
  8103. *
  8104. */
  8105. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8106. A_UINT32 msg_type:8,
  8107. pdev_id:8,
  8108. reserved0:16;
  8109. A_UINT32 ipsec_valid:1,
  8110. operation:7,
  8111. reserved1:24;
  8112. A_UINT32 ip_src_addr_31_0;
  8113. A_UINT32 ip_src_addr_63_32;
  8114. A_UINT32 ip_src_addr_95_64;
  8115. A_UINT32 ip_src_addr_127_96;
  8116. A_UINT32 ip_dest_addr_31_0;
  8117. A_UINT32 ip_dest_addr_63_32;
  8118. A_UINT32 ip_dest_addr_95_64;
  8119. A_UINT32 ip_dest_addr_127_96;
  8120. union {
  8121. A_UINT32 spi;
  8122. struct {
  8123. A_UINT32 l4_src_port:16,
  8124. l4_dest_port:16;
  8125. } ip;
  8126. } u;
  8127. A_UINT32 l4_proto:8,
  8128. reserved:24;
  8129. } POSTPACK;
  8130. /**
  8131. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8132. *
  8133. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8134. *
  8135. * @details
  8136. * The host will send this Full monitor mode register configuration message.
  8137. * This message can be sent per SOC or per PDEV which is differentiated
  8138. * by pdev id values.
  8139. *
  8140. * |31 16|15 11|10 8|7 3|2|1|0|
  8141. * |-------------------------------------------------------------|
  8142. * | reserved | pdev_id | MSG_TYPE |
  8143. * |-------------------------------------------------------------|
  8144. * | reserved |Release Ring |N|Z|E|
  8145. * |-------------------------------------------------------------|
  8146. *
  8147. * where E is 1-bit full monitor mode enable/disable.
  8148. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8149. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8150. *
  8151. * The following field definitions describe the format of the full monitor
  8152. * mode configuration message sent from the host to target for each pdev.
  8153. *
  8154. * Header fields:
  8155. * dword0 - b'7:0 - msg_type: This will be set to
  8156. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8157. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8158. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8159. * specified pdev's LMAC ring.
  8160. * b'31:16 - reserved : Reserved for future use.
  8161. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8162. * monitor mode rxdma register is to be enabled or disabled.
  8163. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8164. * additional descriptors at ppdu end for zero mpdus
  8165. * enabled or disabled.
  8166. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8167. * additional descriptors at ppdu end for non zero mpdus
  8168. * enabled or disabled.
  8169. * b'10:3 - release_ring: This indicates the destination ring
  8170. * selection for the descriptor at the end of PPDU
  8171. * 0 - REO ring select
  8172. * 1 - FW ring select
  8173. * 2 - SW ring select
  8174. * 3 - Release ring select
  8175. * Refer to htt_rx_full_mon_release_ring.
  8176. * b'31:11 - reserved for future use
  8177. */
  8178. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8179. A_UINT32 msg_type:8,
  8180. pdev_id:8,
  8181. reserved0:16;
  8182. A_UINT32 full_monitor_mode_enable:1,
  8183. addnl_descs_zero_mpdus_end:1,
  8184. addnl_descs_non_zero_mpdus_end:1,
  8185. release_ring:8,
  8186. reserved1:21;
  8187. } POSTPACK;
  8188. /**
  8189. * Enumeration for full monitor mode destination ring select
  8190. * 0 - REO destination ring select
  8191. * 1 - FW destination ring select
  8192. * 2 - SW destination ring select
  8193. * 3 - Release destination ring select
  8194. */
  8195. enum htt_rx_full_mon_release_ring {
  8196. HTT_RX_MON_RING_REO,
  8197. HTT_RX_MON_RING_FW,
  8198. HTT_RX_MON_RING_SW,
  8199. HTT_RX_MON_RING_RELEASE,
  8200. };
  8201. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8202. /* DWORD 0: Pdev ID */
  8203. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8204. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8205. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8206. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8207. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8208. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8209. do { \
  8210. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8211. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8212. } while (0)
  8213. /* DWORD 1:ENABLE */
  8214. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8215. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8216. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8217. do { \
  8218. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8219. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8220. } while (0)
  8221. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8222. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8223. /* DWORD 1:ZERO_MPDU */
  8224. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8225. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8226. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8227. do { \
  8228. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8229. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8230. } while (0)
  8231. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8232. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8233. /* DWORD 1:NON_ZERO_MPDU */
  8234. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8235. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8236. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8237. do { \
  8238. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8239. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8240. } while (0)
  8241. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8242. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8243. /* DWORD 1:RELEASE_RINGS */
  8244. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8245. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8246. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8247. do { \
  8248. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8249. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8250. } while (0)
  8251. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8252. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8253. /**
  8254. * Enumeration for IP Protocol or IPSEC Protocol
  8255. * IPsec describes the framework for providing security at IP layer.
  8256. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8257. */
  8258. enum htt_rx_flow_proto {
  8259. HTT_RX_FLOW_IP_PROTO,
  8260. HTT_RX_FLOW_IPSEC_PROTO,
  8261. };
  8262. /**
  8263. * Enumeration for FSE Cache Invalidation
  8264. * 0 - No Cache Invalidation required
  8265. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8266. * 2 - Complete FSE Cache Invalidation
  8267. * 3 - FSE Disable
  8268. * 4 - FSE Enable
  8269. */
  8270. enum htt_rx_fse_operation {
  8271. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8272. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8273. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8274. HTT_RX_FSE_DISABLE,
  8275. HTT_RX_FSE_ENABLE,
  8276. };
  8277. /* DWORD 0: Pdev ID */
  8278. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8279. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8280. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8281. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8282. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8283. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8286. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8287. } while (0)
  8288. /* DWORD 1:IP PROTO or IPSEC */
  8289. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8290. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8291. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8292. do { \
  8293. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8294. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8295. } while (0)
  8296. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8297. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8298. /* DWORD 1:FSE Operation */
  8299. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8300. #define HTT_RX_FSE_OPERATION_S 1
  8301. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8302. do { \
  8303. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8304. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8305. } while (0)
  8306. #define HTT_RX_FSE_OPERATION_GET(word) \
  8307. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8308. /* DWORD 2-9:IP Address */
  8309. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8310. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8311. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8312. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8313. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8314. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8315. do { \
  8316. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8317. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8318. } while (0)
  8319. /* DWORD 10:Source Port Number */
  8320. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8321. #define HTT_RX_FSE_SOURCEPORT_S 0
  8322. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8325. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8326. } while (0)
  8327. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8328. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8329. /* DWORD 11:Destination Port Number */
  8330. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8331. #define HTT_RX_FSE_DESTPORT_S 16
  8332. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8333. do { \
  8334. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8335. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8336. } while (0)
  8337. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8338. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8339. /* DWORD 10-11:SPI (In case of IPSEC) */
  8340. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8341. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8342. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8343. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8344. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8345. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8346. do { \
  8347. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8348. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8349. } while (0)
  8350. /* DWORD 12:L4 PROTO */
  8351. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8352. #define HTT_RX_FSE_L4_PROTO_S 0
  8353. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8356. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8357. } while (0)
  8358. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8359. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8360. /**
  8361. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8362. *
  8363. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8364. *
  8365. * |31 24|23 |15 8|7 2|1|0|
  8366. * |----------------+----------------+----------------+----------------|
  8367. * | reserved | pdev_id | msg_type |
  8368. * |---------------------------------+----------------+----------------|
  8369. * | reserved |E|F|
  8370. * |---------------------------------+----------------+----------------|
  8371. * Where E = Configure the target to provide the 3-tuple hash value in
  8372. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8373. * F = Configure the target to provide the 3-tuple hash value in
  8374. * flow_id_toeplitz field of rx_msdu_start tlv
  8375. *
  8376. * The following field definitions describe the format of the 3 tuple hash value
  8377. * message sent from the host to target as part of initialization sequence.
  8378. *
  8379. * Header fields:
  8380. * dword0 - b'7:0 - msg_type: This will be set to
  8381. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8382. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8383. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8384. * specified pdev's LMAC ring.
  8385. * b'31:16 - reserved : Reserved for future use
  8386. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8387. * b'1 - toeplitz_hash_2_or_4_field_enable
  8388. * b'31:2 - reserved : Reserved for future use
  8389. * ---------+------+----------------------------------------------------------
  8390. * bit1 | bit0 | Functionality
  8391. * ---------+------+----------------------------------------------------------
  8392. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8393. * | | in flow_id_toeplitz field
  8394. * ---------+------+----------------------------------------------------------
  8395. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8396. * | | in toeplitz_hash_2_or_4 field
  8397. * ---------+------+----------------------------------------------------------
  8398. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8399. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8400. * ---------+------+----------------------------------------------------------
  8401. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8402. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8403. * | | toeplitz_hash_2_or_4 field
  8404. *----------------------------------------------------------------------------
  8405. */
  8406. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8407. A_UINT32 msg_type :8,
  8408. pdev_id :8,
  8409. reserved0 :16;
  8410. A_UINT32 flow_id_toeplitz_field_enable :1,
  8411. toeplitz_hash_2_or_4_field_enable :1,
  8412. reserved1 :30;
  8413. } POSTPACK;
  8414. /* DWORD0 : pdev_id configuration Macros */
  8415. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8416. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8417. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8418. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8419. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8420. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8421. do { \
  8422. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8423. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8424. } while (0)
  8425. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8426. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8427. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8428. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8429. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8430. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8431. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8432. do { \
  8433. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8434. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8435. } while (0)
  8436. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8437. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8438. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8439. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8440. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8441. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8444. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8445. } while (0)
  8446. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8447. /**
  8448. * @brief host --> target Host PA Address Size
  8449. *
  8450. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8451. *
  8452. * @details
  8453. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8454. * provide the physical start address and size of each of the memory
  8455. * areas within host DDR that the target FW may need to access.
  8456. *
  8457. * For example, the host can use this message to allow the target FW
  8458. * to set up access to the host's pools of TQM link descriptors.
  8459. * The message would appear as follows:
  8460. *
  8461. * |31 24|23 16|15 8|7 0|
  8462. * |----------------+----------------+----------------+----------------|
  8463. * | reserved | num_entries | msg_type |
  8464. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8465. * | mem area 0 size |
  8466. * |----------------+----------------+----------------+----------------|
  8467. * | mem area 0 physical_address_lo |
  8468. * |----------------+----------------+----------------+----------------|
  8469. * | mem area 0 physical_address_hi |
  8470. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8471. * | mem area 1 size |
  8472. * |----------------+----------------+----------------+----------------|
  8473. * | mem area 1 physical_address_lo |
  8474. * |----------------+----------------+----------------+----------------|
  8475. * | mem area 1 physical_address_hi |
  8476. * |----------------+----------------+----------------+----------------|
  8477. * ...
  8478. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8479. * | mem area N size |
  8480. * |----------------+----------------+----------------+----------------|
  8481. * | mem area N physical_address_lo |
  8482. * |----------------+----------------+----------------+----------------|
  8483. * | mem area N physical_address_hi |
  8484. * |----------------+----------------+----------------+----------------|
  8485. *
  8486. * The message is interpreted as follows:
  8487. * dword0 - b'0:7 - msg_type: This will be set to
  8488. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8489. * b'8:15 - number_entries: Indicated the number of host memory
  8490. * areas specified within the remainder of the message
  8491. * b'16:31 - reserved.
  8492. * dword1 - b'0:31 - memory area 0 size in bytes
  8493. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8494. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8495. * and similar for memory area 1 through memory area N.
  8496. */
  8497. PREPACK struct htt_h2t_host_paddr_size {
  8498. A_UINT32 msg_type: 8,
  8499. num_entries: 8,
  8500. reserved: 16;
  8501. } POSTPACK;
  8502. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8503. A_UINT32 size;
  8504. A_UINT32 physical_address_lo;
  8505. A_UINT32 physical_address_hi;
  8506. } POSTPACK;
  8507. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8508. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8509. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8510. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8511. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8512. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8513. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8514. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8515. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8516. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8517. do { \
  8518. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8519. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8520. } while (0)
  8521. /**
  8522. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8523. *
  8524. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8525. *
  8526. * @details
  8527. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8528. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8529. *
  8530. * The message would appear as follows:
  8531. *
  8532. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8533. * |---------------------------------+---+---+----------+-+-----------|
  8534. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8535. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8536. *
  8537. *
  8538. * The message is interpreted as follows:
  8539. * dword0 - b'0:7 - msg_type: This will be set to
  8540. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8541. * b'8 - override bit to drive MSDUs to PPE ring
  8542. * b'9:13 - REO destination ring indication
  8543. * b'14 - Multi buffer msdu override enable bit
  8544. * b'15 - Intra BSS override
  8545. * b'16 - Decap raw override
  8546. * b'17 - Decap Native wifi override
  8547. * b'18 - IP frag override
  8548. * b'19:31 - reserved
  8549. */
  8550. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8551. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8552. override: 1,
  8553. reo_destination_indication: 5,
  8554. multi_buffer_msdu_override_en: 1,
  8555. intra_bss_override: 1,
  8556. decap_raw_override: 1,
  8557. decap_nwifi_override: 1,
  8558. ip_frag_override: 1,
  8559. reserved: 13;
  8560. } POSTPACK;
  8561. /* DWORD 0: Override */
  8562. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8563. #define HTT_PPE_CFG_OVERRIDE_S 8
  8564. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8565. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8566. HTT_PPE_CFG_OVERRIDE_S)
  8567. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8568. do { \
  8569. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8570. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8571. } while (0)
  8572. /* DWORD 0: REO Destination Indication*/
  8573. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8574. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8575. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8576. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8577. HTT_PPE_CFG_REO_DEST_IND_S)
  8578. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8579. do { \
  8580. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8581. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8582. } while (0)
  8583. /* DWORD 0: Multi buffer MSDU override */
  8584. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8585. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8586. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8587. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8588. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8589. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8592. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8593. } while (0)
  8594. /* DWORD 0: Intra BSS override */
  8595. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8596. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8597. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8598. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8599. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8600. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8601. do { \
  8602. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8603. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8604. } while (0)
  8605. /* DWORD 0: Decap RAW override */
  8606. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8607. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8608. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8609. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8610. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8611. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8612. do { \
  8613. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8614. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8615. } while (0)
  8616. /* DWORD 0: Decap NWIFI override */
  8617. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8618. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8619. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8620. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8621. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8622. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8623. do { \
  8624. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8625. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8626. } while (0)
  8627. /* DWORD 0: IP frag override */
  8628. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8629. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8630. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8631. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8632. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8633. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8634. do { \
  8635. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8636. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8637. } while (0)
  8638. /*
  8639. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8640. *
  8641. * @details
  8642. * The following field definitions describe the format of the HTT host
  8643. * to target FW VDEV TX RX stats retrieve message.
  8644. * The message specifies the type of stats the host wants to retrieve.
  8645. *
  8646. * |31 27|26 25|24 17|16|15 8|7 0|
  8647. * |-----------------------------------------------------------|
  8648. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8649. * |-----------------------------------------------------------|
  8650. * | vdev_id lower bitmask |
  8651. * |-----------------------------------------------------------|
  8652. * | vdev_id upper bitmask |
  8653. * |-----------------------------------------------------------|
  8654. * Header fields:
  8655. * Where:
  8656. * dword0 - b'7:0 - msg_type: This will be set to
  8657. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8658. * b'15:8 - pdev id
  8659. * b'16(E) - Enable/Disable the vdev HW stats
  8660. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8661. * b'25:26(R) - Reset stats bits
  8662. * 0: don't reset stats
  8663. * 1: reset stats once
  8664. * 2: reset stats at the start of each periodic interval
  8665. * b'27:31 - reserved for future use
  8666. * dword1 - b'0:31 - vdev_id lower bitmask
  8667. * dword2 - b'0:31 - vdev_id upper bitmask
  8668. */
  8669. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8670. A_UINT32 msg_type :8,
  8671. pdev_id :8,
  8672. enable :1,
  8673. periodic_interval :8,
  8674. reset_stats_bits :2,
  8675. reserved0 :5;
  8676. A_UINT32 vdev_id_lower_bitmask;
  8677. A_UINT32 vdev_id_upper_bitmask;
  8678. } POSTPACK;
  8679. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8680. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8681. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8682. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8683. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8684. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8685. do { \
  8686. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8687. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8688. } while (0)
  8689. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8690. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8691. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8692. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8693. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8694. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8697. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8698. } while (0)
  8699. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8700. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8701. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8702. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8703. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8704. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8705. do { \
  8706. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8707. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8708. } while (0)
  8709. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8710. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8711. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8712. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8713. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8714. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8715. do { \
  8716. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8717. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8718. } while (0)
  8719. /*
  8720. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8721. *
  8722. * @details
  8723. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8724. * the default MSDU queues for one of the TIDs within the specified peer
  8725. * to the specified service class.
  8726. * The TID is indirectly specified - each service class is associated
  8727. * with a TID. All default MSDU queues for this peer-TID will be
  8728. * linked to the service class in question.
  8729. *
  8730. * |31 16|15 8|7 0|
  8731. * |------------------------------+--------------+--------------|
  8732. * | peer ID | svc class ID | msg type |
  8733. * |------------------------------------------------------------|
  8734. * Header fields:
  8735. * dword0 - b'7:0 - msg_type: This will be set to
  8736. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8737. * b'15:8 - service class ID
  8738. * b'31:16 - peer ID
  8739. */
  8740. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8741. A_UINT32 msg_type :8,
  8742. svc_class_id :8,
  8743. peer_id :16;
  8744. } POSTPACK;
  8745. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8746. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8747. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8748. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8749. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8750. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8751. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8752. do { \
  8753. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8754. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8755. } while (0)
  8756. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8757. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8758. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8759. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8760. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8761. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8762. do { \
  8763. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8764. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8765. } while (0)
  8766. /*
  8767. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8768. *
  8769. * @details
  8770. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8771. * remove the linkage of the specified peer-TID's MSDU queues to
  8772. * service classes.
  8773. *
  8774. * |31 16|15 8|7 0|
  8775. * |------------------------------+--------------+--------------|
  8776. * | peer ID | svc class ID | msg type |
  8777. * |------------------------------------------------------------|
  8778. * Header fields:
  8779. * dword0 - b'7:0 - msg_type: This will be set to
  8780. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8781. * b'15:8 - service class ID
  8782. * b'31:16 - peer ID
  8783. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8784. * value for peer ID indicates that the target should
  8785. * apply the UNMAP_REQ to all peers.
  8786. */
  8787. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8788. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8789. A_UINT32 msg_type :8,
  8790. svc_class_id :8,
  8791. peer_id :16;
  8792. } POSTPACK;
  8793. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8794. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8795. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8796. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8797. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8798. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8799. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8800. do { \
  8801. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8802. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8803. } while (0)
  8804. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8805. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8806. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8807. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8808. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8809. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8810. do { \
  8811. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8812. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8813. } while (0)
  8814. /*
  8815. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8816. *
  8817. * @details
  8818. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8819. * request the target to report what service class the default MSDU queues
  8820. * of the specified TIDs within the peer are linked to.
  8821. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8822. * to report what service class (if any) the default MSDU queues for
  8823. * each of the specified TIDs are linked to.
  8824. *
  8825. * |31 16|15 8|7 1| 0|
  8826. * |------------------------------+--------------+--------------|
  8827. * | peer ID | TID mask | msg type |
  8828. * |------------------------------------------------------------|
  8829. * | reserved |ETO|
  8830. * |------------------------------------------------------------|
  8831. * Header fields:
  8832. * dword0 - b'7:0 - msg_type: This will be set to
  8833. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8834. * b'15:8 - TID mask
  8835. * b'31:16 - peer ID
  8836. * dword1 - b'0 - "Existing Tids Only" flag
  8837. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8838. * message generated by this REQ will only show the
  8839. * mapping for TIDs that actually exist in the target's
  8840. * peer object.
  8841. * Any TIDs that are covered by a MAP_REQ but which
  8842. * do not actually exist will be shown as being
  8843. * unmapped (i.e. svc class ID 0xff).
  8844. * If this flag is cleared, the MAP_REPORT_CONF message
  8845. * will consider not only the mapping of TIDs currently
  8846. * existing in the peer, but also the mapping that will
  8847. * be applied for any TID objects created within this
  8848. * peer in the future.
  8849. * b'31:1 - reserved for future use
  8850. */
  8851. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8852. A_UINT32 msg_type :8,
  8853. tid_mask :8,
  8854. peer_id :16;
  8855. A_UINT32 existing_tids_only:1,
  8856. reserved :31;
  8857. } POSTPACK;
  8858. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8859. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8860. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8861. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8862. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8863. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8864. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8865. do { \
  8866. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8867. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8868. } while (0)
  8869. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8870. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8871. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8872. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8873. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8874. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8875. do { \
  8876. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8877. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8878. } while (0)
  8879. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8880. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8881. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8882. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8883. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8884. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8885. do { \
  8886. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8887. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8888. } while (0)
  8889. /**
  8890. * @brief Format of shared memory between Host and Target
  8891. * for UMAC hang recovery feature messaging.
  8892. * @details
  8893. * This is shared memory between Host and Target allocated
  8894. * and used in chips where UMAC hang recovery feature is supported.
  8895. * This shared memory is allocated per SOC level by Host since each
  8896. * SOC's target Q6FW needs to communicate independently to the Host
  8897. * through its own shared memory.
  8898. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8899. * then host interprets it as a new message from target.
  8900. * Host clears that particular read bit in t2h_msg after each read
  8901. * operation. It is vice versa for h2t_msg. At any given point
  8902. * of time there is expected to be only one bit set
  8903. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8904. *
  8905. * The message is interpreted as follows:
  8906. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8907. * added for debuggability purpose.
  8908. * dword1 - b'0 - do_pre_reset
  8909. * b'1 - do_post_reset_start
  8910. * b'2 - do_post_reset_complete
  8911. * b'3 - initiate_umac_recovery
  8912. * b'4:31 - rsvd_t2h
  8913. * dword2 - b'0 - pre_reset_done
  8914. * b'1 - post_reset_start_done
  8915. * b'2 - post_reset_complete_done
  8916. * b'3 - start_pre_reset
  8917. * b'4:31 - rsvd_h2t
  8918. */
  8919. PREPACK typedef struct {
  8920. /** Magic number added for debuggability. */
  8921. A_UINT32 magic_num;
  8922. union {
  8923. /*
  8924. * BIT [0] :- T2H msg to do pre-reset
  8925. * BIT [1] :- T2H msg to do post-reset start
  8926. * BIT [2] :- T2H msg to do post-reset complete
  8927. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8928. * This is needed to synchronize UMAC recovery
  8929. * across all SOCs.
  8930. * BIT [31 : 4] :- reserved
  8931. */
  8932. A_UINT32 t2h_msg;
  8933. struct {
  8934. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8935. do_post_reset_start : 1, /* BIT [1] */
  8936. do_post_reset_complete : 1, /* BIT [2] */
  8937. initiate_umac_recovery : 1, /* BIT [3] */
  8938. rsvd_t2h : 28; /* BIT [31 : 4] */
  8939. };
  8940. };
  8941. union {
  8942. /*
  8943. * BIT [0] :- H2T msg to send pre-reset done
  8944. * BIT [1] :- H2T msg to send post-reset start done
  8945. * BIT [2] :- H2T msg to send post-reset complete done
  8946. * BIT [3] :- H2T msg to start pre-reset.
  8947. * This is expected only after T2H
  8948. * initiate_umac_recovery was received by Host
  8949. * from one of the SOCs.
  8950. * BIT [31 : 4] :- reserved
  8951. */
  8952. A_UINT32 h2t_msg;
  8953. struct {
  8954. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8955. post_reset_start_done : 1, /* BIT [1] */
  8956. post_reset_complete_done : 1, /* BIT [2] */
  8957. start_pre_reset : 1, /* BIT [3] */
  8958. rsvd_h2t : 28; /* BIT [31 : 4] */
  8959. };
  8960. };
  8961. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8962. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8963. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8964. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8965. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8966. /* dword1 - b'0 - do_pre_reset */
  8967. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8968. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8969. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8970. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8971. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8972. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8975. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8976. } while (0)
  8977. /* dword1 - b'1 - do_post_reset_start */
  8978. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8979. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8980. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8981. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8982. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8983. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8986. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8987. } while (0)
  8988. /* dword1 - b'2 - do_post_reset_complete */
  8989. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8990. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8991. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8992. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8993. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8994. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8997. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8998. } while (0)
  8999. /* dword1 - b'3 - initiate_umac_recovery */
  9000. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9001. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9002. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9003. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9004. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9005. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9008. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9009. } while (0)
  9010. /* dword2 - b'0 - pre_reset_done */
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9012. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9013. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9014. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9015. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9016. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9017. do { \
  9018. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9019. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9020. } while (0)
  9021. /* dword2 - b'1 - post_reset_start_done */
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9023. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9024. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9025. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9026. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9027. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9028. do { \
  9029. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9030. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9031. } while (0)
  9032. /* dword2 - b'2 - post_reset_complete_done */
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9034. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9035. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9036. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9037. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9038. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9039. do { \
  9040. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9041. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9042. } while (0)
  9043. /* dword2 - b'3 - start_pre_reset */
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9045. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9046. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9047. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9048. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9049. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9050. do { \
  9051. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9052. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9053. } while (0)
  9054. /**
  9055. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9056. *
  9057. * @details
  9058. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9059. * by the host to provide prerequisite info to target for the UMAC hang
  9060. * recovery feature.
  9061. * The info sent in this H2T message are T2H message method, H2T message
  9062. * method, T2H MSI interrupt number and physical start address, size of
  9063. * the shared memory (refers to the shared memory dedicated for messaging
  9064. * between host and target when the DUT is in UMAC hang recovery mode).
  9065. * This H2T message is expected to be only sent if the WMI service bit
  9066. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9067. *
  9068. * |31 16|15 12|11 8|7 0|
  9069. * |-------------------------------+--------------+--------------+------------|
  9070. * | reserved |h2t msg method|t2h msg method| msg_type |
  9071. * |--------------------------------------------------------------------------|
  9072. * | t2h msi interrupt number |
  9073. * |--------------------------------------------------------------------------|
  9074. * | shared memory area size |
  9075. * |--------------------------------------------------------------------------|
  9076. * | shared memory area physical address low |
  9077. * |--------------------------------------------------------------------------|
  9078. * | shared memory area physical address high |
  9079. * |--------------------------------------------------------------------------|
  9080. *
  9081. * The message is interpreted as follows:
  9082. * dword0 - b'0:7 - msg_type
  9083. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9084. * b'8:11 - t2h_msg_method: indicates method to be used for
  9085. * T2H communication in UMAC hang recovery mode.
  9086. * Value zero indicates MSI interrupt (default method).
  9087. * Refer to htt_umac_hang_recovery_msg_method enum.
  9088. * b'12:15 - h2t_msg_method: indicates method to be used for
  9089. * H2T communication in UMAC hang recovery mode.
  9090. * Value zero indicates polling by target for this h2t msg
  9091. * during UMAC hang recovery mode.
  9092. * Refer to htt_umac_hang_recovery_msg_method enum.
  9093. * b'16:31 - reserved.
  9094. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9095. * T2H communication in UMAC hang recovery mode.
  9096. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9097. * only when in UMAC hang recovery mode.
  9098. * This refers to size in bytes.
  9099. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9100. * of the shared memory dedicated for messaging only when
  9101. * in UMAC hang recovery mode.
  9102. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9103. * of the shared memory dedicated for messaging only when
  9104. * in UMAC hang recovery mode.
  9105. */
  9106. /* t2h_msg_method and h2t_msg_method */
  9107. enum htt_umac_hang_recovery_msg_method {
  9108. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9109. };
  9110. PREPACK typedef struct {
  9111. A_UINT32 msg_type : 8,
  9112. t2h_msg_method : 4,
  9113. h2t_msg_method : 4,
  9114. reserved : 16;
  9115. A_UINT32 t2h_msi_data;
  9116. /* size bytes and physical address of shared memory. */
  9117. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9118. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9119. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9120. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9121. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9122. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9123. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9124. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9125. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9126. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9127. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9128. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9131. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9132. } while (0)
  9133. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9134. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9135. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9136. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9137. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9138. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9141. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9142. } while (0)
  9143. /**
  9144. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9145. *
  9146. * @details
  9147. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9148. * HTT message sent by the host to indicate that the target needs to start the
  9149. * UMAC hang recovery feature from the point of pre-reset routine.
  9150. * The purpose of this H2T message is to have host synchronize and trigger
  9151. * UMAC recovery across all targets.
  9152. * The info sent in this H2T message is the flag to indicate whether the
  9153. * target needs to execute UMAC-recovery in context of the Initiator or
  9154. * Non-Initiator.
  9155. * This H2T message is expected to be sent as response to the
  9156. * initiate_umac_recovery indication from the Initiator target attached to
  9157. * this same host.
  9158. * This H2T message is expected to be only sent if the WMI service bit
  9159. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9160. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9161. * beforehand.
  9162. *
  9163. * |31 9|8|7 0|
  9164. * |-----------------------------------------------------------|
  9165. * | reserved |I| msg_type |
  9166. * |-----------------------------------------------------------|
  9167. * Where:
  9168. * I = is_initiator
  9169. *
  9170. * The message is interpreted as follows:
  9171. * dword0 - b'0:7 - msg_type
  9172. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9173. * b'8 - is_initiator: indicates whether the target needs to
  9174. * execute the UMAC-recovery in context of the Initiator or
  9175. * Non-Initiator.
  9176. * The value zero indicates this target is Non-Initiator.
  9177. * b'9:31 - reserved.
  9178. */
  9179. PREPACK typedef struct {
  9180. A_UINT32 msg_type : 8,
  9181. is_initiator : 1,
  9182. reserved : 23;
  9183. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9184. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9185. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9186. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9187. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9188. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9189. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9190. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9191. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9192. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9193. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9196. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9197. } while (0)
  9198. /*=== target -> host messages ===============================================*/
  9199. enum htt_t2h_msg_type {
  9200. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9201. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9202. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9203. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9204. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9205. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9206. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9207. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9208. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9209. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9210. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9211. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9212. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9213. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9214. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9215. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9216. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9217. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9218. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9219. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9220. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9221. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9222. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9223. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9224. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9225. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9226. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9227. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9228. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9229. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9230. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9231. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9232. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9233. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9234. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9235. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9236. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9237. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9238. /* TX_OFFLOAD_DELIVER_IND:
  9239. * Forward the target's locally-generated packets to the host,
  9240. * to provide to the monitor mode interface.
  9241. */
  9242. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9243. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9244. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9245. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9246. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9247. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9248. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9249. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9250. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9251. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9252. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9253. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9254. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9255. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9256. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9257. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9258. HTT_T2H_MSG_TYPE_TEST,
  9259. /* keep this last */
  9260. HTT_T2H_NUM_MSGS
  9261. };
  9262. /*
  9263. * HTT target to host message type -
  9264. * stored in bits 7:0 of the first word of the message
  9265. */
  9266. #define HTT_T2H_MSG_TYPE_M 0xff
  9267. #define HTT_T2H_MSG_TYPE_S 0
  9268. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9269. do { \
  9270. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9271. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9272. } while (0)
  9273. #define HTT_T2H_MSG_TYPE_GET(word) \
  9274. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9275. /**
  9276. * @brief target -> host version number confirmation message definition
  9277. *
  9278. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9279. *
  9280. * |31 24|23 16|15 8|7 0|
  9281. * |----------------+----------------+----------------+----------------|
  9282. * | reserved | major number | minor number | msg type |
  9283. * |-------------------------------------------------------------------|
  9284. * : option request TLV (optional) |
  9285. * :...................................................................:
  9286. *
  9287. * The VER_CONF message may consist of a single 4-byte word, or may be
  9288. * extended with TLVs that specify HTT options selected by the target.
  9289. * The following option TLVs may be appended to the VER_CONF message:
  9290. * - LL_BUS_ADDR_SIZE
  9291. * - HL_SUPPRESS_TX_COMPL_IND
  9292. * - MAX_TX_QUEUE_GROUPS
  9293. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9294. * may be appended to the VER_CONF message (but only one TLV of each type).
  9295. *
  9296. * Header fields:
  9297. * - MSG_TYPE
  9298. * Bits 7:0
  9299. * Purpose: identifies this as a version number confirmation message
  9300. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9301. * - VER_MINOR
  9302. * Bits 15:8
  9303. * Purpose: Specify the minor number of the HTT message library version
  9304. * in use by the target firmware.
  9305. * The minor number specifies the specific revision within a range
  9306. * of fundamentally compatible HTT message definition revisions.
  9307. * Compatible revisions involve adding new messages or perhaps
  9308. * adding new fields to existing messages, in a backwards-compatible
  9309. * manner.
  9310. * Incompatible revisions involve changing the message type values,
  9311. * or redefining existing messages.
  9312. * Value: minor number
  9313. * - VER_MAJOR
  9314. * Bits 15:8
  9315. * Purpose: Specify the major number of the HTT message library version
  9316. * in use by the target firmware.
  9317. * The major number specifies the family of minor revisions that are
  9318. * fundamentally compatible with each other, but not with prior or
  9319. * later families.
  9320. * Value: major number
  9321. */
  9322. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9323. #define HTT_VER_CONF_MINOR_S 8
  9324. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9325. #define HTT_VER_CONF_MAJOR_S 16
  9326. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9329. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9330. } while (0)
  9331. #define HTT_VER_CONF_MINOR_GET(word) \
  9332. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9333. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9334. do { \
  9335. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9336. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9337. } while (0)
  9338. #define HTT_VER_CONF_MAJOR_GET(word) \
  9339. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9340. #define HTT_VER_CONF_BYTES 4
  9341. /**
  9342. * @brief - target -> host HTT Rx In order indication message
  9343. *
  9344. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9345. *
  9346. * @details
  9347. *
  9348. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9349. * |----------------+-------------------+---------------------+---------------|
  9350. * | peer ID | P| F| O| ext TID | msg type |
  9351. * |--------------------------------------------------------------------------|
  9352. * | MSDU count | Reserved | vdev id |
  9353. * |--------------------------------------------------------------------------|
  9354. * | MSDU 0 bus address (bits 31:0) |
  9355. #if HTT_PADDR64
  9356. * | MSDU 0 bus address (bits 63:32) |
  9357. #endif
  9358. * |--------------------------------------------------------------------------|
  9359. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9360. * |--------------------------------------------------------------------------|
  9361. * | MSDU 1 bus address (bits 31:0) |
  9362. #if HTT_PADDR64
  9363. * | MSDU 1 bus address (bits 63:32) |
  9364. #endif
  9365. * |--------------------------------------------------------------------------|
  9366. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9367. * |--------------------------------------------------------------------------|
  9368. */
  9369. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9370. *
  9371. * @details
  9372. * bits
  9373. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9374. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9375. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9376. * | | frag | | | | fail |chksum fail|
  9377. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9378. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9379. */
  9380. struct htt_rx_in_ord_paddr_ind_hdr_t
  9381. {
  9382. A_UINT32 /* word 0 */
  9383. msg_type: 8,
  9384. ext_tid: 5,
  9385. offload: 1,
  9386. frag: 1,
  9387. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9388. peer_id: 16;
  9389. A_UINT32 /* word 1 */
  9390. vap_id: 8,
  9391. /* NOTE:
  9392. * This reserved_1 field is not truly reserved - certain targets use
  9393. * this field internally to store debug information, and do not zero
  9394. * out the contents of the field before uploading the message to the
  9395. * host. Thus, any host-target communication supported by this field
  9396. * is limited to using values that are never used by the debug
  9397. * information stored by certain targets in the reserved_1 field.
  9398. * In particular, the targets in question don't use the value 0x3
  9399. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9400. * so this previously-unused value within these bits is available to
  9401. * use as the host / target PKT_CAPTURE_MODE flag.
  9402. */
  9403. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9404. /* if pkt_capture_mode == 0x3, host should
  9405. * send rx frames to monitor mode interface
  9406. */
  9407. msdu_cnt: 16;
  9408. };
  9409. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9410. {
  9411. A_UINT32 dma_addr;
  9412. A_UINT32
  9413. length: 16,
  9414. fw_desc: 8,
  9415. msdu_info:8;
  9416. };
  9417. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9418. {
  9419. A_UINT32 dma_addr_lo;
  9420. A_UINT32 dma_addr_hi;
  9421. A_UINT32
  9422. length: 16,
  9423. fw_desc: 8,
  9424. msdu_info:8;
  9425. };
  9426. #if HTT_PADDR64
  9427. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9428. #else
  9429. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9430. #endif
  9431. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9432. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9434. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9435. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9436. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9437. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9438. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9439. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9440. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9441. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9442. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9443. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9444. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9445. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9446. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9447. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9448. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9449. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9450. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9451. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9452. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9453. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9454. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9455. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9456. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9457. /* for systems using 64-bit format for bus addresses */
  9458. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9459. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9460. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9461. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9462. /* for systems using 32-bit format for bus addresses */
  9463. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9464. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9465. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9466. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9467. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9468. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9469. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9470. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9471. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9472. do { \
  9473. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9474. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9475. } while (0)
  9476. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9477. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9478. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9479. do { \
  9480. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9481. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9482. } while (0)
  9483. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9484. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9485. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9486. do { \
  9487. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9488. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9489. } while (0)
  9490. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9491. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9492. /*
  9493. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9494. * deliver the rx frames to the monitor mode interface.
  9495. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9496. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9497. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9498. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9499. */
  9500. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9501. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9502. do { \
  9503. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9504. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9505. } while (0)
  9506. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9507. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9508. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9509. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9510. do { \
  9511. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9512. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9513. } while (0)
  9514. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9515. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9516. /* for systems using 64-bit format for bus addresses */
  9517. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9518. do { \
  9519. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9520. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9521. } while (0)
  9522. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9523. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9524. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9525. do { \
  9526. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9527. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9528. } while (0)
  9529. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9530. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9531. /* for systems using 32-bit format for bus addresses */
  9532. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9533. do { \
  9534. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9535. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9536. } while (0)
  9537. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9538. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9539. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9540. do { \
  9541. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9542. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9543. } while (0)
  9544. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9545. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9546. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9547. do { \
  9548. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9549. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9550. } while (0)
  9551. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9552. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9553. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9554. do { \
  9555. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9556. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9557. } while (0)
  9558. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9559. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9560. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9561. do { \
  9562. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9563. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9564. } while (0)
  9565. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9566. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9567. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9568. do { \
  9569. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9570. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9571. } while (0)
  9572. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9573. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9574. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9575. do { \
  9576. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9577. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9578. } while (0)
  9579. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9580. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9581. /* definitions used within target -> host rx indication message */
  9582. PREPACK struct htt_rx_ind_hdr_prefix_t
  9583. {
  9584. A_UINT32 /* word 0 */
  9585. msg_type: 8,
  9586. ext_tid: 5,
  9587. release_valid: 1,
  9588. flush_valid: 1,
  9589. reserved0: 1,
  9590. peer_id: 16;
  9591. A_UINT32 /* word 1 */
  9592. flush_start_seq_num: 6,
  9593. flush_end_seq_num: 6,
  9594. release_start_seq_num: 6,
  9595. release_end_seq_num: 6,
  9596. num_mpdu_ranges: 8;
  9597. } POSTPACK;
  9598. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9599. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9600. #define HTT_TGT_RSSI_INVALID 0x80
  9601. PREPACK struct htt_rx_ppdu_desc_t
  9602. {
  9603. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9604. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9605. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9606. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9607. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9608. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9609. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9610. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9611. A_UINT32 /* word 0 */
  9612. rssi_cmb: 8,
  9613. timestamp_submicrosec: 8,
  9614. phy_err_code: 8,
  9615. phy_err: 1,
  9616. legacy_rate: 4,
  9617. legacy_rate_sel: 1,
  9618. end_valid: 1,
  9619. start_valid: 1;
  9620. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9621. union {
  9622. A_UINT32 /* word 1 */
  9623. rssi0_pri20: 8,
  9624. rssi0_ext20: 8,
  9625. rssi0_ext40: 8,
  9626. rssi0_ext80: 8;
  9627. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9628. } u0;
  9629. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9630. union {
  9631. A_UINT32 /* word 2 */
  9632. rssi1_pri20: 8,
  9633. rssi1_ext20: 8,
  9634. rssi1_ext40: 8,
  9635. rssi1_ext80: 8;
  9636. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9637. } u1;
  9638. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9639. union {
  9640. A_UINT32 /* word 3 */
  9641. rssi2_pri20: 8,
  9642. rssi2_ext20: 8,
  9643. rssi2_ext40: 8,
  9644. rssi2_ext80: 8;
  9645. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9646. } u2;
  9647. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9648. union {
  9649. A_UINT32 /* word 4 */
  9650. rssi3_pri20: 8,
  9651. rssi3_ext20: 8,
  9652. rssi3_ext40: 8,
  9653. rssi3_ext80: 8;
  9654. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9655. } u3;
  9656. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9657. A_UINT32 tsf32; /* word 5 */
  9658. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9659. A_UINT32 timestamp_microsec; /* word 6 */
  9660. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9661. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9662. A_UINT32 /* word 7 */
  9663. vht_sig_a1: 24,
  9664. preamble_type: 8;
  9665. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9666. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9667. A_UINT32 /* word 8 */
  9668. vht_sig_a2: 24,
  9669. /* sa_ant_matrix
  9670. * For cases where a single rx chain has options to be connected to
  9671. * different rx antennas, show which rx antennas were in use during
  9672. * receipt of a given PPDU.
  9673. * This sa_ant_matrix provides a bitmask of the antennas used while
  9674. * receiving this frame.
  9675. */
  9676. sa_ant_matrix: 8;
  9677. } POSTPACK;
  9678. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9679. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9680. PREPACK struct htt_rx_ind_hdr_suffix_t
  9681. {
  9682. A_UINT32 /* word 0 */
  9683. fw_rx_desc_bytes: 16,
  9684. reserved0: 16;
  9685. } POSTPACK;
  9686. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9687. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9688. PREPACK struct htt_rx_ind_hdr_t
  9689. {
  9690. struct htt_rx_ind_hdr_prefix_t prefix;
  9691. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9692. struct htt_rx_ind_hdr_suffix_t suffix;
  9693. } POSTPACK;
  9694. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9695. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9696. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9697. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9698. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9699. /*
  9700. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9701. * the offset into the HTT rx indication message at which the
  9702. * FW rx PPDU descriptor resides
  9703. */
  9704. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9705. /*
  9706. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9707. * the offset into the HTT rx indication message at which the
  9708. * header suffix (FW rx MSDU byte count) resides
  9709. */
  9710. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9711. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9712. /*
  9713. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9714. * the offset into the HTT rx indication message at which the per-MSDU
  9715. * information starts
  9716. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9717. * per-MSDU information portion of the message. The per-MSDU info itself
  9718. * starts at byte 12.
  9719. */
  9720. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9721. /**
  9722. * @brief target -> host rx indication message definition
  9723. *
  9724. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9725. *
  9726. * @details
  9727. * The following field definitions describe the format of the rx indication
  9728. * message sent from the target to the host.
  9729. * The message consists of three major sections:
  9730. * 1. a fixed-length header
  9731. * 2. a variable-length list of firmware rx MSDU descriptors
  9732. * 3. one or more 4-octet MPDU range information elements
  9733. * The fixed length header itself has two sub-sections
  9734. * 1. the message meta-information, including identification of the
  9735. * sender and type of the received data, and a 4-octet flush/release IE
  9736. * 2. the firmware rx PPDU descriptor
  9737. *
  9738. * The format of the message is depicted below.
  9739. * in this depiction, the following abbreviations are used for information
  9740. * elements within the message:
  9741. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9742. * elements associated with the PPDU start are valid.
  9743. * Specifically, the following fields are valid only if SV is set:
  9744. * RSSI (all variants), L, legacy rate, preamble type, service,
  9745. * VHT-SIG-A
  9746. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9747. * elements associated with the PPDU end are valid.
  9748. * Specifically, the following fields are valid only if EV is set:
  9749. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9750. * - L - Legacy rate selector - if legacy rates are used, this flag
  9751. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9752. * (L == 0) PHY.
  9753. * - P - PHY error flag - boolean indication of whether the rx frame had
  9754. * a PHY error
  9755. *
  9756. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9757. * |----------------+-------------------+---------------------+---------------|
  9758. * | peer ID | |RV|FV| ext TID | msg type |
  9759. * |--------------------------------------------------------------------------|
  9760. * | num | release | release | flush | flush |
  9761. * | MPDU | end | start | end | start |
  9762. * | ranges | seq num | seq num | seq num | seq num |
  9763. * |==========================================================================|
  9764. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9765. * |V|V| | rate | | | timestamp | RSSI |
  9766. * |--------------------------------------------------------------------------|
  9767. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9768. * |--------------------------------------------------------------------------|
  9769. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9770. * |--------------------------------------------------------------------------|
  9771. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9772. * |--------------------------------------------------------------------------|
  9773. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9774. * |--------------------------------------------------------------------------|
  9775. * | TSF LSBs |
  9776. * |--------------------------------------------------------------------------|
  9777. * | microsec timestamp |
  9778. * |--------------------------------------------------------------------------|
  9779. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9780. * |--------------------------------------------------------------------------|
  9781. * | service | HT-SIG / VHT-SIG-A2 |
  9782. * |==========================================================================|
  9783. * | reserved | FW rx desc bytes |
  9784. * |--------------------------------------------------------------------------|
  9785. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9786. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9787. * |--------------------------------------------------------------------------|
  9788. * : : :
  9789. * |--------------------------------------------------------------------------|
  9790. * | alignment | MSDU Rx |
  9791. * | padding | desc Bn |
  9792. * |--------------------------------------------------------------------------|
  9793. * | reserved | MPDU range status | MPDU count |
  9794. * |--------------------------------------------------------------------------|
  9795. * : reserved : MPDU range status : MPDU count :
  9796. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9797. *
  9798. * Header fields:
  9799. * - MSG_TYPE
  9800. * Bits 7:0
  9801. * Purpose: identifies this as an rx indication message
  9802. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9803. * - EXT_TID
  9804. * Bits 12:8
  9805. * Purpose: identify the traffic ID of the rx data, including
  9806. * special "extended" TID values for multicast, broadcast, and
  9807. * non-QoS data frames
  9808. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9809. * - FLUSH_VALID (FV)
  9810. * Bit 13
  9811. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9812. * is valid
  9813. * Value:
  9814. * 1 -> flush IE is valid and needs to be processed
  9815. * 0 -> flush IE is not valid and should be ignored
  9816. * - REL_VALID (RV)
  9817. * Bit 13
  9818. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9819. * is valid
  9820. * Value:
  9821. * 1 -> release IE is valid and needs to be processed
  9822. * 0 -> release IE is not valid and should be ignored
  9823. * - PEER_ID
  9824. * Bits 31:16
  9825. * Purpose: Identify, by ID, which peer sent the rx data
  9826. * Value: ID of the peer who sent the rx data
  9827. * - FLUSH_SEQ_NUM_START
  9828. * Bits 5:0
  9829. * Purpose: Indicate the start of a series of MPDUs to flush
  9830. * Not all MPDUs within this series are necessarily valid - the host
  9831. * must check each sequence number within this range to see if the
  9832. * corresponding MPDU is actually present.
  9833. * This field is only valid if the FV bit is set.
  9834. * Value:
  9835. * The sequence number for the first MPDUs to check to flush.
  9836. * The sequence number is masked by 0x3f.
  9837. * - FLUSH_SEQ_NUM_END
  9838. * Bits 11:6
  9839. * Purpose: Indicate the end of a series of MPDUs to flush
  9840. * Value:
  9841. * The sequence number one larger than the sequence number of the
  9842. * last MPDU to check to flush.
  9843. * The sequence number is masked by 0x3f.
  9844. * Not all MPDUs within this series are necessarily valid - the host
  9845. * must check each sequence number within this range to see if the
  9846. * corresponding MPDU is actually present.
  9847. * This field is only valid if the FV bit is set.
  9848. * - REL_SEQ_NUM_START
  9849. * Bits 17:12
  9850. * Purpose: Indicate the start of a series of MPDUs to release.
  9851. * All MPDUs within this series are present and valid - the host
  9852. * need not check each sequence number within this range to see if
  9853. * the corresponding MPDU is actually present.
  9854. * This field is only valid if the RV bit is set.
  9855. * Value:
  9856. * The sequence number for the first MPDUs to check to release.
  9857. * The sequence number is masked by 0x3f.
  9858. * - REL_SEQ_NUM_END
  9859. * Bits 23:18
  9860. * Purpose: Indicate the end of a series of MPDUs to release.
  9861. * Value:
  9862. * The sequence number one larger than the sequence number of the
  9863. * last MPDU to check to release.
  9864. * The sequence number is masked by 0x3f.
  9865. * All MPDUs within this series are present and valid - the host
  9866. * need not check each sequence number within this range to see if
  9867. * the corresponding MPDU is actually present.
  9868. * This field is only valid if the RV bit is set.
  9869. * - NUM_MPDU_RANGES
  9870. * Bits 31:24
  9871. * Purpose: Indicate how many ranges of MPDUs are present.
  9872. * Each MPDU range consists of a series of contiguous MPDUs within the
  9873. * rx frame sequence which all have the same MPDU status.
  9874. * Value: 1-63 (typically a small number, like 1-3)
  9875. *
  9876. * Rx PPDU descriptor fields:
  9877. * - RSSI_CMB
  9878. * Bits 7:0
  9879. * Purpose: Combined RSSI from all active rx chains, across the active
  9880. * bandwidth.
  9881. * Value: RSSI dB units w.r.t. noise floor
  9882. * - TIMESTAMP_SUBMICROSEC
  9883. * Bits 15:8
  9884. * Purpose: high-resolution timestamp
  9885. * Value:
  9886. * Sub-microsecond time of PPDU reception.
  9887. * This timestamp ranges from [0,MAC clock MHz).
  9888. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9889. * to form a high-resolution, large range rx timestamp.
  9890. * - PHY_ERR_CODE
  9891. * Bits 23:16
  9892. * Purpose:
  9893. * If the rx frame processing resulted in a PHY error, indicate what
  9894. * type of rx PHY error occurred.
  9895. * Value:
  9896. * This field is valid if the "P" (PHY_ERR) flag is set.
  9897. * TBD: document/specify the values for this field
  9898. * - PHY_ERR
  9899. * Bit 24
  9900. * Purpose: indicate whether the rx PPDU had a PHY error
  9901. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9902. * - LEGACY_RATE
  9903. * Bits 28:25
  9904. * Purpose:
  9905. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9906. * specify which rate was used.
  9907. * Value:
  9908. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9909. * flag.
  9910. * If LEGACY_RATE_SEL is 0:
  9911. * 0x8: OFDM 48 Mbps
  9912. * 0x9: OFDM 24 Mbps
  9913. * 0xA: OFDM 12 Mbps
  9914. * 0xB: OFDM 6 Mbps
  9915. * 0xC: OFDM 54 Mbps
  9916. * 0xD: OFDM 36 Mbps
  9917. * 0xE: OFDM 18 Mbps
  9918. * 0xF: OFDM 9 Mbps
  9919. * If LEGACY_RATE_SEL is 1:
  9920. * 0x8: CCK 11 Mbps long preamble
  9921. * 0x9: CCK 5.5 Mbps long preamble
  9922. * 0xA: CCK 2 Mbps long preamble
  9923. * 0xB: CCK 1 Mbps long preamble
  9924. * 0xC: CCK 11 Mbps short preamble
  9925. * 0xD: CCK 5.5 Mbps short preamble
  9926. * 0xE: CCK 2 Mbps short preamble
  9927. * - LEGACY_RATE_SEL
  9928. * Bit 29
  9929. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9930. * Value:
  9931. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9932. * used a legacy rate.
  9933. * 0 -> OFDM, 1 -> CCK
  9934. * - END_VALID
  9935. * Bit 30
  9936. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9937. * the start of the PPDU are valid. Specifically, the following
  9938. * fields are only valid if END_VALID is set:
  9939. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9940. * TIMESTAMP_SUBMICROSEC
  9941. * Value:
  9942. * 0 -> rx PPDU desc end fields are not valid
  9943. * 1 -> rx PPDU desc end fields are valid
  9944. * - START_VALID
  9945. * Bit 31
  9946. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9947. * the end of the PPDU are valid. Specifically, the following
  9948. * fields are only valid if START_VALID is set:
  9949. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9950. * VHT-SIG-A
  9951. * Value:
  9952. * 0 -> rx PPDU desc start fields are not valid
  9953. * 1 -> rx PPDU desc start fields are valid
  9954. * - RSSI0_PRI20
  9955. * Bits 7:0
  9956. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9957. * Value: RSSI dB units w.r.t. noise floor
  9958. *
  9959. * - RSSI0_EXT20
  9960. * Bits 7:0
  9961. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9962. * (if the rx bandwidth was >= 40 MHz)
  9963. * Value: RSSI dB units w.r.t. noise floor
  9964. * - RSSI0_EXT40
  9965. * Bits 7:0
  9966. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9967. * (if the rx bandwidth was >= 80 MHz)
  9968. * Value: RSSI dB units w.r.t. noise floor
  9969. * - RSSI0_EXT80
  9970. * Bits 7:0
  9971. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9972. * (if the rx bandwidth was >= 160 MHz)
  9973. * Value: RSSI dB units w.r.t. noise floor
  9974. *
  9975. * - RSSI1_PRI20
  9976. * Bits 7:0
  9977. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9978. * Value: RSSI dB units w.r.t. noise floor
  9979. * - RSSI1_EXT20
  9980. * Bits 7:0
  9981. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9982. * (if the rx bandwidth was >= 40 MHz)
  9983. * Value: RSSI dB units w.r.t. noise floor
  9984. * - RSSI1_EXT40
  9985. * Bits 7:0
  9986. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9987. * (if the rx bandwidth was >= 80 MHz)
  9988. * Value: RSSI dB units w.r.t. noise floor
  9989. * - RSSI1_EXT80
  9990. * Bits 7:0
  9991. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9992. * (if the rx bandwidth was >= 160 MHz)
  9993. * Value: RSSI dB units w.r.t. noise floor
  9994. *
  9995. * - RSSI2_PRI20
  9996. * Bits 7:0
  9997. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9998. * Value: RSSI dB units w.r.t. noise floor
  9999. * - RSSI2_EXT20
  10000. * Bits 7:0
  10001. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10002. * (if the rx bandwidth was >= 40 MHz)
  10003. * Value: RSSI dB units w.r.t. noise floor
  10004. * - RSSI2_EXT40
  10005. * Bits 7:0
  10006. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10007. * (if the rx bandwidth was >= 80 MHz)
  10008. * Value: RSSI dB units w.r.t. noise floor
  10009. * - RSSI2_EXT80
  10010. * Bits 7:0
  10011. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10012. * (if the rx bandwidth was >= 160 MHz)
  10013. * Value: RSSI dB units w.r.t. noise floor
  10014. *
  10015. * - RSSI3_PRI20
  10016. * Bits 7:0
  10017. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10018. * Value: RSSI dB units w.r.t. noise floor
  10019. * - RSSI3_EXT20
  10020. * Bits 7:0
  10021. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10022. * (if the rx bandwidth was >= 40 MHz)
  10023. * Value: RSSI dB units w.r.t. noise floor
  10024. * - RSSI3_EXT40
  10025. * Bits 7:0
  10026. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10027. * (if the rx bandwidth was >= 80 MHz)
  10028. * Value: RSSI dB units w.r.t. noise floor
  10029. * - RSSI3_EXT80
  10030. * Bits 7:0
  10031. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10032. * (if the rx bandwidth was >= 160 MHz)
  10033. * Value: RSSI dB units w.r.t. noise floor
  10034. *
  10035. * - TSF32
  10036. * Bits 31:0
  10037. * Purpose: specify the time the rx PPDU was received, in TSF units
  10038. * Value: 32 LSBs of the TSF
  10039. * - TIMESTAMP_MICROSEC
  10040. * Bits 31:0
  10041. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10042. * Value: PPDU rx time, in microseconds
  10043. * - VHT_SIG_A1
  10044. * Bits 23:0
  10045. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10046. * from the rx PPDU
  10047. * Value:
  10048. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10049. * VHT-SIG-A1 data.
  10050. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10051. * first 24 bits of the HT-SIG data.
  10052. * Otherwise, this field is invalid.
  10053. * Refer to the the 802.11 protocol for the definition of the
  10054. * HT-SIG and VHT-SIG-A1 fields
  10055. * - VHT_SIG_A2
  10056. * Bits 23:0
  10057. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10058. * from the rx PPDU
  10059. * Value:
  10060. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10061. * VHT-SIG-A2 data.
  10062. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10063. * last 24 bits of the HT-SIG data.
  10064. * Otherwise, this field is invalid.
  10065. * Refer to the the 802.11 protocol for the definition of the
  10066. * HT-SIG and VHT-SIG-A2 fields
  10067. * - PREAMBLE_TYPE
  10068. * Bits 31:24
  10069. * Purpose: indicate the PHY format of the received burst
  10070. * Value:
  10071. * 0x4: Legacy (OFDM/CCK)
  10072. * 0x8: HT
  10073. * 0x9: HT with TxBF
  10074. * 0xC: VHT
  10075. * 0xD: VHT with TxBF
  10076. * - SERVICE
  10077. * Bits 31:24
  10078. * Purpose: TBD
  10079. * Value: TBD
  10080. *
  10081. * Rx MSDU descriptor fields:
  10082. * - FW_RX_DESC_BYTES
  10083. * Bits 15:0
  10084. * Purpose: Indicate how many bytes in the Rx indication are used for
  10085. * FW Rx descriptors
  10086. *
  10087. * Payload fields:
  10088. * - MPDU_COUNT
  10089. * Bits 7:0
  10090. * Purpose: Indicate how many sequential MPDUs share the same status.
  10091. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10092. * - MPDU_STATUS
  10093. * Bits 15:8
  10094. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10095. * received successfully.
  10096. * Value:
  10097. * 0x1: success
  10098. * 0x2: FCS error
  10099. * 0x3: duplicate error
  10100. * 0x4: replay error
  10101. * 0x5: invalid peer
  10102. */
  10103. /* header fields */
  10104. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10105. #define HTT_RX_IND_EXT_TID_S 8
  10106. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10107. #define HTT_RX_IND_FLUSH_VALID_S 13
  10108. #define HTT_RX_IND_REL_VALID_M 0x4000
  10109. #define HTT_RX_IND_REL_VALID_S 14
  10110. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10111. #define HTT_RX_IND_PEER_ID_S 16
  10112. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10113. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10114. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10115. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10116. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10117. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10118. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10119. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10120. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10121. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10122. /* rx PPDU descriptor fields */
  10123. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10124. #define HTT_RX_IND_RSSI_CMB_S 0
  10125. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10126. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10127. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10128. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10129. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10130. #define HTT_RX_IND_PHY_ERR_S 24
  10131. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10132. #define HTT_RX_IND_LEGACY_RATE_S 25
  10133. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10134. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10135. #define HTT_RX_IND_END_VALID_M 0x40000000
  10136. #define HTT_RX_IND_END_VALID_S 30
  10137. #define HTT_RX_IND_START_VALID_M 0x80000000
  10138. #define HTT_RX_IND_START_VALID_S 31
  10139. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10140. #define HTT_RX_IND_RSSI_PRI20_S 0
  10141. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10142. #define HTT_RX_IND_RSSI_EXT20_S 8
  10143. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10144. #define HTT_RX_IND_RSSI_EXT40_S 16
  10145. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10146. #define HTT_RX_IND_RSSI_EXT80_S 24
  10147. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10148. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10149. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10150. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10151. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10152. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10153. #define HTT_RX_IND_SERVICE_M 0xff000000
  10154. #define HTT_RX_IND_SERVICE_S 24
  10155. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10156. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10157. /* rx MSDU descriptor fields */
  10158. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10159. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10160. /* payload fields */
  10161. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10162. #define HTT_RX_IND_MPDU_COUNT_S 0
  10163. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10164. #define HTT_RX_IND_MPDU_STATUS_S 8
  10165. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10166. do { \
  10167. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10168. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10169. } while (0)
  10170. #define HTT_RX_IND_EXT_TID_GET(word) \
  10171. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10172. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10173. do { \
  10174. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10175. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10176. } while (0)
  10177. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10178. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10179. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10180. do { \
  10181. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10182. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10183. } while (0)
  10184. #define HTT_RX_IND_REL_VALID_GET(word) \
  10185. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10186. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10187. do { \
  10188. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10189. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10190. } while (0)
  10191. #define HTT_RX_IND_PEER_ID_GET(word) \
  10192. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10193. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10194. do { \
  10195. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10196. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10197. } while (0)
  10198. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10199. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10200. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10201. do { \
  10202. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10203. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10204. } while (0)
  10205. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10206. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10207. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10208. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10209. do { \
  10210. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10211. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10212. } while (0)
  10213. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10214. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10215. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10216. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10219. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10220. } while (0)
  10221. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10222. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10223. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10224. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10227. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10228. } while (0)
  10229. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10230. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10231. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10232. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10233. do { \
  10234. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10235. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10236. } while (0)
  10237. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10238. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10239. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10240. /* FW rx PPDU descriptor fields */
  10241. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10242. do { \
  10243. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10244. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10245. } while (0)
  10246. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10247. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10248. HTT_RX_IND_RSSI_CMB_S)
  10249. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10250. do { \
  10251. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10252. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10253. } while (0)
  10254. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10255. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10256. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10257. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10258. do { \
  10259. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10260. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10261. } while (0)
  10262. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10263. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10264. HTT_RX_IND_PHY_ERR_CODE_S)
  10265. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10266. do { \
  10267. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10268. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10269. } while (0)
  10270. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10271. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10272. HTT_RX_IND_PHY_ERR_S)
  10273. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10274. do { \
  10275. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10276. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10277. } while (0)
  10278. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10279. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10280. HTT_RX_IND_LEGACY_RATE_S)
  10281. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10282. do { \
  10283. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10284. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10285. } while (0)
  10286. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10287. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10288. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10289. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10290. do { \
  10291. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10292. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10293. } while (0)
  10294. #define HTT_RX_IND_END_VALID_GET(word) \
  10295. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10296. HTT_RX_IND_END_VALID_S)
  10297. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10298. do { \
  10299. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10300. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10301. } while (0)
  10302. #define HTT_RX_IND_START_VALID_GET(word) \
  10303. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10304. HTT_RX_IND_START_VALID_S)
  10305. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10306. do { \
  10307. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10308. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10309. } while (0)
  10310. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10311. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10312. HTT_RX_IND_RSSI_PRI20_S)
  10313. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10314. do { \
  10315. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10316. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10317. } while (0)
  10318. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10319. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10320. HTT_RX_IND_RSSI_EXT20_S)
  10321. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10322. do { \
  10323. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10324. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10325. } while (0)
  10326. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10327. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10328. HTT_RX_IND_RSSI_EXT40_S)
  10329. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10330. do { \
  10331. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10332. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10333. } while (0)
  10334. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10335. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10336. HTT_RX_IND_RSSI_EXT80_S)
  10337. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10338. do { \
  10339. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10340. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10341. } while (0)
  10342. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10343. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10344. HTT_RX_IND_VHT_SIG_A1_S)
  10345. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10346. do { \
  10347. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10348. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10349. } while (0)
  10350. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10351. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10352. HTT_RX_IND_VHT_SIG_A2_S)
  10353. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10354. do { \
  10355. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10356. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10357. } while (0)
  10358. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10359. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10360. HTT_RX_IND_PREAMBLE_TYPE_S)
  10361. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10362. do { \
  10363. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10364. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10365. } while (0)
  10366. #define HTT_RX_IND_SERVICE_GET(word) \
  10367. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10368. HTT_RX_IND_SERVICE_S)
  10369. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10370. do { \
  10371. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10372. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10373. } while (0)
  10374. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10375. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10376. HTT_RX_IND_SA_ANT_MATRIX_S)
  10377. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10378. do { \
  10379. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10380. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10381. } while (0)
  10382. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10383. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10384. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10385. do { \
  10386. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10387. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10388. } while (0)
  10389. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10390. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10391. #define HTT_RX_IND_HL_BYTES \
  10392. (HTT_RX_IND_HDR_BYTES + \
  10393. 4 /* single FW rx MSDU descriptor */ + \
  10394. 4 /* single MPDU range information element */)
  10395. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10396. /* Could we use one macro entry? */
  10397. #define HTT_WORD_SET(word, field, value) \
  10398. do { \
  10399. HTT_CHECK_SET_VAL(field, value); \
  10400. (word) |= ((value) << field ## _S); \
  10401. } while (0)
  10402. #define HTT_WORD_GET(word, field) \
  10403. (((word) & field ## _M) >> field ## _S)
  10404. PREPACK struct hl_htt_rx_ind_base {
  10405. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10406. } POSTPACK;
  10407. /*
  10408. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10409. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10410. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10411. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10412. * htt_rx_ind_hl_rx_desc_t.
  10413. */
  10414. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10415. struct htt_rx_ind_hl_rx_desc_t {
  10416. A_UINT8 ver;
  10417. A_UINT8 len;
  10418. struct {
  10419. A_UINT8
  10420. first_msdu: 1,
  10421. last_msdu: 1,
  10422. c3_failed: 1,
  10423. c4_failed: 1,
  10424. ipv6: 1,
  10425. tcp: 1,
  10426. udp: 1,
  10427. reserved: 1;
  10428. } flags;
  10429. /* NOTE: no reserved space - don't append any new fields here */
  10430. };
  10431. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10432. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10433. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10434. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10435. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10436. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10437. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10438. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10439. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10440. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10441. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10442. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10443. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10444. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10445. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10446. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10447. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10448. /* This structure is used in HL, the basic descriptor information
  10449. * used by host. the structure is translated by FW from HW desc
  10450. * or generated by FW. But in HL monitor mode, the host would use
  10451. * the same structure with LL.
  10452. */
  10453. PREPACK struct hl_htt_rx_desc_base {
  10454. A_UINT32
  10455. seq_num:12,
  10456. encrypted:1,
  10457. chan_info_present:1,
  10458. resv0:2,
  10459. mcast_bcast:1,
  10460. fragment:1,
  10461. key_id_oct:8,
  10462. resv1:6;
  10463. A_UINT32
  10464. pn_31_0;
  10465. union {
  10466. struct {
  10467. A_UINT16 pn_47_32;
  10468. A_UINT16 pn_63_48;
  10469. } pn16;
  10470. A_UINT32 pn_63_32;
  10471. } u0;
  10472. A_UINT32
  10473. pn_95_64;
  10474. A_UINT32
  10475. pn_127_96;
  10476. } POSTPACK;
  10477. /*
  10478. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10479. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10480. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10481. * Please see htt_chan_change_t for description of the fields.
  10482. */
  10483. PREPACK struct htt_chan_info_t
  10484. {
  10485. A_UINT32 primary_chan_center_freq_mhz: 16,
  10486. contig_chan1_center_freq_mhz: 16;
  10487. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10488. phy_mode: 8,
  10489. reserved: 8;
  10490. } POSTPACK;
  10491. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10492. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10493. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10494. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10495. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10496. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10497. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10498. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10499. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10500. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10501. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10502. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10503. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10504. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10505. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10506. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10507. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10508. /* Channel information */
  10509. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10510. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10511. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10512. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10513. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10514. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10515. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10516. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10517. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10520. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10521. } while (0)
  10522. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10523. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10524. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10527. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10528. } while (0)
  10529. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10530. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10531. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10532. do { \
  10533. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10534. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10535. } while (0)
  10536. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10537. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10538. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10539. do { \
  10540. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10541. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10542. } while (0)
  10543. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10544. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10545. /*
  10546. * @brief target -> host message definition for FW offloaded pkts
  10547. *
  10548. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10549. *
  10550. * @details
  10551. * The following field definitions describe the format of the firmware
  10552. * offload deliver message sent from the target to the host.
  10553. *
  10554. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10555. *
  10556. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10557. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10558. * | reserved_1 | msg type |
  10559. * |--------------------------------------------------------------------------|
  10560. * | phy_timestamp_l32 |
  10561. * |--------------------------------------------------------------------------|
  10562. * | WORD2 (see below) |
  10563. * |--------------------------------------------------------------------------|
  10564. * | seqno | framectrl |
  10565. * |--------------------------------------------------------------------------|
  10566. * | reserved_3 | vdev_id | tid_num|
  10567. * |--------------------------------------------------------------------------|
  10568. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10569. * |--------------------------------------------------------------------------|
  10570. *
  10571. * where:
  10572. * STAT = status
  10573. * F = format (802.3 vs. 802.11)
  10574. *
  10575. * definition for word 2
  10576. *
  10577. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10578. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10579. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10580. * |--------------------------------------------------------------------------|
  10581. *
  10582. * where:
  10583. * PR = preamble
  10584. * BF = beamformed
  10585. */
  10586. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10587. {
  10588. A_UINT32 /* word 0 */
  10589. msg_type:8, /* [ 7: 0] */
  10590. reserved_1:24; /* [31: 8] */
  10591. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10592. A_UINT32 /* word 2 */
  10593. /* preamble:
  10594. * 0-OFDM,
  10595. * 1-CCk,
  10596. * 2-HT,
  10597. * 3-VHT
  10598. */
  10599. preamble: 2, /* [1:0] */
  10600. /* mcs:
  10601. * In case of HT preamble interpret
  10602. * MCS along with NSS.
  10603. * Valid values for HT are 0 to 7.
  10604. * HT mcs 0 with NSS 2 is mcs 8.
  10605. * Valid values for VHT are 0 to 9.
  10606. */
  10607. mcs: 4, /* [5:2] */
  10608. /* rate:
  10609. * This is applicable only for
  10610. * CCK and OFDM preamble type
  10611. * rate 0: OFDM 48 Mbps,
  10612. * 1: OFDM 24 Mbps,
  10613. * 2: OFDM 12 Mbps
  10614. * 3: OFDM 6 Mbps
  10615. * 4: OFDM 54 Mbps
  10616. * 5: OFDM 36 Mbps
  10617. * 6: OFDM 18 Mbps
  10618. * 7: OFDM 9 Mbps
  10619. * rate 0: CCK 11 Mbps Long
  10620. * 1: CCK 5.5 Mbps Long
  10621. * 2: CCK 2 Mbps Long
  10622. * 3: CCK 1 Mbps Long
  10623. * 4: CCK 11 Mbps Short
  10624. * 5: CCK 5.5 Mbps Short
  10625. * 6: CCK 2 Mbps Short
  10626. */
  10627. rate : 3, /* [ 8: 6] */
  10628. rssi : 8, /* [16: 9] units=dBm */
  10629. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10630. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10631. stbc : 1, /* [22] */
  10632. sgi : 1, /* [23] */
  10633. ldpc : 1, /* [24] */
  10634. beamformed: 1, /* [25] */
  10635. reserved_2: 6; /* [31:26] */
  10636. A_UINT32 /* word 3 */
  10637. framectrl:16, /* [15: 0] */
  10638. seqno:16; /* [31:16] */
  10639. A_UINT32 /* word 4 */
  10640. tid_num:5, /* [ 4: 0] actual TID number */
  10641. vdev_id:8, /* [12: 5] */
  10642. reserved_3:19; /* [31:13] */
  10643. A_UINT32 /* word 5 */
  10644. /* status:
  10645. * 0: tx_ok
  10646. * 1: retry
  10647. * 2: drop
  10648. * 3: filtered
  10649. * 4: abort
  10650. * 5: tid delete
  10651. * 6: sw abort
  10652. * 7: dropped by peer migration
  10653. */
  10654. status:3, /* [2:0] */
  10655. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10656. tx_mpdu_bytes:16, /* [19:4] */
  10657. /* Indicates retry count of offloaded/local generated Data tx frames */
  10658. tx_retry_cnt:6, /* [25:20] */
  10659. reserved_4:6; /* [31:26] */
  10660. } POSTPACK;
  10661. /* FW offload deliver ind message header fields */
  10662. /* DWORD one */
  10663. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10664. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10665. /* DWORD two */
  10666. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10667. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10668. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10669. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10670. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10671. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10672. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10673. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10674. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10675. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10676. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10677. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10678. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10679. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10680. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10681. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10682. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10683. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10684. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10685. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10686. /* DWORD three*/
  10687. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10688. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10689. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10690. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10691. /* DWORD four */
  10692. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10693. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10694. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10695. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10696. /* DWORD five */
  10697. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10698. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10699. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10700. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10701. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10702. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10703. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10704. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10705. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10708. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10709. } while (0)
  10710. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10711. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10712. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10715. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10716. } while (0)
  10717. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10718. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10719. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10720. do { \
  10721. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10722. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10723. } while (0)
  10724. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10725. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10726. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10727. do { \
  10728. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10729. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10730. } while (0)
  10731. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10732. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10733. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10734. do { \
  10735. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10736. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10737. } while (0)
  10738. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10739. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10740. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10741. do { \
  10742. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10743. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10744. } while (0)
  10745. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10746. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10747. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10748. do { \
  10749. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10750. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10751. } while (0)
  10752. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10753. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10754. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10755. do { \
  10756. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10757. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10758. } while (0)
  10759. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10760. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10761. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10762. do { \
  10763. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10764. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10765. } while (0)
  10766. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10767. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10768. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10769. do { \
  10770. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10771. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10772. } while (0)
  10773. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10774. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10775. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10776. do { \
  10777. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10778. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10779. } while (0)
  10780. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10781. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10782. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10783. do { \
  10784. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10785. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10786. } while (0)
  10787. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10788. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10789. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10790. do { \
  10791. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10792. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10793. } while (0)
  10794. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10795. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10796. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10797. do { \
  10798. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10799. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10800. } while (0)
  10801. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10802. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10803. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10804. do { \
  10805. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10806. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10807. } while (0)
  10808. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10809. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10810. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10811. do { \
  10812. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10813. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10814. } while (0)
  10815. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10816. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10817. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10818. do { \
  10819. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10820. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10821. } while (0)
  10822. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10823. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10824. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10827. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10828. } while (0)
  10829. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10830. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10831. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10834. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10835. } while (0)
  10836. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10837. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10838. /*
  10839. * @brief target -> host rx reorder flush message definition
  10840. *
  10841. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10842. *
  10843. * @details
  10844. * The following field definitions describe the format of the rx flush
  10845. * message sent from the target to the host.
  10846. * The message consists of a 4-octet header, followed by one or more
  10847. * 4-octet payload information elements.
  10848. *
  10849. * |31 24|23 8|7 0|
  10850. * |--------------------------------------------------------------|
  10851. * | TID | peer ID | msg type |
  10852. * |--------------------------------------------------------------|
  10853. * | seq num end | seq num start | MPDU status | reserved |
  10854. * |--------------------------------------------------------------|
  10855. * First DWORD:
  10856. * - MSG_TYPE
  10857. * Bits 7:0
  10858. * Purpose: identifies this as an rx flush message
  10859. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10860. * - PEER_ID
  10861. * Bits 23:8 (only bits 18:8 actually used)
  10862. * Purpose: identify which peer's rx data is being flushed
  10863. * Value: (rx) peer ID
  10864. * - TID
  10865. * Bits 31:24 (only bits 27:24 actually used)
  10866. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10867. * Value: traffic identifier
  10868. * Second DWORD:
  10869. * - MPDU_STATUS
  10870. * Bits 15:8
  10871. * Purpose:
  10872. * Indicate whether the flushed MPDUs should be discarded or processed.
  10873. * Value:
  10874. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10875. * stages of rx processing
  10876. * other: discard the MPDUs
  10877. * It is anticipated that flush messages will always have
  10878. * MPDU status == 1, but the status flag is included for
  10879. * flexibility.
  10880. * - SEQ_NUM_START
  10881. * Bits 23:16
  10882. * Purpose:
  10883. * Indicate the start of a series of consecutive MPDUs being flushed.
  10884. * Not all MPDUs within this range are necessarily valid - the host
  10885. * must check each sequence number within this range to see if the
  10886. * corresponding MPDU is actually present.
  10887. * Value:
  10888. * The sequence number for the first MPDU in the sequence.
  10889. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10890. * - SEQ_NUM_END
  10891. * Bits 30:24
  10892. * Purpose:
  10893. * Indicate the end of a series of consecutive MPDUs being flushed.
  10894. * Value:
  10895. * The sequence number one larger than the sequence number of the
  10896. * last MPDU being flushed.
  10897. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10898. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10899. * are to be released for further rx processing.
  10900. * Not all MPDUs within this range are necessarily valid - the host
  10901. * must check each sequence number within this range to see if the
  10902. * corresponding MPDU is actually present.
  10903. */
  10904. /* first DWORD */
  10905. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10906. #define HTT_RX_FLUSH_PEER_ID_S 8
  10907. #define HTT_RX_FLUSH_TID_M 0xff000000
  10908. #define HTT_RX_FLUSH_TID_S 24
  10909. /* second DWORD */
  10910. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10911. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10912. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10913. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10914. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10915. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10916. #define HTT_RX_FLUSH_BYTES 8
  10917. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10918. do { \
  10919. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10920. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10921. } while (0)
  10922. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10923. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10924. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10925. do { \
  10926. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10927. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10928. } while (0)
  10929. #define HTT_RX_FLUSH_TID_GET(word) \
  10930. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10931. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10932. do { \
  10933. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10934. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10935. } while (0)
  10936. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10937. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10938. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10939. do { \
  10940. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10941. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10942. } while (0)
  10943. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10944. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10945. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10946. do { \
  10947. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10948. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10949. } while (0)
  10950. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10951. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10952. /*
  10953. * @brief target -> host rx pn check indication message
  10954. *
  10955. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10956. *
  10957. * @details
  10958. * The following field definitions describe the format of the Rx PN check
  10959. * indication message sent from the target to the host.
  10960. * The message consists of a 4-octet header, followed by the start and
  10961. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10962. * IE is one octet containing the sequence number that failed the PN
  10963. * check.
  10964. *
  10965. * |31 24|23 8|7 0|
  10966. * |--------------------------------------------------------------|
  10967. * | TID | peer ID | msg type |
  10968. * |--------------------------------------------------------------|
  10969. * | Reserved | PN IE count | seq num end | seq num start|
  10970. * |--------------------------------------------------------------|
  10971. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10972. * |--------------------------------------------------------------|
  10973. * First DWORD:
  10974. * - MSG_TYPE
  10975. * Bits 7:0
  10976. * Purpose: Identifies this as an rx pn check indication message
  10977. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10978. * - PEER_ID
  10979. * Bits 23:8 (only bits 18:8 actually used)
  10980. * Purpose: identify which peer
  10981. * Value: (rx) peer ID
  10982. * - TID
  10983. * Bits 31:24 (only bits 27:24 actually used)
  10984. * Purpose: identify traffic identifier
  10985. * Value: traffic identifier
  10986. * Second DWORD:
  10987. * - SEQ_NUM_START
  10988. * Bits 7:0
  10989. * Purpose:
  10990. * Indicates the starting sequence number of the MPDU in this
  10991. * series of MPDUs that went though PN check.
  10992. * Value:
  10993. * The sequence number for the first MPDU in the sequence.
  10994. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10995. * - SEQ_NUM_END
  10996. * Bits 15:8
  10997. * Purpose:
  10998. * Indicates the ending sequence number of the MPDU in this
  10999. * series of MPDUs that went though PN check.
  11000. * Value:
  11001. * The sequence number one larger then the sequence number of the last
  11002. * MPDU being flushed.
  11003. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11004. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11005. * for invalid PN numbers and are ready to be released for further processing.
  11006. * Not all MPDUs within this range are necessarily valid - the host
  11007. * must check each sequence number within this range to see if the
  11008. * corresponding MPDU is actually present.
  11009. * - PN_IE_COUNT
  11010. * Bits 23:16
  11011. * Purpose:
  11012. * Used to determine the variable number of PN information elements in this
  11013. * message
  11014. *
  11015. * PN information elements:
  11016. * - PN_IE_x-
  11017. * Purpose:
  11018. * Each PN information element contains the sequence number of the MPDU that
  11019. * has failed the target PN check.
  11020. * Value:
  11021. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11022. * that failed the PN check.
  11023. */
  11024. /* first DWORD */
  11025. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11026. #define HTT_RX_PN_IND_PEER_ID_S 8
  11027. #define HTT_RX_PN_IND_TID_M 0xff000000
  11028. #define HTT_RX_PN_IND_TID_S 24
  11029. /* second DWORD */
  11030. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11031. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11032. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11033. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11034. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11035. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11036. #define HTT_RX_PN_IND_BYTES 8
  11037. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11038. do { \
  11039. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11040. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11041. } while (0)
  11042. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11043. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11044. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11045. do { \
  11046. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11047. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11048. } while (0)
  11049. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11050. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11051. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11052. do { \
  11053. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11054. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11055. } while (0)
  11056. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11057. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11058. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11061. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11062. } while (0)
  11063. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11064. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11065. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11066. do { \
  11067. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11068. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11069. } while (0)
  11070. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11071. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11072. /*
  11073. * @brief target -> host rx offload deliver message for LL system
  11074. *
  11075. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11076. *
  11077. * @details
  11078. * In a low latency system this message is sent whenever the offload
  11079. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11080. * The DMA of the actual packets into host memory is done before sending out
  11081. * this message. This message indicates only how many MSDUs to reap. The
  11082. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11083. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11084. * DMA'd by the MAC directly into host memory these packets do not contain
  11085. * the MAC descriptors in the header portion of the packet. Instead they contain
  11086. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11087. * message, the packets are delivered directly to the NW stack without going
  11088. * through the regular reorder buffering and PN checking path since it has
  11089. * already been done in target.
  11090. *
  11091. * |31 24|23 16|15 8|7 0|
  11092. * |-----------------------------------------------------------------------|
  11093. * | Total MSDU count | reserved | msg type |
  11094. * |-----------------------------------------------------------------------|
  11095. *
  11096. * @brief target -> host rx offload deliver message for HL system
  11097. *
  11098. * @details
  11099. * In a high latency system this message is sent whenever the offload manager
  11100. * flushes out the packets it has coalesced in its coalescing buffer. The
  11101. * actual packets are also carried along with this message. When the host
  11102. * receives this message, it is expected to deliver these packets to the NW
  11103. * stack directly instead of routing them through the reorder buffering and
  11104. * PN checking path since it has already been done in target.
  11105. *
  11106. * |31 24|23 16|15 8|7 0|
  11107. * |-----------------------------------------------------------------------|
  11108. * | Total MSDU count | reserved | msg type |
  11109. * |-----------------------------------------------------------------------|
  11110. * | peer ID | MSDU length |
  11111. * |-----------------------------------------------------------------------|
  11112. * | MSDU payload | FW Desc | tid | vdev ID |
  11113. * |-----------------------------------------------------------------------|
  11114. * | MSDU payload contd. |
  11115. * |-----------------------------------------------------------------------|
  11116. * | peer ID | MSDU length |
  11117. * |-----------------------------------------------------------------------|
  11118. * | MSDU payload | FW Desc | tid | vdev ID |
  11119. * |-----------------------------------------------------------------------|
  11120. * | MSDU payload contd. |
  11121. * |-----------------------------------------------------------------------|
  11122. *
  11123. */
  11124. /* first DWORD */
  11125. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11127. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11130. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11131. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11132. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11137. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11138. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11139. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11140. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11141. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11142. do { \
  11143. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11144. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11145. } while (0)
  11146. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11147. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11149. do { \
  11150. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11151. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11152. } while (0)
  11153. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11154. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11156. do { \
  11157. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11158. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11159. } while (0)
  11160. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11161. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11162. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11165. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11166. } while (0)
  11167. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11168. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11169. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11172. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11173. } while (0)
  11174. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11175. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11176. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11179. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11180. } while (0)
  11181. /**
  11182. * @brief target -> host rx peer map/unmap message definition
  11183. *
  11184. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11185. *
  11186. * @details
  11187. * The following diagram shows the format of the rx peer map message sent
  11188. * from the target to the host. This layout assumes the target operates
  11189. * as little-endian.
  11190. *
  11191. * This message always contains a SW peer ID. The main purpose of the
  11192. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11193. * with, so that the host can use that peer ID to determine which peer
  11194. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11195. * other purposes, such as identifying during tx completions which peer
  11196. * the tx frames in question were transmitted to.
  11197. *
  11198. * In certain generations of chips, the peer map message also contains
  11199. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11200. * to identify which peer the frame needs to be forwarded to (i.e. the
  11201. * peer associated with the Destination MAC Address within the packet),
  11202. * and particularly which vdev needs to transmit the frame (for cases
  11203. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11204. * meaning as AST_INDEX_0.
  11205. * This DA-based peer ID that is provided for certain rx frames
  11206. * (the rx frames that need to be re-transmitted as tx frames)
  11207. * is the ID that the HW uses for referring to the peer in question,
  11208. * rather than the peer ID that the SW+FW use to refer to the peer.
  11209. *
  11210. *
  11211. * |31 24|23 16|15 8|7 0|
  11212. * |-----------------------------------------------------------------------|
  11213. * | SW peer ID | VDEV ID | msg type |
  11214. * |-----------------------------------------------------------------------|
  11215. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11216. * |-----------------------------------------------------------------------|
  11217. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11218. * |-----------------------------------------------------------------------|
  11219. *
  11220. *
  11221. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11222. *
  11223. * The following diagram shows the format of the rx peer unmap message sent
  11224. * from the target to the host.
  11225. *
  11226. * |31 24|23 16|15 8|7 0|
  11227. * |-----------------------------------------------------------------------|
  11228. * | SW peer ID | VDEV ID | msg type |
  11229. * |-----------------------------------------------------------------------|
  11230. *
  11231. * The following field definitions describe the format of the rx peer map
  11232. * and peer unmap messages sent from the target to the host.
  11233. * - MSG_TYPE
  11234. * Bits 7:0
  11235. * Purpose: identifies this as an rx peer map or peer unmap message
  11236. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11237. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11238. * - VDEV_ID
  11239. * Bits 15:8
  11240. * Purpose: Indicates which virtual device the peer is associated
  11241. * with.
  11242. * Value: vdev ID (used in the host to look up the vdev object)
  11243. * - PEER_ID (a.k.a. SW_PEER_ID)
  11244. * Bits 31:16
  11245. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11246. * freeing (unmap)
  11247. * Value: (rx) peer ID
  11248. * - MAC_ADDR_L32 (peer map only)
  11249. * Bits 31:0
  11250. * Purpose: Identifies which peer node the peer ID is for.
  11251. * Value: lower 4 bytes of peer node's MAC address
  11252. * - MAC_ADDR_U16 (peer map only)
  11253. * Bits 15:0
  11254. * Purpose: Identifies which peer node the peer ID is for.
  11255. * Value: upper 2 bytes of peer node's MAC address
  11256. * - HW_PEER_ID
  11257. * Bits 31:16
  11258. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11259. * address, so for rx frames marked for rx --> tx forwarding, the
  11260. * host can determine from the HW peer ID provided as meta-data with
  11261. * the rx frame which peer the frame is supposed to be forwarded to.
  11262. * Value: ID used by the MAC HW to identify the peer
  11263. */
  11264. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11265. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11266. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11267. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11268. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11269. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11270. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11271. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11272. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11273. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11274. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11275. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11276. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11277. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11278. do { \
  11279. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11280. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11281. } while (0)
  11282. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11283. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11284. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11285. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11286. do { \
  11287. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11288. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11289. } while (0)
  11290. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11291. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11292. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11293. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11294. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11295. do { \
  11296. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11297. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11298. } while (0)
  11299. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11300. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11301. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11302. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11303. #define HTT_RX_PEER_MAP_BYTES 12
  11304. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11305. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11306. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11307. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11308. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11309. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11310. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11311. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11312. #define HTT_RX_PEER_UNMAP_BYTES 4
  11313. /**
  11314. * @brief target -> host rx peer map V2 message definition
  11315. *
  11316. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11317. *
  11318. * @details
  11319. * The following diagram shows the format of the rx peer map v2 message sent
  11320. * from the target to the host. This layout assumes the target operates
  11321. * as little-endian.
  11322. *
  11323. * This message always contains a SW peer ID. The main purpose of the
  11324. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11325. * with, so that the host can use that peer ID to determine which peer
  11326. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11327. * other purposes, such as identifying during tx completions which peer
  11328. * the tx frames in question were transmitted to.
  11329. *
  11330. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11331. * is used during rx --> tx frame forwarding to identify which peer the
  11332. * frame needs to be forwarded to (i.e. the peer associated with the
  11333. * Destination MAC Address within the packet), and particularly which vdev
  11334. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11335. * This DA-based peer ID that is provided for certain rx frames
  11336. * (the rx frames that need to be re-transmitted as tx frames)
  11337. * is the ID that the HW uses for referring to the peer in question,
  11338. * rather than the peer ID that the SW+FW use to refer to the peer.
  11339. *
  11340. * The HW peer id here is the same meaning as AST_INDEX_0.
  11341. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11342. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11343. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11344. * AST is valid.
  11345. *
  11346. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11347. * |-------------------------------------------------------------------------|
  11348. * | SW peer ID | VDEV ID | msg type |
  11349. * |-------------------------------------------------------------------------|
  11350. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11351. * |-------------------------------------------------------------------------|
  11352. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11353. * |-------------------------------------------------------------------------|
  11354. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11355. * |-------------------------------------------------------------------------|
  11356. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11357. * |-------------------------------------------------------------------------|
  11358. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11359. * |-------------------------------------------------------------------------|
  11360. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11361. * |-------------------------------------------------------------------------|
  11362. * | Reserved_2 |
  11363. * |-------------------------------------------------------------------------|
  11364. * Where:
  11365. * NH = Next Hop
  11366. * ASTVM = AST valid mask
  11367. * OA = on-chip AST valid bit
  11368. * ASTFM = AST flow mask
  11369. *
  11370. * The following field definitions describe the format of the rx peer map v2
  11371. * messages sent from the target to the host.
  11372. * - MSG_TYPE
  11373. * Bits 7:0
  11374. * Purpose: identifies this as an rx peer map v2 message
  11375. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11376. * - VDEV_ID
  11377. * Bits 15:8
  11378. * Purpose: Indicates which virtual device the peer is associated with.
  11379. * Value: vdev ID (used in the host to look up the vdev object)
  11380. * - SW_PEER_ID
  11381. * Bits 31:16
  11382. * Purpose: The peer ID (index) that WAL is allocating
  11383. * Value: (rx) peer ID
  11384. * - MAC_ADDR_L32
  11385. * Bits 31:0
  11386. * Purpose: Identifies which peer node the peer ID is for.
  11387. * Value: lower 4 bytes of peer node's MAC address
  11388. * - MAC_ADDR_U16
  11389. * Bits 15:0
  11390. * Purpose: Identifies which peer node the peer ID is for.
  11391. * Value: upper 2 bytes of peer node's MAC address
  11392. * - HW_PEER_ID / AST_INDEX_0
  11393. * Bits 31:16
  11394. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11395. * address, so for rx frames marked for rx --> tx forwarding, the
  11396. * host can determine from the HW peer ID provided as meta-data with
  11397. * the rx frame which peer the frame is supposed to be forwarded to.
  11398. * Value: ID used by the MAC HW to identify the peer
  11399. * - AST_HASH_VALUE
  11400. * Bits 15:0
  11401. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11402. * override feature.
  11403. * - NEXT_HOP
  11404. * Bit 16
  11405. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11406. * (Wireless Distribution System).
  11407. * - AST_VALID_MASK
  11408. * Bits 19:17
  11409. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11410. * - ONCHIP_AST_VALID_FLAG
  11411. * Bit 20
  11412. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11413. * is valid.
  11414. * - AST_INDEX_1
  11415. * Bits 15:0
  11416. * Purpose: indicate the second AST index for this peer
  11417. * - AST_0_FLOW_MASK
  11418. * Bits 19:16
  11419. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11420. * - AST_1_FLOW_MASK
  11421. * Bits 23:20
  11422. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11423. * - AST_2_FLOW_MASK
  11424. * Bits 27:24
  11425. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11426. * - AST_3_FLOW_MASK
  11427. * Bits 31:28
  11428. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11429. * - AST_INDEX_2
  11430. * Bits 15:0
  11431. * Purpose: indicate the third AST index for this peer
  11432. * - TID_VALID_HI_PRI
  11433. * Bits 23:16
  11434. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11435. * - TID_VALID_LOW_PRI
  11436. * Bits 31:24
  11437. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11438. * - AST_INDEX_3
  11439. * Bits 15:0
  11440. * Purpose: indicate the fourth AST index for this peer
  11441. * - ONCHIP_AST_IDX / RESERVED
  11442. * Bits 31:16
  11443. * Purpose: This field is valid only when split AST feature is enabled.
  11444. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11445. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11446. * address, this ast_idx is used for LMAC modules for RXPCU.
  11447. * Value: ID used by the LMAC HW to identify the peer
  11448. */
  11449. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11450. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11451. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11452. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11453. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11454. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11455. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11456. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11457. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11458. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11459. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11460. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11461. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11462. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11463. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11464. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11465. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11466. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11467. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11468. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11469. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11470. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11471. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11472. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11473. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11474. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11475. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11476. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11477. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11478. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11479. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11480. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11481. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11482. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11483. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11484. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11485. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11486. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11487. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11488. do { \
  11489. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11490. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11491. } while (0)
  11492. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11493. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11494. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11495. do { \
  11496. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11497. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11498. } while (0)
  11499. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11500. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11501. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11502. do { \
  11503. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11504. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11505. } while (0)
  11506. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11507. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11508. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11509. do { \
  11510. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11511. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11512. } while (0)
  11513. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11514. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11515. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11516. do { \
  11517. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11518. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11519. } while (0)
  11520. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11521. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11522. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11523. do { \
  11524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11525. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11526. } while (0)
  11527. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11528. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11529. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11530. do { \
  11531. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11532. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11533. } while (0)
  11534. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11535. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11536. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11537. do { \
  11538. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11539. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11540. } while (0)
  11541. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11542. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11543. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11544. do { \
  11545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11546. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11547. } while (0)
  11548. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11549. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11550. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11551. do { \
  11552. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11553. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11554. } while (0)
  11555. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11556. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11557. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11558. do { \
  11559. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11560. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11561. } while (0)
  11562. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11563. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11564. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11565. do { \
  11566. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11567. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11568. } while (0)
  11569. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11570. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11571. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11572. do { \
  11573. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11574. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11575. } while (0)
  11576. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11577. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11578. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11579. do { \
  11580. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11581. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11582. } while (0)
  11583. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11584. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11585. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11586. do { \
  11587. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11588. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11589. } while (0)
  11590. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11591. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11592. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11593. do { \
  11594. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11595. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11596. } while (0)
  11597. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11598. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11599. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11600. do { \
  11601. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11602. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11603. } while (0)
  11604. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11605. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11606. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11607. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11608. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11609. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11610. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11611. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11612. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11613. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11614. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11615. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11616. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11617. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11618. /**
  11619. * @brief target -> host rx peer map V3 message definition
  11620. *
  11621. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11622. *
  11623. * @details
  11624. * The following diagram shows the format of the rx peer map v3 message sent
  11625. * from the target to the host.
  11626. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11627. * This layout assumes the target operates as little-endian.
  11628. *
  11629. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11630. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11631. * | SW peer ID | VDEV ID | msg type |
  11632. * |-----------------+--------------------+-----------------+-----------------|
  11633. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11634. * |-----------------+--------------------+-----------------+-----------------|
  11635. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11636. * |-----------------+--------+-----------+-----------------+-----------------|
  11637. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11638. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11639. * | (8bits) | | (4bits) | |
  11640. * |-----------------+--------+--+--+--+--------------------------------------|
  11641. * | RESERVED |E |O | | |
  11642. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11643. * | |V |V | | |
  11644. * |-----------------+--------------------+-----------------------------------|
  11645. * | HTT_MSDU_IDX_ | RESERVED | |
  11646. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11647. * | (8bits) | | |
  11648. * |-----------------+--------------------+-----------------------------------|
  11649. * | Reserved_2 |
  11650. * |--------------------------------------------------------------------------|
  11651. * | Reserved_3 |
  11652. * |--------------------------------------------------------------------------|
  11653. *
  11654. * Where:
  11655. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11656. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11657. * NH = Next Hop
  11658. * The following field definitions describe the format of the rx peer map v3
  11659. * messages sent from the target to the host.
  11660. * - MSG_TYPE
  11661. * Bits 7:0
  11662. * Purpose: identifies this as a peer map v3 message
  11663. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11664. * - VDEV_ID
  11665. * Bits 15:8
  11666. * Purpose: Indicates which virtual device the peer is associated with.
  11667. * - SW_PEER_ID
  11668. * Bits 31:16
  11669. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11670. * - MAC_ADDR_L32
  11671. * Bits 31:0
  11672. * Purpose: Identifies which peer node the peer ID is for.
  11673. * Value: lower 4 bytes of peer node's MAC address
  11674. * - MAC_ADDR_U16
  11675. * Bits 15:0
  11676. * Purpose: Identifies which peer node the peer ID is for.
  11677. * Value: upper 2 bytes of peer node's MAC address
  11678. * - MULTICAST_SW_PEER_ID
  11679. * Bits 31:16
  11680. * Purpose: The multicast peer ID (index)
  11681. * Value: set to HTT_INVALID_PEER if not valid
  11682. * - HW_PEER_ID / AST_INDEX
  11683. * Bits 15:0
  11684. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11685. * address, so for rx frames marked for rx --> tx forwarding, the
  11686. * host can determine from the HW peer ID provided as meta-data with
  11687. * the rx frame which peer the frame is supposed to be forwarded to.
  11688. * - CACHE_SET_NUM
  11689. * Bits 19:16
  11690. * Purpose: Cache Set Number for AST_INDEX
  11691. * Cache set number that should be used to cache the index based
  11692. * search results, for address and flow search.
  11693. * This value should be equal to LSB 4 bits of the hash value
  11694. * of match data, in case of search index points to an entry which
  11695. * may be used in content based search also. The value can be
  11696. * anything when the entry pointed by search index will not be
  11697. * used for content based search.
  11698. * - HTT_MSDU_IDX_VALID_MASK
  11699. * Bits 31:24
  11700. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11701. * - ONCHIP_AST_IDX / RESERVED
  11702. * Bits 15:0
  11703. * Purpose: This field is valid only when split AST feature is enabled.
  11704. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11705. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11706. * address, this ast_idx is used for LMAC modules for RXPCU.
  11707. * - NEXT_HOP
  11708. * Bits 16
  11709. * Purpose: Flag indicates next_hop AST entry used for WDS
  11710. * (Wireless Distribution System).
  11711. * - ONCHIP_AST_VALID
  11712. * Bits 17
  11713. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11714. * - EXT_AST_VALID
  11715. * Bits 18
  11716. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11717. * - EXT_AST_INDEX
  11718. * Bits 15:0
  11719. * Purpose: This field describes Extended AST index
  11720. * Valid if EXT_AST_VALID flag set
  11721. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11722. * Bits 31:24
  11723. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11724. */
  11725. /* dword 0 */
  11726. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11727. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11728. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11729. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11730. /* dword 1 */
  11731. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11732. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11733. /* dword 2 */
  11734. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11735. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11736. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11737. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11738. /* dword 3 */
  11739. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11740. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11741. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11742. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11743. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11744. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11745. /* dword 4 */
  11746. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11747. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11748. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11749. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11750. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11751. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11752. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11753. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11754. /* dword 5 */
  11755. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11756. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11757. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11758. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11759. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11760. do { \
  11761. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11762. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11763. } while (0)
  11764. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11765. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11766. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11767. do { \
  11768. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11769. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11770. } while (0)
  11771. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11772. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11773. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11774. do { \
  11775. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11776. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11777. } while (0)
  11778. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11779. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11780. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11781. do { \
  11782. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11783. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11784. } while (0)
  11785. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11786. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11787. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11788. do { \
  11789. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11790. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11791. } while (0)
  11792. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11793. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11794. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11795. do { \
  11796. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11797. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11798. } while (0)
  11799. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11800. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11801. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11802. do { \
  11803. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11804. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11805. } while (0)
  11806. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11807. (((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)
  11808. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11809. do { \
  11810. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11811. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11812. } while (0)
  11813. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11814. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11815. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11816. do { \
  11817. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11818. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11819. } while (0)
  11820. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11821. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11822. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11823. do { \
  11824. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11825. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11826. } while (0)
  11827. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11828. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11829. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11830. do { \
  11831. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11832. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11833. } while (0)
  11834. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11835. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11836. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11837. do { \
  11838. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11839. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11840. } while (0)
  11841. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11842. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11843. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11844. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11845. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11846. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11847. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11848. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11849. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11850. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11851. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11852. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11853. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11854. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11855. /**
  11856. * @brief target -> host rx peer unmap V2 message definition
  11857. *
  11858. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11859. *
  11860. * The following diagram shows the format of the rx peer unmap message sent
  11861. * from the target to the host.
  11862. *
  11863. * |31 24|23 16|15 8|7 0|
  11864. * |-----------------------------------------------------------------------|
  11865. * | SW peer ID | VDEV ID | msg type |
  11866. * |-----------------------------------------------------------------------|
  11867. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11868. * |-----------------------------------------------------------------------|
  11869. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11870. * |-----------------------------------------------------------------------|
  11871. * | Peer Delete Duration |
  11872. * |-----------------------------------------------------------------------|
  11873. * | Reserved_0 | WDS Free Count |
  11874. * |-----------------------------------------------------------------------|
  11875. * | Reserved_1 |
  11876. * |-----------------------------------------------------------------------|
  11877. * | Reserved_2 |
  11878. * |-----------------------------------------------------------------------|
  11879. *
  11880. *
  11881. * The following field definitions describe the format of the rx peer unmap
  11882. * messages sent from the target to the host.
  11883. * - MSG_TYPE
  11884. * Bits 7:0
  11885. * Purpose: identifies this as an rx peer unmap v2 message
  11886. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11887. * - VDEV_ID
  11888. * Bits 15:8
  11889. * Purpose: Indicates which virtual device the peer is associated
  11890. * with.
  11891. * Value: vdev ID (used in the host to look up the vdev object)
  11892. * - SW_PEER_ID
  11893. * Bits 31:16
  11894. * Purpose: The peer ID (index) that WAL is freeing
  11895. * Value: (rx) peer ID
  11896. * - MAC_ADDR_L32
  11897. * Bits 31:0
  11898. * Purpose: Identifies which peer node the peer ID is for.
  11899. * Value: lower 4 bytes of peer node's MAC address
  11900. * - MAC_ADDR_U16
  11901. * Bits 15:0
  11902. * Purpose: Identifies which peer node the peer ID is for.
  11903. * Value: upper 2 bytes of peer node's MAC address
  11904. * - NEXT_HOP
  11905. * Bits 16
  11906. * Purpose: Bit indicates next_hop AST entry used for WDS
  11907. * (Wireless Distribution System).
  11908. * - PEER_DELETE_DURATION
  11909. * Bits 31:0
  11910. * Purpose: Time taken to delete peer, in msec,
  11911. * Used for monitoring / debugging PEER delete response delay
  11912. * - PEER_WDS_FREE_COUNT
  11913. * Bits 15:0
  11914. * Purpose: Count of WDS entries deleted associated to peer deleted
  11915. */
  11916. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11917. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11918. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11919. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11920. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11921. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11922. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11923. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11924. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11925. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11926. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11927. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11928. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11929. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11930. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11931. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11932. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11933. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11934. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11935. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11936. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11937. do { \
  11938. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11939. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11940. } while (0)
  11941. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11942. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11943. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11944. do { \
  11945. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11946. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11947. } while (0)
  11948. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11949. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11950. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11951. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11952. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11953. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11954. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11955. /**
  11956. * @brief target -> host rx peer mlo map message definition
  11957. *
  11958. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11959. *
  11960. * @details
  11961. * The following diagram shows the format of the rx mlo peer map message sent
  11962. * from the target to the host. This layout assumes the target operates
  11963. * as little-endian.
  11964. *
  11965. * MCC:
  11966. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11967. *
  11968. * WIN:
  11969. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11970. * It will be sent on the Assoc Link.
  11971. *
  11972. * This message always contains a MLO peer ID. The main purpose of the
  11973. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11974. * with, so that the host can use that MLO peer ID to determine which peer
  11975. * transmitted the rx frame.
  11976. *
  11977. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11978. * |-------------------------------------------------------------------------|
  11979. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11980. * |-------------------------------------------------------------------------|
  11981. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11982. * |-------------------------------------------------------------------------|
  11983. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11984. * |-------------------------------------------------------------------------|
  11985. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11986. * |-------------------------------------------------------------------------|
  11987. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11988. * |-------------------------------------------------------------------------|
  11989. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11990. * |-------------------------------------------------------------------------|
  11991. * |RSVD |
  11992. * |-------------------------------------------------------------------------|
  11993. * |RSVD |
  11994. * |-------------------------------------------------------------------------|
  11995. * | htt_tlv_hdr_t |
  11996. * |-------------------------------------------------------------------------|
  11997. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11998. * |-------------------------------------------------------------------------|
  11999. * | htt_tlv_hdr_t |
  12000. * |-------------------------------------------------------------------------|
  12001. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12002. * |-------------------------------------------------------------------------|
  12003. * | htt_tlv_hdr_t |
  12004. * |-------------------------------------------------------------------------|
  12005. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12006. * |-------------------------------------------------------------------------|
  12007. *
  12008. * Where:
  12009. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12010. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12011. * V (valid) - 1 Bit Bit17
  12012. * CHIPID - 3 Bits
  12013. * TIDMASK - 8 Bits
  12014. * CACHE_SET_NUM - 8 Bits
  12015. *
  12016. * The following field definitions describe the format of the rx MLO peer map
  12017. * messages sent from the target to the host.
  12018. * - MSG_TYPE
  12019. * Bits 7:0
  12020. * Purpose: identifies this as an rx mlo peer map message
  12021. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12022. *
  12023. * - MLO_PEER_ID
  12024. * Bits 23:8
  12025. * Purpose: The MLO peer ID (index).
  12026. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12027. * Value: MLO peer ID
  12028. *
  12029. * - NUMLINK
  12030. * Bits: 26:24 (3Bits)
  12031. * Purpose: Indicate the max number of logical links supported per client.
  12032. * Value: number of logical links
  12033. *
  12034. * - PRC
  12035. * Bits: 29:27 (3Bits)
  12036. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12037. * if there is migration of the primary chip.
  12038. * Value: Primary REO CHIPID
  12039. *
  12040. * - MAC_ADDR_L32
  12041. * Bits 31:0
  12042. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12043. * Value: lower 4 bytes of peer node's MAC address
  12044. *
  12045. * - MAC_ADDR_U16
  12046. * Bits 15:0
  12047. * Purpose: Identifies which peer node the peer ID is for.
  12048. * Value: upper 2 bytes of peer node's MAC address
  12049. *
  12050. * - PRIMARY_TCL_AST_IDX
  12051. * Bits 15:0
  12052. * Purpose: Primary TCL AST index for this peer.
  12053. *
  12054. * - V
  12055. * 1 Bit Position 16
  12056. * Purpose: If the ast idx is valid.
  12057. *
  12058. * - CHIPID
  12059. * Bits 19:17
  12060. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12061. *
  12062. * - TIDMASK
  12063. * Bits 27:20
  12064. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12065. *
  12066. * - CACHE_SET_NUM
  12067. * Bits 31:28
  12068. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12069. * Cache set number that should be used to cache the index based
  12070. * search results, for address and flow search.
  12071. * This value should be equal to LSB four bits of the hash value
  12072. * of match data, in case of search index points to an entry which
  12073. * may be used in content based search also. The value can be
  12074. * anything when the entry pointed by search index will not be
  12075. * used for content based search.
  12076. *
  12077. * - htt_tlv_hdr_t
  12078. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12079. *
  12080. * Bits 11:0
  12081. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12082. *
  12083. * Bits 23:12
  12084. * Purpose: Length, Length of the value that follows the header
  12085. *
  12086. * Bits 31:28
  12087. * Purpose: Reserved.
  12088. *
  12089. *
  12090. * - SW_PEER_ID
  12091. * Bits 15:0
  12092. * Purpose: The peer ID (index) that WAL is allocating
  12093. * Value: (rx) peer ID
  12094. *
  12095. * - VDEV_ID
  12096. * Bits 23:16
  12097. * Purpose: Indicates which virtual device the peer is associated with.
  12098. * Value: vdev ID (used in the host to look up the vdev object)
  12099. *
  12100. * - CHIPID
  12101. * Bits 26:24
  12102. * Purpose: Indicates which Chip id the peer is associated with.
  12103. * Value: chip ID (Provided by Host as part of QMI exchange)
  12104. */
  12105. typedef enum {
  12106. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12107. } MLO_PEER_MAP_TLV_TAG_ID;
  12108. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12109. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12110. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12111. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12112. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12113. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12114. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12115. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12116. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12117. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12118. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12119. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12120. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12121. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12122. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12123. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12124. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12125. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12126. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12127. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12128. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12129. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12130. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12131. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12132. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12133. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12134. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12135. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12136. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12137. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12138. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12139. do { \
  12140. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12141. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12142. } while (0)
  12143. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12144. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12145. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12146. do { \
  12147. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12148. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12149. } while (0)
  12150. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12151. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12152. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12153. do { \
  12154. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12155. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12156. } while (0)
  12157. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12158. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12159. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12160. do { \
  12161. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12162. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12163. } while (0)
  12164. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12165. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12166. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12167. do { \
  12168. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12169. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12170. } while (0)
  12171. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12172. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12173. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12174. do { \
  12175. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12176. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12177. } while (0)
  12178. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12179. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12180. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12181. do { \
  12182. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12183. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12184. } while (0)
  12185. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12186. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12187. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12188. do { \
  12189. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12190. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12191. } while (0)
  12192. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12193. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12194. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12195. do { \
  12196. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12197. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12198. } while (0)
  12199. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12200. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12201. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12202. do { \
  12203. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12204. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12205. } while (0)
  12206. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12207. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12208. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12209. do { \
  12210. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12211. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12212. } while (0)
  12213. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12214. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12215. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12216. do { \
  12217. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12218. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12219. } while (0)
  12220. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12221. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12222. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12223. do { \
  12224. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12225. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12226. } while (0)
  12227. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12228. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12229. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12230. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12231. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12232. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12233. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12234. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12235. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12236. *
  12237. * The following diagram shows the format of the rx mlo peer unmap message sent
  12238. * from the target to the host.
  12239. *
  12240. * |31 24|23 16|15 8|7 0|
  12241. * |-----------------------------------------------------------------------|
  12242. * | RSVD_24_31 | MLO peer ID | msg type |
  12243. * |-----------------------------------------------------------------------|
  12244. */
  12245. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12246. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12247. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12248. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12249. /**
  12250. * @brief target -> host message specifying security parameters
  12251. *
  12252. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12253. *
  12254. * @details
  12255. * The following diagram shows the format of the security specification
  12256. * message sent from the target to the host.
  12257. * This security specification message tells the host whether a PN check is
  12258. * necessary on rx data frames, and if so, how large the PN counter is.
  12259. * This message also tells the host about the security processing to apply
  12260. * to defragmented rx frames - specifically, whether a Message Integrity
  12261. * Check is required, and the Michael key to use.
  12262. *
  12263. * |31 24|23 16|15|14 8|7 0|
  12264. * |-----------------------------------------------------------------------|
  12265. * | peer ID | U| security type | msg type |
  12266. * |-----------------------------------------------------------------------|
  12267. * | Michael Key K0 |
  12268. * |-----------------------------------------------------------------------|
  12269. * | Michael Key K1 |
  12270. * |-----------------------------------------------------------------------|
  12271. * | WAPI RSC Low0 |
  12272. * |-----------------------------------------------------------------------|
  12273. * | WAPI RSC Low1 |
  12274. * |-----------------------------------------------------------------------|
  12275. * | WAPI RSC Hi0 |
  12276. * |-----------------------------------------------------------------------|
  12277. * | WAPI RSC Hi1 |
  12278. * |-----------------------------------------------------------------------|
  12279. *
  12280. * The following field definitions describe the format of the security
  12281. * indication message sent from the target to the host.
  12282. * - MSG_TYPE
  12283. * Bits 7:0
  12284. * Purpose: identifies this as a security specification message
  12285. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12286. * - SEC_TYPE
  12287. * Bits 14:8
  12288. * Purpose: specifies which type of security applies to the peer
  12289. * Value: htt_sec_type enum value
  12290. * - UNICAST
  12291. * Bit 15
  12292. * Purpose: whether this security is applied to unicast or multicast data
  12293. * Value: 1 -> unicast, 0 -> multicast
  12294. * - PEER_ID
  12295. * Bits 31:16
  12296. * Purpose: The ID number for the peer the security specification is for
  12297. * Value: peer ID
  12298. * - MICHAEL_KEY_K0
  12299. * Bits 31:0
  12300. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12301. * Value: Michael Key K0 (if security type is TKIP)
  12302. * - MICHAEL_KEY_K1
  12303. * Bits 31:0
  12304. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12305. * Value: Michael Key K1 (if security type is TKIP)
  12306. * - WAPI_RSC_LOW0
  12307. * Bits 31:0
  12308. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12309. * Value: WAPI RSC Low0 (if security type is WAPI)
  12310. * - WAPI_RSC_LOW1
  12311. * Bits 31:0
  12312. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12313. * Value: WAPI RSC Low1 (if security type is WAPI)
  12314. * - WAPI_RSC_HI0
  12315. * Bits 31:0
  12316. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12317. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12318. * - WAPI_RSC_HI1
  12319. * Bits 31:0
  12320. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12321. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12322. */
  12323. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12324. #define HTT_SEC_IND_SEC_TYPE_S 8
  12325. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12326. #define HTT_SEC_IND_UNICAST_S 15
  12327. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12328. #define HTT_SEC_IND_PEER_ID_S 16
  12329. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12330. do { \
  12331. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12332. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12333. } while (0)
  12334. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12335. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12336. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12337. do { \
  12338. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12339. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12340. } while (0)
  12341. #define HTT_SEC_IND_UNICAST_GET(word) \
  12342. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12343. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12344. do { \
  12345. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12346. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12347. } while (0)
  12348. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12349. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12350. #define HTT_SEC_IND_BYTES 28
  12351. /**
  12352. * @brief target -> host rx ADDBA / DELBA message definitions
  12353. *
  12354. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12355. *
  12356. * @details
  12357. * The following diagram shows the format of the rx ADDBA message sent
  12358. * from the target to the host:
  12359. *
  12360. * |31 20|19 16|15 8|7 0|
  12361. * |---------------------------------------------------------------------|
  12362. * | peer ID | TID | window size | msg type |
  12363. * |---------------------------------------------------------------------|
  12364. *
  12365. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12366. *
  12367. * The following diagram shows the format of the rx DELBA message sent
  12368. * from the target to the host:
  12369. *
  12370. * |31 20|19 16|15 10|9 8|7 0|
  12371. * |---------------------------------------------------------------------|
  12372. * | peer ID | TID | window size | IR| msg type |
  12373. * |---------------------------------------------------------------------|
  12374. *
  12375. * The following field definitions describe the format of the rx ADDBA
  12376. * and DELBA messages sent from the target to the host.
  12377. * - MSG_TYPE
  12378. * Bits 7:0
  12379. * Purpose: identifies this as an rx ADDBA or DELBA message
  12380. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12381. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12382. * - IR (initiator / recipient)
  12383. * Bits 9:8 (DELBA only)
  12384. * Purpose: specify whether the DELBA handshake was initiated by the
  12385. * local STA/AP, or by the peer STA/AP
  12386. * Value:
  12387. * 0 - unspecified
  12388. * 1 - initiator (a.k.a. originator)
  12389. * 2 - recipient (a.k.a. responder)
  12390. * 3 - unused / reserved
  12391. * - WIN_SIZE
  12392. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12393. * Purpose: Specifies the length of the block ack window (max = 64).
  12394. * Value:
  12395. * block ack window length specified by the received ADDBA/DELBA
  12396. * management message.
  12397. * - TID
  12398. * Bits 19:16
  12399. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12400. * Value:
  12401. * TID specified by the received ADDBA or DELBA management message.
  12402. * - PEER_ID
  12403. * Bits 31:20
  12404. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12405. * Value:
  12406. * ID (hash value) used by the host for fast, direct lookup of
  12407. * host SW peer info, including rx reorder states.
  12408. */
  12409. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12410. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12411. #define HTT_RX_ADDBA_TID_M 0xf0000
  12412. #define HTT_RX_ADDBA_TID_S 16
  12413. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12414. #define HTT_RX_ADDBA_PEER_ID_S 20
  12415. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12416. do { \
  12417. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12418. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12419. } while (0)
  12420. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12421. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12422. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12423. do { \
  12424. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12425. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12426. } while (0)
  12427. #define HTT_RX_ADDBA_TID_GET(word) \
  12428. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12429. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12430. do { \
  12431. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12432. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12433. } while (0)
  12434. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12435. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12436. #define HTT_RX_ADDBA_BYTES 4
  12437. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12438. #define HTT_RX_DELBA_INITIATOR_S 8
  12439. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12440. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12441. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12442. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12443. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12444. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12445. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12446. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12447. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12448. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12449. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12450. do { \
  12451. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12452. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12453. } while (0)
  12454. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12455. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12456. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12457. do { \
  12458. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12459. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12460. } while (0)
  12461. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12462. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12463. #define HTT_RX_DELBA_BYTES 4
  12464. /**
  12465. * @brief target -> host rx ADDBA / DELBA message definitions
  12466. *
  12467. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12468. *
  12469. * @details
  12470. * The following diagram shows the format of the rx ADDBA extn message sent
  12471. * from the target to the host:
  12472. *
  12473. * |31 20|19 16|15 13|12 8|7 0|
  12474. * |---------------------------------------------------------------------|
  12475. * | peer ID | TID | reserved | msg type |
  12476. * |---------------------------------------------------------------------|
  12477. * | reserved | window size |
  12478. * |---------------------------------------------------------------------|
  12479. *
  12480. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12481. *
  12482. * The following diagram shows the format of the rx DELBA message sent
  12483. * from the target to the host:
  12484. *
  12485. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12486. * |---------------------------------------------------------------------|
  12487. * | peer ID | TID | reserved | IR| msg type |
  12488. * |---------------------------------------------------------------------|
  12489. * | reserved | window size |
  12490. * |---------------------------------------------------------------------|
  12491. *
  12492. * The following field definitions describe the format of the rx ADDBA
  12493. * and DELBA messages sent from the target to the host.
  12494. * - MSG_TYPE
  12495. * Bits 7:0
  12496. * Purpose: identifies this as an rx ADDBA or DELBA message
  12497. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12498. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12499. * - IR (initiator / recipient)
  12500. * Bits 9:8 (DELBA only)
  12501. * Purpose: specify whether the DELBA handshake was initiated by the
  12502. * local STA/AP, or by the peer STA/AP
  12503. * Value:
  12504. * 0 - unspecified
  12505. * 1 - initiator (a.k.a. originator)
  12506. * 2 - recipient (a.k.a. responder)
  12507. * 3 - unused / reserved
  12508. * Value:
  12509. * block ack window length specified by the received ADDBA/DELBA
  12510. * management message.
  12511. * - TID
  12512. * Bits 19:16
  12513. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12514. * Value:
  12515. * TID specified by the received ADDBA or DELBA management message.
  12516. * - PEER_ID
  12517. * Bits 31:20
  12518. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12519. * Value:
  12520. * ID (hash value) used by the host for fast, direct lookup of
  12521. * host SW peer info, including rx reorder states.
  12522. * == DWORD 1
  12523. * - WIN_SIZE
  12524. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12525. * Purpose: Specifies the length of the block ack window (max = 8191).
  12526. */
  12527. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12528. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12529. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12530. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12531. /*--- Dword 0 ---*/
  12532. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12533. do { \
  12534. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12535. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12536. } while (0)
  12537. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12538. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12539. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12540. do { \
  12541. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12542. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12543. } while (0)
  12544. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12545. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12546. /*--- Dword 1 ---*/
  12547. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12548. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12549. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12550. do { \
  12551. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12552. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12553. } while (0)
  12554. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12555. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12556. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12557. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12558. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12559. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12560. #define HTT_RX_DELBA_EXTN_TID_S 16
  12561. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12562. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12563. /*--- Dword 0 ---*/
  12564. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12565. do { \
  12566. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12567. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12568. } while (0)
  12569. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12570. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12571. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12572. do { \
  12573. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12574. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12575. } while (0)
  12576. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12577. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12578. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12579. do { \
  12580. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12581. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12582. } while (0)
  12583. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12584. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12585. /*--- Dword 1 ---*/
  12586. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12587. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12588. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12589. do { \
  12590. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12591. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12592. } while (0)
  12593. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12594. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12595. #define HTT_RX_DELBA_EXTN_BYTES 8
  12596. /**
  12597. * @brief tx queue group information element definition
  12598. *
  12599. * @details
  12600. * The following diagram shows the format of the tx queue group
  12601. * information element, which can be included in target --> host
  12602. * messages to specify the number of tx "credits" (tx descriptors
  12603. * for LL, or tx buffers for HL) available to a particular group
  12604. * of host-side tx queues, and which host-side tx queues belong to
  12605. * the group.
  12606. *
  12607. * |31|30 24|23 16|15|14|13 0|
  12608. * |------------------------------------------------------------------------|
  12609. * | X| reserved | tx queue grp ID | A| S| credit count |
  12610. * |------------------------------------------------------------------------|
  12611. * | vdev ID mask | AC mask |
  12612. * |------------------------------------------------------------------------|
  12613. *
  12614. * The following definitions describe the fields within the tx queue group
  12615. * information element:
  12616. * - credit_count
  12617. * Bits 13:1
  12618. * Purpose: specify how many tx credits are available to the tx queue group
  12619. * Value: An absolute or relative, positive or negative credit value
  12620. * The 'A' bit specifies whether the value is absolute or relative.
  12621. * The 'S' bit specifies whether the value is positive or negative.
  12622. * A negative value can only be relative, not absolute.
  12623. * An absolute value replaces any prior credit value the host has for
  12624. * the tx queue group in question.
  12625. * A relative value is added to the prior credit value the host has for
  12626. * the tx queue group in question.
  12627. * - sign
  12628. * Bit 14
  12629. * Purpose: specify whether the credit count is positive or negative
  12630. * Value: 0 -> positive, 1 -> negative
  12631. * - absolute
  12632. * Bit 15
  12633. * Purpose: specify whether the credit count is absolute or relative
  12634. * Value: 0 -> relative, 1 -> absolute
  12635. * - txq_group_id
  12636. * Bits 23:16
  12637. * Purpose: indicate which tx queue group's credit and/or membership are
  12638. * being specified
  12639. * Value: 0 to max_tx_queue_groups-1
  12640. * - reserved
  12641. * Bits 30:16
  12642. * Value: 0x0
  12643. * - eXtension
  12644. * Bit 31
  12645. * Purpose: specify whether another tx queue group info element follows
  12646. * Value: 0 -> no more tx queue group information elements
  12647. * 1 -> another tx queue group information element immediately follows
  12648. * - ac_mask
  12649. * Bits 15:0
  12650. * Purpose: specify which Access Categories belong to the tx queue group
  12651. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12652. * the tx queue group.
  12653. * The AC bit-mask values are obtained by left-shifting by the
  12654. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12655. * - vdev_id_mask
  12656. * Bits 31:16
  12657. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12658. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12659. * belong to the tx queue group.
  12660. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12661. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12662. */
  12663. PREPACK struct htt_txq_group {
  12664. A_UINT32
  12665. credit_count: 14,
  12666. sign: 1,
  12667. absolute: 1,
  12668. tx_queue_group_id: 8,
  12669. reserved0: 7,
  12670. extension: 1;
  12671. A_UINT32
  12672. ac_mask: 16,
  12673. vdev_id_mask: 16;
  12674. } POSTPACK;
  12675. /* first word */
  12676. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12677. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12678. #define HTT_TXQ_GROUP_SIGN_S 14
  12679. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12680. #define HTT_TXQ_GROUP_ABS_S 15
  12681. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12682. #define HTT_TXQ_GROUP_ID_S 16
  12683. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12684. #define HTT_TXQ_GROUP_EXT_S 31
  12685. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12686. /* second word */
  12687. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12688. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12689. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12690. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12691. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12692. do { \
  12693. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12694. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12695. } while (0)
  12696. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12697. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12698. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12699. do { \
  12700. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12701. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12702. } while (0)
  12703. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12704. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12705. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12706. do { \
  12707. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12708. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12709. } while (0)
  12710. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12711. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12712. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12713. do { \
  12714. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12715. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12716. } while (0)
  12717. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12718. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12719. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12720. do { \
  12721. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12722. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12723. } while (0)
  12724. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12725. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12726. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12727. do { \
  12728. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12729. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12730. } while (0)
  12731. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12732. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12733. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12734. do { \
  12735. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12736. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12737. } while (0)
  12738. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12739. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12740. /**
  12741. * @brief target -> host TX completion indication message definition
  12742. *
  12743. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12744. *
  12745. * @details
  12746. * The following diagram shows the format of the TX completion indication sent
  12747. * from the target to the host
  12748. *
  12749. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12750. * |-------------------------------------------------------------------|
  12751. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12752. * |-------------------------------------------------------------------|
  12753. * payload:| MSDU1 ID | MSDU0 ID |
  12754. * |-------------------------------------------------------------------|
  12755. * : MSDU3 ID | MSDU2 ID :
  12756. * |-------------------------------------------------------------------|
  12757. * | struct htt_tx_compl_ind_append_retries |
  12758. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12759. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12760. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12761. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12762. * |-------------------------------------------------------------------|
  12763. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12764. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12765. * | MSDU0 tx_tsf64_low |
  12766. * |-------------------------------------------------------------------|
  12767. * | MSDU0 tx_tsf64_high |
  12768. * |-------------------------------------------------------------------|
  12769. * | MSDU1 tx_tsf64_low |
  12770. * |-------------------------------------------------------------------|
  12771. * | MSDU1 tx_tsf64_high |
  12772. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12773. * | phy_timestamp |
  12774. * |-------------------------------------------------------------------|
  12775. * | rate specs (see below) |
  12776. * |-------------------------------------------------------------------|
  12777. * | seqctrl | framectrl |
  12778. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12779. * Where:
  12780. * A0 = append (a.k.a. append0)
  12781. * A1 = append1
  12782. * TP = MSDU tx power presence
  12783. * A2 = append2
  12784. * A3 = append3
  12785. * A4 = append4
  12786. *
  12787. * The following field definitions describe the format of the TX completion
  12788. * indication sent from the target to the host
  12789. * Header fields:
  12790. * - msg_type
  12791. * Bits 7:0
  12792. * Purpose: identifies this as HTT TX completion indication
  12793. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12794. * - status
  12795. * Bits 10:8
  12796. * Purpose: the TX completion status of payload fragmentations descriptors
  12797. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12798. * - tid
  12799. * Bits 14:11
  12800. * Purpose: the tid associated with those fragmentation descriptors. It is
  12801. * valid or not, depending on the tid_invalid bit.
  12802. * Value: 0 to 15
  12803. * - tid_invalid
  12804. * Bits 15:15
  12805. * Purpose: this bit indicates whether the tid field is valid or not
  12806. * Value: 0 indicates valid; 1 indicates invalid
  12807. * - num
  12808. * Bits 23:16
  12809. * Purpose: the number of payload in this indication
  12810. * Value: 1 to 255
  12811. * - append (a.k.a. append0)
  12812. * Bits 24:24
  12813. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12814. * the number of tx retries for one MSDU at the end of this message
  12815. * Value: 0 indicates no appending; 1 indicates appending
  12816. * - append1
  12817. * Bits 25:25
  12818. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12819. * contains the timestamp info for each TX msdu id in payload.
  12820. * The order of the timestamps matches the order of the MSDU IDs.
  12821. * Note that a big-endian host needs to account for the reordering
  12822. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12823. * conversion) when determining which tx timestamp corresponds to
  12824. * which MSDU ID.
  12825. * Value: 0 indicates no appending; 1 indicates appending
  12826. * - msdu_tx_power_presence
  12827. * Bits 26:26
  12828. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12829. * for each MSDU referenced by the TX_COMPL_IND message.
  12830. * The tx power is reported in 0.5 dBm units.
  12831. * The order of the per-MSDU tx power reports matches the order
  12832. * of the MSDU IDs.
  12833. * Note that a big-endian host needs to account for the reordering
  12834. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12835. * conversion) when determining which Tx Power corresponds to
  12836. * which MSDU ID.
  12837. * Value: 0 indicates MSDU tx power reports are not appended,
  12838. * 1 indicates MSDU tx power reports are appended
  12839. * - append2
  12840. * Bits 27:27
  12841. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12842. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12843. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12844. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12845. * for each MSDU, for convenience.
  12846. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12847. * this append2 bit is set).
  12848. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12849. * dB above the noise floor.
  12850. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12851. * 1 indicates MSDU ACK RSSI values are appended.
  12852. * - append3
  12853. * Bits 28:28
  12854. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12855. * contains the tx tsf info based on wlan global TSF for
  12856. * each TX msdu id in payload.
  12857. * The order of the tx tsf matches the order of the MSDU IDs.
  12858. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12859. * values to indicate the the lower 32 bits and higher 32 bits of
  12860. * the tx tsf.
  12861. * The tx_tsf64 here represents the time MSDU was acked and the
  12862. * tx_tsf64 has microseconds units.
  12863. * Value: 0 indicates no appending; 1 indicates appending
  12864. * - append4
  12865. * Bits 29:29
  12866. * Purpose: Indicate whether data frame control fields and fields required
  12867. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12868. * message. The order of the this message matches the order of
  12869. * the MSDU IDs.
  12870. * Value: 0 indicates frame control fields and fields required for
  12871. * radio tap header values are not appended,
  12872. * 1 indicates frame control fields and fields required for
  12873. * radio tap header values are appended.
  12874. * Payload fields:
  12875. * - hmsdu_id
  12876. * Bits 15:0
  12877. * Purpose: this ID is used to track the Tx buffer in host
  12878. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12879. */
  12880. PREPACK struct htt_tx_data_hdr_information {
  12881. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12882. A_UINT32 /* word 1 */
  12883. /* preamble:
  12884. * 0-OFDM,
  12885. * 1-CCk,
  12886. * 2-HT,
  12887. * 3-VHT
  12888. */
  12889. preamble: 2, /* [1:0] */
  12890. /* mcs:
  12891. * In case of HT preamble interpret
  12892. * MCS along with NSS.
  12893. * Valid values for HT are 0 to 7.
  12894. * HT mcs 0 with NSS 2 is mcs 8.
  12895. * Valid values for VHT are 0 to 9.
  12896. */
  12897. mcs: 4, /* [5:2] */
  12898. /* rate:
  12899. * This is applicable only for
  12900. * CCK and OFDM preamble type
  12901. * rate 0: OFDM 48 Mbps,
  12902. * 1: OFDM 24 Mbps,
  12903. * 2: OFDM 12 Mbps
  12904. * 3: OFDM 6 Mbps
  12905. * 4: OFDM 54 Mbps
  12906. * 5: OFDM 36 Mbps
  12907. * 6: OFDM 18 Mbps
  12908. * 7: OFDM 9 Mbps
  12909. * rate 0: CCK 11 Mbps Long
  12910. * 1: CCK 5.5 Mbps Long
  12911. * 2: CCK 2 Mbps Long
  12912. * 3: CCK 1 Mbps Long
  12913. * 4: CCK 11 Mbps Short
  12914. * 5: CCK 5.5 Mbps Short
  12915. * 6: CCK 2 Mbps Short
  12916. */
  12917. rate : 3, /* [ 8: 6] */
  12918. rssi : 8, /* [16: 9] units=dBm */
  12919. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12920. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12921. stbc : 1, /* [22] */
  12922. sgi : 1, /* [23] */
  12923. ldpc : 1, /* [24] */
  12924. beamformed: 1, /* [25] */
  12925. /* tx_retry_cnt:
  12926. * Indicates retry count of data tx frames provided by the host.
  12927. */
  12928. tx_retry_cnt: 6; /* [31:26] */
  12929. A_UINT32 /* word 2 */
  12930. framectrl:16, /* [15: 0] */
  12931. seqno:16; /* [31:16] */
  12932. } POSTPACK;
  12933. #define HTT_TX_COMPL_IND_STATUS_S 8
  12934. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12935. #define HTT_TX_COMPL_IND_TID_S 11
  12936. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12937. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12938. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12939. #define HTT_TX_COMPL_IND_NUM_S 16
  12940. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12941. #define HTT_TX_COMPL_IND_APPEND_S 24
  12942. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12943. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12944. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12945. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12946. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12947. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12948. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12949. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12950. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12951. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12952. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12953. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12954. do { \
  12955. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12956. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12957. } while (0)
  12958. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12959. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12960. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12961. do { \
  12962. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12963. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12964. } while (0)
  12965. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12966. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12967. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12968. do { \
  12969. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12970. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12971. } while (0)
  12972. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12973. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12974. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12975. do { \
  12976. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12977. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12978. } while (0)
  12979. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12980. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12981. HTT_TX_COMPL_IND_TID_INV_S)
  12982. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12983. do { \
  12984. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12985. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12986. } while (0)
  12987. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12988. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12989. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12990. do { \
  12991. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12992. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12993. } while (0)
  12994. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12995. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12996. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12997. do { \
  12998. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12999. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13000. } while (0)
  13001. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13002. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13003. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13004. do { \
  13005. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13006. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13007. } while (0)
  13008. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13009. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13010. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13011. do { \
  13012. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13013. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13014. } while (0)
  13015. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13016. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13017. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13018. do { \
  13019. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13020. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13021. } while (0)
  13022. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13023. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13024. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13025. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13026. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13027. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13028. #define HTT_TX_COMPL_IND_STAT_OK 0
  13029. /* DISCARD:
  13030. * current meaning:
  13031. * MSDUs were queued for transmission but filtered by HW or SW
  13032. * without any over the air attempts
  13033. * legacy meaning (HL Rome):
  13034. * MSDUs were discarded by the target FW without any over the air
  13035. * attempts due to lack of space
  13036. */
  13037. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13038. /* NO_ACK:
  13039. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13040. */
  13041. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13042. /* POSTPONE:
  13043. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13044. * be downloaded again later (in the appropriate order), when they are
  13045. * deliverable.
  13046. */
  13047. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13048. /*
  13049. * The PEER_DEL tx completion status is used for HL cases
  13050. * where the peer the frame is for has been deleted.
  13051. * The host has already discarded its copy of the frame, but
  13052. * it still needs the tx completion to restore its credit.
  13053. */
  13054. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13055. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13056. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13057. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13058. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13059. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13060. PREPACK struct htt_tx_compl_ind_base {
  13061. A_UINT32 hdr;
  13062. A_UINT16 payload[1/*or more*/];
  13063. } POSTPACK;
  13064. PREPACK struct htt_tx_compl_ind_append_retries {
  13065. A_UINT16 msdu_id;
  13066. A_UINT8 tx_retries;
  13067. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13068. 0: this is the last append_retries struct */
  13069. } POSTPACK;
  13070. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13071. A_UINT32 timestamp[1/*or more*/];
  13072. } POSTPACK;
  13073. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13074. A_UINT32 tx_tsf64_low;
  13075. A_UINT32 tx_tsf64_high;
  13076. } POSTPACK;
  13077. /* htt_tx_data_hdr_information payload extension fields: */
  13078. /* DWORD zero */
  13079. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13080. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13081. /* DWORD one */
  13082. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13083. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13084. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13085. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13086. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13087. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13088. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13089. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13090. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13091. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13092. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13093. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13094. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13095. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13096. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13097. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13098. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13099. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13100. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13101. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13102. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13103. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13104. /* DWORD two */
  13105. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13106. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13107. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13108. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13109. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13112. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13113. } while (0)
  13114. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13115. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13116. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13117. do { \
  13118. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13119. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13120. } while (0)
  13121. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13122. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13123. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13124. do { \
  13125. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13126. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13127. } while (0)
  13128. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13129. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13130. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13131. do { \
  13132. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13133. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13134. } while (0)
  13135. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13136. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13137. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13138. do { \
  13139. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13140. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13141. } while (0)
  13142. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13143. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13144. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13145. do { \
  13146. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13147. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13148. } while (0)
  13149. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13150. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13151. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13152. do { \
  13153. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13154. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13155. } while (0)
  13156. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13157. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13158. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13159. do { \
  13160. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13161. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13162. } while (0)
  13163. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13164. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13165. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13166. do { \
  13167. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13168. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13169. } while (0)
  13170. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13171. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13172. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13173. do { \
  13174. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13175. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13176. } while (0)
  13177. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13178. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13179. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13180. do { \
  13181. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13182. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13183. } while (0)
  13184. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13185. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13186. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13187. do { \
  13188. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13189. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13190. } while (0)
  13191. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13192. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13193. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13194. do { \
  13195. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13196. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13197. } while (0)
  13198. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13199. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13200. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13201. do { \
  13202. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13203. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13204. } while (0)
  13205. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13206. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13207. /**
  13208. * @brief target -> host rate-control update indication message
  13209. *
  13210. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13211. *
  13212. * @details
  13213. * The following diagram shows the format of the RC Update message
  13214. * sent from the target to the host, while processing the tx-completion
  13215. * of a transmitted PPDU.
  13216. *
  13217. * |31 24|23 16|15 8|7 0|
  13218. * |-------------------------------------------------------------|
  13219. * | peer ID | vdev ID | msg_type |
  13220. * |-------------------------------------------------------------|
  13221. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13222. * |-------------------------------------------------------------|
  13223. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13224. * |-------------------------------------------------------------|
  13225. * | : |
  13226. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13227. * | : |
  13228. * |-------------------------------------------------------------|
  13229. * | : |
  13230. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13231. * | : |
  13232. * |-------------------------------------------------------------|
  13233. * : :
  13234. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13235. *
  13236. */
  13237. typedef struct {
  13238. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13239. A_UINT32 rate_code_flags;
  13240. A_UINT32 flags; /* Encodes information such as excessive
  13241. retransmission, aggregate, some info
  13242. from .11 frame control,
  13243. STBC, LDPC, (SGI and Tx Chain Mask
  13244. are encoded in ptx_rc->flags field),
  13245. AMPDU truncation (BT/time based etc.),
  13246. RTS/CTS attempt */
  13247. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13248. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13249. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13250. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13251. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13252. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13253. } HTT_RC_TX_DONE_PARAMS;
  13254. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13255. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13256. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13257. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13258. #define HTT_RC_UPDATE_VDEVID_S 8
  13259. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13260. #define HTT_RC_UPDATE_PEERID_S 16
  13261. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13262. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13263. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13264. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13267. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13268. } while (0)
  13269. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13270. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13271. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13272. do { \
  13273. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13274. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13275. } while (0)
  13276. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13277. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13278. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13279. do { \
  13280. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13281. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13282. } while (0)
  13283. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13284. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13285. /**
  13286. * @brief target -> host rx fragment indication message definition
  13287. *
  13288. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13289. *
  13290. * @details
  13291. * The following field definitions describe the format of the rx fragment
  13292. * indication message sent from the target to the host.
  13293. * The rx fragment indication message shares the format of the
  13294. * rx indication message, but not all fields from the rx indication message
  13295. * are relevant to the rx fragment indication message.
  13296. *
  13297. *
  13298. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13299. * |-----------+-------------------+---------------------+-------------|
  13300. * | peer ID | |FV| ext TID | msg type |
  13301. * |-------------------------------------------------------------------|
  13302. * | | flush | flush |
  13303. * | | end | start |
  13304. * | | seq num | seq num |
  13305. * |-------------------------------------------------------------------|
  13306. * | reserved | FW rx desc bytes |
  13307. * |-------------------------------------------------------------------|
  13308. * | | FW MSDU Rx |
  13309. * | | desc B0 |
  13310. * |-------------------------------------------------------------------|
  13311. * Header fields:
  13312. * - MSG_TYPE
  13313. * Bits 7:0
  13314. * Purpose: identifies this as an rx fragment indication message
  13315. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13316. * - EXT_TID
  13317. * Bits 12:8
  13318. * Purpose: identify the traffic ID of the rx data, including
  13319. * special "extended" TID values for multicast, broadcast, and
  13320. * non-QoS data frames
  13321. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13322. * - FLUSH_VALID (FV)
  13323. * Bit 13
  13324. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13325. * is valid
  13326. * Value:
  13327. * 1 -> flush IE is valid and needs to be processed
  13328. * 0 -> flush IE is not valid and should be ignored
  13329. * - PEER_ID
  13330. * Bits 31:16
  13331. * Purpose: Identify, by ID, which peer sent the rx data
  13332. * Value: ID of the peer who sent the rx data
  13333. * - FLUSH_SEQ_NUM_START
  13334. * Bits 5:0
  13335. * Purpose: Indicate the start of a series of MPDUs to flush
  13336. * Not all MPDUs within this series are necessarily valid - the host
  13337. * must check each sequence number within this range to see if the
  13338. * corresponding MPDU is actually present.
  13339. * This field is only valid if the FV bit is set.
  13340. * Value:
  13341. * The sequence number for the first MPDUs to check to flush.
  13342. * The sequence number is masked by 0x3f.
  13343. * - FLUSH_SEQ_NUM_END
  13344. * Bits 11:6
  13345. * Purpose: Indicate the end of a series of MPDUs to flush
  13346. * Value:
  13347. * The sequence number one larger than the sequence number of the
  13348. * last MPDU to check to flush.
  13349. * The sequence number is masked by 0x3f.
  13350. * Not all MPDUs within this series are necessarily valid - the host
  13351. * must check each sequence number within this range to see if the
  13352. * corresponding MPDU is actually present.
  13353. * This field is only valid if the FV bit is set.
  13354. * Rx descriptor fields:
  13355. * - FW_RX_DESC_BYTES
  13356. * Bits 15:0
  13357. * Purpose: Indicate how many bytes in the Rx indication are used for
  13358. * FW Rx descriptors
  13359. * Value: 1
  13360. */
  13361. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13362. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13363. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13364. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13365. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13366. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13367. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13368. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13369. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13370. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13371. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13372. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13373. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13374. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13375. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13376. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13377. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13378. #define HTT_RX_FRAG_IND_BYTES \
  13379. (4 /* msg hdr */ + \
  13380. 4 /* flush spec */ + \
  13381. 4 /* (unused) FW rx desc bytes spec */ + \
  13382. 4 /* FW rx desc */)
  13383. /**
  13384. * @brief target -> host test message definition
  13385. *
  13386. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13387. *
  13388. * @details
  13389. * The following field definitions describe the format of the test
  13390. * message sent from the target to the host.
  13391. * The message consists of a 4-octet header, followed by a variable
  13392. * number of 32-bit integer values, followed by a variable number
  13393. * of 8-bit character values.
  13394. *
  13395. * |31 16|15 8|7 0|
  13396. * |-----------------------------------------------------------|
  13397. * | num chars | num ints | msg type |
  13398. * |-----------------------------------------------------------|
  13399. * | int 0 |
  13400. * |-----------------------------------------------------------|
  13401. * | int 1 |
  13402. * |-----------------------------------------------------------|
  13403. * | ... |
  13404. * |-----------------------------------------------------------|
  13405. * | char 3 | char 2 | char 1 | char 0 |
  13406. * |-----------------------------------------------------------|
  13407. * | | | ... | char 4 |
  13408. * |-----------------------------------------------------------|
  13409. * - MSG_TYPE
  13410. * Bits 7:0
  13411. * Purpose: identifies this as a test message
  13412. * Value: HTT_MSG_TYPE_TEST
  13413. * - NUM_INTS
  13414. * Bits 15:8
  13415. * Purpose: indicate how many 32-bit integers follow the message header
  13416. * - NUM_CHARS
  13417. * Bits 31:16
  13418. * Purpose: indicate how many 8-bit characters follow the series of integers
  13419. */
  13420. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13421. #define HTT_RX_TEST_NUM_INTS_S 8
  13422. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13423. #define HTT_RX_TEST_NUM_CHARS_S 16
  13424. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13425. do { \
  13426. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13427. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13428. } while (0)
  13429. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13430. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13431. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13432. do { \
  13433. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13434. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13435. } while (0)
  13436. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13437. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13438. /**
  13439. * @brief target -> host packet log message
  13440. *
  13441. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13442. *
  13443. * @details
  13444. * The following field definitions describe the format of the packet log
  13445. * message sent from the target to the host.
  13446. * The message consists of a 4-octet header,followed by a variable number
  13447. * of 32-bit character values.
  13448. *
  13449. * |31 16|15 12|11 10|9 8|7 0|
  13450. * |------------------------------------------------------------------|
  13451. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13452. * |------------------------------------------------------------------|
  13453. * | payload |
  13454. * |------------------------------------------------------------------|
  13455. * - MSG_TYPE
  13456. * Bits 7:0
  13457. * Purpose: identifies this as a pktlog message
  13458. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13459. * - mac_id
  13460. * Bits 9:8
  13461. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13462. * Value: 0-3
  13463. * - pdev_id
  13464. * Bits 11:10
  13465. * Purpose: pdev_id
  13466. * Value: 0-3
  13467. * 0 (for rings at SOC level),
  13468. * 1/2/3 PDEV -> 0/1/2
  13469. * - payload_size
  13470. * Bits 31:16
  13471. * Purpose: explicitly specify the payload size
  13472. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13473. */
  13474. PREPACK struct htt_pktlog_msg {
  13475. A_UINT32 header;
  13476. A_UINT32 payload[1/* or more */];
  13477. } POSTPACK;
  13478. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13479. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13480. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13481. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13482. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13483. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13484. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13485. do { \
  13486. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13487. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13488. } while (0)
  13489. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13490. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13491. HTT_T2H_PKTLOG_MAC_ID_S)
  13492. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13493. do { \
  13494. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13495. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13496. } while (0)
  13497. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13498. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13499. HTT_T2H_PKTLOG_PDEV_ID_S)
  13500. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13501. do { \
  13502. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13503. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13504. } while (0)
  13505. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13506. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13507. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13508. /*
  13509. * Rx reorder statistics
  13510. * NB: all the fields must be defined in 4 octets size.
  13511. */
  13512. struct rx_reorder_stats {
  13513. /* Non QoS MPDUs received */
  13514. A_UINT32 deliver_non_qos;
  13515. /* MPDUs received in-order */
  13516. A_UINT32 deliver_in_order;
  13517. /* Flush due to reorder timer expired */
  13518. A_UINT32 deliver_flush_timeout;
  13519. /* Flush due to move out of window */
  13520. A_UINT32 deliver_flush_oow;
  13521. /* Flush due to DELBA */
  13522. A_UINT32 deliver_flush_delba;
  13523. /* MPDUs dropped due to FCS error */
  13524. A_UINT32 fcs_error;
  13525. /* MPDUs dropped due to monitor mode non-data packet */
  13526. A_UINT32 mgmt_ctrl;
  13527. /* Unicast-data MPDUs dropped due to invalid peer */
  13528. A_UINT32 invalid_peer;
  13529. /* MPDUs dropped due to duplication (non aggregation) */
  13530. A_UINT32 dup_non_aggr;
  13531. /* MPDUs dropped due to processed before */
  13532. A_UINT32 dup_past;
  13533. /* MPDUs dropped due to duplicate in reorder queue */
  13534. A_UINT32 dup_in_reorder;
  13535. /* Reorder timeout happened */
  13536. A_UINT32 reorder_timeout;
  13537. /* invalid bar ssn */
  13538. A_UINT32 invalid_bar_ssn;
  13539. /* reorder reset due to bar ssn */
  13540. A_UINT32 ssn_reset;
  13541. /* Flush due to delete peer */
  13542. A_UINT32 deliver_flush_delpeer;
  13543. /* Flush due to offload*/
  13544. A_UINT32 deliver_flush_offload;
  13545. /* Flush due to out of buffer*/
  13546. A_UINT32 deliver_flush_oob;
  13547. /* MPDUs dropped due to PN check fail */
  13548. A_UINT32 pn_fail;
  13549. /* MPDUs dropped due to unable to allocate memory */
  13550. A_UINT32 store_fail;
  13551. /* Number of times the tid pool alloc succeeded */
  13552. A_UINT32 tid_pool_alloc_succ;
  13553. /* Number of times the MPDU pool alloc succeeded */
  13554. A_UINT32 mpdu_pool_alloc_succ;
  13555. /* Number of times the MSDU pool alloc succeeded */
  13556. A_UINT32 msdu_pool_alloc_succ;
  13557. /* Number of times the tid pool alloc failed */
  13558. A_UINT32 tid_pool_alloc_fail;
  13559. /* Number of times the MPDU pool alloc failed */
  13560. A_UINT32 mpdu_pool_alloc_fail;
  13561. /* Number of times the MSDU pool alloc failed */
  13562. A_UINT32 msdu_pool_alloc_fail;
  13563. /* Number of times the tid pool freed */
  13564. A_UINT32 tid_pool_free;
  13565. /* Number of times the MPDU pool freed */
  13566. A_UINT32 mpdu_pool_free;
  13567. /* Number of times the MSDU pool freed */
  13568. A_UINT32 msdu_pool_free;
  13569. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13570. A_UINT32 msdu_queued;
  13571. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13572. A_UINT32 msdu_recycled;
  13573. /* Number of MPDUs with invalid peer but A2 found in AST */
  13574. A_UINT32 invalid_peer_a2_in_ast;
  13575. /* Number of MPDUs with invalid peer but A3 found in AST */
  13576. A_UINT32 invalid_peer_a3_in_ast;
  13577. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13578. A_UINT32 invalid_peer_bmc_mpdus;
  13579. /* Number of MSDUs with err attention word */
  13580. A_UINT32 rxdesc_err_att;
  13581. /* Number of MSDUs with flag of peer_idx_invalid */
  13582. A_UINT32 rxdesc_err_peer_idx_inv;
  13583. /* Number of MSDUs with flag of peer_idx_timeout */
  13584. A_UINT32 rxdesc_err_peer_idx_to;
  13585. /* Number of MSDUs with flag of overflow */
  13586. A_UINT32 rxdesc_err_ov;
  13587. /* Number of MSDUs with flag of msdu_length_err */
  13588. A_UINT32 rxdesc_err_msdu_len;
  13589. /* Number of MSDUs with flag of mpdu_length_err */
  13590. A_UINT32 rxdesc_err_mpdu_len;
  13591. /* Number of MSDUs with flag of tkip_mic_err */
  13592. A_UINT32 rxdesc_err_tkip_mic;
  13593. /* Number of MSDUs with flag of decrypt_err */
  13594. A_UINT32 rxdesc_err_decrypt;
  13595. /* Number of MSDUs with flag of fcs_err */
  13596. A_UINT32 rxdesc_err_fcs;
  13597. /* Number of Unicast (bc_mc bit is not set in attention word)
  13598. * frames with invalid peer handler
  13599. */
  13600. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13601. /* Number of unicast frame directly (direct bit is set in attention word)
  13602. * to DUT with invalid peer handler
  13603. */
  13604. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13605. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13606. * frames with invalid peer handler
  13607. */
  13608. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13609. /* Number of MSDUs dropped due to no first MSDU flag */
  13610. A_UINT32 rxdesc_no_1st_msdu;
  13611. /* Number of MSDUs dropped due to ring overflow */
  13612. A_UINT32 msdu_drop_ring_ov;
  13613. /* Number of MSDUs dropped due to FC mismatch */
  13614. A_UINT32 msdu_drop_fc_mismatch;
  13615. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13616. A_UINT32 msdu_drop_mgmt_remote_ring;
  13617. /* Number of MSDUs dropped due to errors not reported in attention word */
  13618. A_UINT32 msdu_drop_misc;
  13619. /* Number of MSDUs go to offload before reorder */
  13620. A_UINT32 offload_msdu_wal;
  13621. /* Number of data frame dropped by offload after reorder */
  13622. A_UINT32 offload_msdu_reorder;
  13623. /* Number of MPDUs with sequence number in the past and within the BA window */
  13624. A_UINT32 dup_past_within_window;
  13625. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13626. A_UINT32 dup_past_outside_window;
  13627. /* Number of MSDUs with decrypt/MIC error */
  13628. A_UINT32 rxdesc_err_decrypt_mic;
  13629. /* Number of data MSDUs received on both local and remote rings */
  13630. A_UINT32 data_msdus_on_both_rings;
  13631. /* MPDUs never filled */
  13632. A_UINT32 holes_not_filled;
  13633. };
  13634. /*
  13635. * Rx Remote buffer statistics
  13636. * NB: all the fields must be defined in 4 octets size.
  13637. */
  13638. struct rx_remote_buffer_mgmt_stats {
  13639. /* Total number of MSDUs reaped for Rx processing */
  13640. A_UINT32 remote_reaped;
  13641. /* MSDUs recycled within firmware */
  13642. A_UINT32 remote_recycled;
  13643. /* MSDUs stored by Data Rx */
  13644. A_UINT32 data_rx_msdus_stored;
  13645. /* Number of HTT indications from WAL Rx MSDU */
  13646. A_UINT32 wal_rx_ind;
  13647. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13648. A_UINT32 wal_rx_ind_unconsumed;
  13649. /* Number of HTT indications from Data Rx MSDU */
  13650. A_UINT32 data_rx_ind;
  13651. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13652. A_UINT32 data_rx_ind_unconsumed;
  13653. /* Number of HTT indications from ATHBUF */
  13654. A_UINT32 athbuf_rx_ind;
  13655. /* Number of remote buffers requested for refill */
  13656. A_UINT32 refill_buf_req;
  13657. /* Number of remote buffers filled by the host */
  13658. A_UINT32 refill_buf_rsp;
  13659. /* Number of times MAC hw_index = f/w write_index */
  13660. A_INT32 mac_no_bufs;
  13661. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13662. A_INT32 fw_indices_equal;
  13663. /* Number of times f/w finds no buffers to post */
  13664. A_INT32 host_no_bufs;
  13665. };
  13666. /*
  13667. * TXBF MU/SU packets and NDPA statistics
  13668. * NB: all the fields must be defined in 4 octets size.
  13669. */
  13670. struct rx_txbf_musu_ndpa_pkts_stats {
  13671. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13672. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13673. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13674. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13675. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13676. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13677. };
  13678. /*
  13679. * htt_dbg_stats_status -
  13680. * present - The requested stats have been delivered in full.
  13681. * This indicates that either the stats information was contained
  13682. * in its entirety within this message, or else this message
  13683. * completes the delivery of the requested stats info that was
  13684. * partially delivered through earlier STATS_CONF messages.
  13685. * partial - The requested stats have been delivered in part.
  13686. * One or more subsequent STATS_CONF messages with the same
  13687. * cookie value will be sent to deliver the remainder of the
  13688. * information.
  13689. * error - The requested stats could not be delivered, for example due
  13690. * to a shortage of memory to construct a message holding the
  13691. * requested stats.
  13692. * invalid - The requested stat type is either not recognized, or the
  13693. * target is configured to not gather the stats type in question.
  13694. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13695. * series_done - This special value indicates that no further stats info
  13696. * elements are present within a series of stats info elems
  13697. * (within a stats upload confirmation message).
  13698. */
  13699. enum htt_dbg_stats_status {
  13700. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13701. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13702. HTT_DBG_STATS_STATUS_ERROR = 2,
  13703. HTT_DBG_STATS_STATUS_INVALID = 3,
  13704. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13705. };
  13706. /**
  13707. * @brief target -> host statistics upload
  13708. *
  13709. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13710. *
  13711. * @details
  13712. * The following field definitions describe the format of the HTT target
  13713. * to host stats upload confirmation message.
  13714. * The message contains a cookie echoed from the HTT host->target stats
  13715. * upload request, which identifies which request the confirmation is
  13716. * for, and a series of tag-length-value stats information elements.
  13717. * The tag-length header for each stats info element also includes a
  13718. * status field, to indicate whether the request for the stat type in
  13719. * question was fully met, partially met, unable to be met, or invalid
  13720. * (if the stat type in question is disabled in the target).
  13721. * A special value of all 1's in this status field is used to indicate
  13722. * the end of the series of stats info elements.
  13723. *
  13724. *
  13725. * |31 16|15 8|7 5|4 0|
  13726. * |------------------------------------------------------------|
  13727. * | reserved | msg type |
  13728. * |------------------------------------------------------------|
  13729. * | cookie LSBs |
  13730. * |------------------------------------------------------------|
  13731. * | cookie MSBs |
  13732. * |------------------------------------------------------------|
  13733. * | stats entry length | reserved | S |stat type|
  13734. * |------------------------------------------------------------|
  13735. * | |
  13736. * | type-specific stats info |
  13737. * | |
  13738. * |------------------------------------------------------------|
  13739. * | stats entry length | reserved | S |stat type|
  13740. * |------------------------------------------------------------|
  13741. * | |
  13742. * | type-specific stats info |
  13743. * | |
  13744. * |------------------------------------------------------------|
  13745. * | n/a | reserved | 111 | n/a |
  13746. * |------------------------------------------------------------|
  13747. * Header fields:
  13748. * - MSG_TYPE
  13749. * Bits 7:0
  13750. * Purpose: identifies this is a statistics upload confirmation message
  13751. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13752. * - COOKIE_LSBS
  13753. * Bits 31:0
  13754. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13755. * message with its preceding host->target stats request message.
  13756. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13757. * - COOKIE_MSBS
  13758. * Bits 31:0
  13759. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13760. * message with its preceding host->target stats request message.
  13761. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13762. *
  13763. * Stats Information Element tag-length header fields:
  13764. * - STAT_TYPE
  13765. * Bits 4:0
  13766. * Purpose: identifies the type of statistics info held in the
  13767. * following information element
  13768. * Value: htt_dbg_stats_type
  13769. * - STATUS
  13770. * Bits 7:5
  13771. * Purpose: indicate whether the requested stats are present
  13772. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13773. * the completion of the stats entry series
  13774. * - LENGTH
  13775. * Bits 31:16
  13776. * Purpose: indicate the stats information size
  13777. * Value: This field specifies the number of bytes of stats information
  13778. * that follows the element tag-length header.
  13779. * It is expected but not required that this length is a multiple of
  13780. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13781. * subsequent stats entry header will begin on a 4-byte aligned
  13782. * boundary.
  13783. */
  13784. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13785. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13786. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13787. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13788. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13789. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13790. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13791. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13792. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13793. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13794. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13795. do { \
  13796. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13797. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13798. } while (0)
  13799. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13800. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13801. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13802. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13803. do { \
  13804. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13805. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13806. } while (0)
  13807. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13808. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13809. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13810. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13811. do { \
  13812. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13813. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13814. } while (0)
  13815. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13816. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13817. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13818. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13819. #define HTT_MAX_AGGR 64
  13820. #define HTT_HL_MAX_AGGR 18
  13821. /**
  13822. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13823. *
  13824. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13825. *
  13826. * @details
  13827. * The following field definitions describe the format of the HTT host
  13828. * to target frag_desc/msdu_ext bank configuration message.
  13829. * The message contains the based address and the min and max id of the
  13830. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13831. * MSDU_EXT/FRAG_DESC.
  13832. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13833. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13834. * the hardware does the mapping/translation.
  13835. *
  13836. * Total banks that can be configured is configured to 16.
  13837. *
  13838. * This should be called before any TX has be initiated by the HTT
  13839. *
  13840. * |31 16|15 8|7 5|4 0|
  13841. * |------------------------------------------------------------|
  13842. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13843. * |------------------------------------------------------------|
  13844. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13845. #if HTT_PADDR64
  13846. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13847. #endif
  13848. * |------------------------------------------------------------|
  13849. * | ... |
  13850. * |------------------------------------------------------------|
  13851. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13852. #if HTT_PADDR64
  13853. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13854. #endif
  13855. * |------------------------------------------------------------|
  13856. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13857. * |------------------------------------------------------------|
  13858. * | ... |
  13859. * |------------------------------------------------------------|
  13860. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13861. * |------------------------------------------------------------|
  13862. * Header fields:
  13863. * - MSG_TYPE
  13864. * Bits 7:0
  13865. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13866. * for systems with 64-bit format for bus addresses:
  13867. * - BANKx_BASE_ADDRESS_LO
  13868. * Bits 31:0
  13869. * Purpose: Provide a mechanism to specify the base address of the
  13870. * MSDU_EXT bank physical/bus address.
  13871. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13872. * - BANKx_BASE_ADDRESS_HI
  13873. * Bits 31:0
  13874. * Purpose: Provide a mechanism to specify the base address of the
  13875. * MSDU_EXT bank physical/bus address.
  13876. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13877. * for systems with 32-bit format for bus addresses:
  13878. * - BANKx_BASE_ADDRESS
  13879. * Bits 31:0
  13880. * Purpose: Provide a mechanism to specify the base address of the
  13881. * MSDU_EXT bank physical/bus address.
  13882. * Value: MSDU_EXT bank physical / bus address
  13883. * - BANKx_MIN_ID
  13884. * Bits 15:0
  13885. * Purpose: Provide a mechanism to specify the min index that needs to
  13886. * mapped.
  13887. * - BANKx_MAX_ID
  13888. * Bits 31:16
  13889. * Purpose: Provide a mechanism to specify the max index that needs to
  13890. * mapped.
  13891. *
  13892. */
  13893. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13894. * safe value.
  13895. * @note MAX supported banks is 16.
  13896. */
  13897. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13898. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13899. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13900. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13901. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13902. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13903. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13904. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13905. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13906. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13907. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13908. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13909. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13910. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13911. do { \
  13912. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13913. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13914. } while (0)
  13915. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13916. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13917. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13918. do { \
  13919. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13920. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13921. } while (0)
  13922. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13923. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13924. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13925. do { \
  13926. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13927. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13928. } while (0)
  13929. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13930. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13931. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13932. do { \
  13933. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13934. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13935. } while (0)
  13936. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13937. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13938. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13939. do { \
  13940. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13941. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13942. } while (0)
  13943. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13944. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13945. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13946. do { \
  13947. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13948. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13949. } while (0)
  13950. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13951. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13952. /*
  13953. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13954. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13955. * addresses are stored in a XXX-bit field.
  13956. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13957. * htt_tx_frag_desc64_bank_cfg_t structs.
  13958. */
  13959. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13960. _paddr_bits_, \
  13961. _paddr__bank_base_address_) \
  13962. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13963. /** word 0 \
  13964. * msg_type: 8, \
  13965. * pdev_id: 2, \
  13966. * swap: 1, \
  13967. * reserved0: 5, \
  13968. * num_banks: 8, \
  13969. * desc_size: 8; \
  13970. */ \
  13971. A_UINT32 word0; \
  13972. /* \
  13973. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13974. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13975. * the second A_UINT32). \
  13976. */ \
  13977. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13978. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13979. } POSTPACK
  13980. /* define htt_tx_frag_desc32_bank_cfg_t */
  13981. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13982. /* define htt_tx_frag_desc64_bank_cfg_t */
  13983. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13984. /*
  13985. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13986. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13987. */
  13988. #if HTT_PADDR64
  13989. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13990. #else
  13991. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13992. #endif
  13993. /**
  13994. * @brief target -> host HTT TX Credit total count update message definition
  13995. *
  13996. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13997. *
  13998. *|31 16|15|14 9| 8 |7 0 |
  13999. *|---------------------+--+----------+-------+----------|
  14000. *|cur htt credit delta | Q| reserved | sign | msg type |
  14001. *|------------------------------------------------------|
  14002. *
  14003. * Header fields:
  14004. * - MSG_TYPE
  14005. * Bits 7:0
  14006. * Purpose: identifies this as a htt tx credit delta update message
  14007. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14008. * - SIGN
  14009. * Bits 8
  14010. * identifies whether credit delta is positive or negative
  14011. * Value:
  14012. * - 0x0: credit delta is positive, rebalance in some buffers
  14013. * - 0x1: credit delta is negative, rebalance out some buffers
  14014. * - reserved
  14015. * Bits 14:9
  14016. * Value: 0x0
  14017. * - TXQ_GRP
  14018. * Bit 15
  14019. * Purpose: indicates whether any tx queue group information elements
  14020. * are appended to the tx credit update message
  14021. * Value: 0 -> no tx queue group information element is present
  14022. * 1 -> a tx queue group information element immediately follows
  14023. * - DELTA_COUNT
  14024. * Bits 31:16
  14025. * Purpose: Specify current htt credit delta absolute count
  14026. */
  14027. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14028. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14029. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14030. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14031. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14032. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14033. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14034. do { \
  14035. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14036. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14037. } while (0)
  14038. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14039. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14040. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14041. do { \
  14042. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14043. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14044. } while (0)
  14045. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14046. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14047. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14048. do { \
  14049. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14050. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14051. } while (0)
  14052. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14053. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14054. #define HTT_TX_CREDIT_MSG_BYTES 4
  14055. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14056. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14057. /**
  14058. * @brief HTT WDI_IPA Operation Response Message
  14059. *
  14060. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14061. *
  14062. * @details
  14063. * HTT WDI_IPA Operation Response message is sent by target
  14064. * to host confirming suspend or resume operation.
  14065. * |31 24|23 16|15 8|7 0|
  14066. * |----------------+----------------+----------------+----------------|
  14067. * | op_code | Rsvd | msg_type |
  14068. * |-------------------------------------------------------------------|
  14069. * | Rsvd | Response len |
  14070. * |-------------------------------------------------------------------|
  14071. * | |
  14072. * | Response-type specific info |
  14073. * | |
  14074. * | |
  14075. * |-------------------------------------------------------------------|
  14076. * Header fields:
  14077. * - MSG_TYPE
  14078. * Bits 7:0
  14079. * Purpose: Identifies this as WDI_IPA Operation Response message
  14080. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14081. * - OP_CODE
  14082. * Bits 31:16
  14083. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14084. * value: = enum htt_wdi_ipa_op_code
  14085. * - RSP_LEN
  14086. * Bits 16:0
  14087. * Purpose: length for the response-type specific info
  14088. * value: = length in bytes for response-type specific info
  14089. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14090. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14091. */
  14092. PREPACK struct htt_wdi_ipa_op_response_t
  14093. {
  14094. /* DWORD 0: flags and meta-data */
  14095. A_UINT32
  14096. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14097. reserved1: 8,
  14098. op_code: 16;
  14099. A_UINT32
  14100. rsp_len: 16,
  14101. reserved2: 16;
  14102. } POSTPACK;
  14103. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14104. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14105. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14106. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14107. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14108. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14109. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14110. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14111. do { \
  14112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14113. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14114. } while (0)
  14115. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14116. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14117. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14118. do { \
  14119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14120. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14121. } while (0)
  14122. enum htt_phy_mode {
  14123. htt_phy_mode_11a = 0,
  14124. htt_phy_mode_11g = 1,
  14125. htt_phy_mode_11b = 2,
  14126. htt_phy_mode_11g_only = 3,
  14127. htt_phy_mode_11na_ht20 = 4,
  14128. htt_phy_mode_11ng_ht20 = 5,
  14129. htt_phy_mode_11na_ht40 = 6,
  14130. htt_phy_mode_11ng_ht40 = 7,
  14131. htt_phy_mode_11ac_vht20 = 8,
  14132. htt_phy_mode_11ac_vht40 = 9,
  14133. htt_phy_mode_11ac_vht80 = 10,
  14134. htt_phy_mode_11ac_vht20_2g = 11,
  14135. htt_phy_mode_11ac_vht40_2g = 12,
  14136. htt_phy_mode_11ac_vht80_2g = 13,
  14137. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14138. htt_phy_mode_11ac_vht160 = 15,
  14139. htt_phy_mode_max,
  14140. };
  14141. /**
  14142. * @brief target -> host HTT channel change indication
  14143. *
  14144. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14145. *
  14146. * @details
  14147. * Specify when a channel change occurs.
  14148. * This allows the host to precisely determine which rx frames arrived
  14149. * on the old channel and which rx frames arrived on the new channel.
  14150. *
  14151. *|31 |7 0 |
  14152. *|-------------------------------------------+----------|
  14153. *| reserved | msg type |
  14154. *|------------------------------------------------------|
  14155. *| primary_chan_center_freq_mhz |
  14156. *|------------------------------------------------------|
  14157. *| contiguous_chan1_center_freq_mhz |
  14158. *|------------------------------------------------------|
  14159. *| contiguous_chan2_center_freq_mhz |
  14160. *|------------------------------------------------------|
  14161. *| phy_mode |
  14162. *|------------------------------------------------------|
  14163. *
  14164. * Header fields:
  14165. * - MSG_TYPE
  14166. * Bits 7:0
  14167. * Purpose: identifies this as a htt channel change indication message
  14168. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14169. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14170. * Bits 31:0
  14171. * Purpose: identify the (center of the) new 20 MHz primary channel
  14172. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14173. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14174. * Bits 31:0
  14175. * Purpose: identify the (center of the) contiguous frequency range
  14176. * comprising the new channel.
  14177. * For example, if the new channel is a 80 MHz channel extending
  14178. * 60 MHz beyond the primary channel, this field would be 30 larger
  14179. * than the primary channel center frequency field.
  14180. * Value: center frequency of the contiguous frequency range comprising
  14181. * the full channel in MHz units
  14182. * (80+80 channels also use the CONTIG_CHAN2 field)
  14183. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14184. * Bits 31:0
  14185. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14186. * within a VHT 80+80 channel.
  14187. * This field is only relevant for VHT 80+80 channels.
  14188. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14189. * channel (arbitrary value for cases besides VHT 80+80)
  14190. * - PHY_MODE
  14191. * Bits 31:0
  14192. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14193. * and band
  14194. * Value: htt_phy_mode enum value
  14195. */
  14196. PREPACK struct htt_chan_change_t
  14197. {
  14198. /* DWORD 0: flags and meta-data */
  14199. A_UINT32
  14200. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14201. reserved1: 24;
  14202. A_UINT32 primary_chan_center_freq_mhz;
  14203. A_UINT32 contig_chan1_center_freq_mhz;
  14204. A_UINT32 contig_chan2_center_freq_mhz;
  14205. A_UINT32 phy_mode;
  14206. } POSTPACK;
  14207. /*
  14208. * Due to historical / backwards-compatibility reasons, maintain the
  14209. * below htt_chan_change_msg struct definition, which needs to be
  14210. * consistent with the above htt_chan_change_t struct definition
  14211. * (aside from the htt_chan_change_t definition including the msg_type
  14212. * dword within the message, and the htt_chan_change_msg only containing
  14213. * the payload of the message that follows the msg_type dword).
  14214. */
  14215. PREPACK struct htt_chan_change_msg {
  14216. A_UINT32 chan_mhz; /* frequency in mhz */
  14217. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14218. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14219. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14220. } POSTPACK;
  14221. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14222. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14223. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14224. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14225. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14226. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14227. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14228. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14229. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14230. do { \
  14231. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14232. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14233. } while (0)
  14234. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14235. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14236. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14237. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14238. do { \
  14239. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14240. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14241. } while (0)
  14242. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14243. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14244. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14245. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14246. do { \
  14247. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14248. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14249. } while (0)
  14250. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14251. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14252. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14253. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14254. do { \
  14255. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14256. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14257. } while (0)
  14258. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14259. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14260. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14261. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14262. /**
  14263. * @brief rx offload packet error message
  14264. *
  14265. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14266. *
  14267. * @details
  14268. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14269. * of target payload like mic err.
  14270. *
  14271. * |31 24|23 16|15 8|7 0|
  14272. * |----------------+----------------+----------------+----------------|
  14273. * | tid | vdev_id | msg_sub_type | msg_type |
  14274. * |-------------------------------------------------------------------|
  14275. * : (sub-type dependent content) :
  14276. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14277. * Header fields:
  14278. * - msg_type
  14279. * Bits 7:0
  14280. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14281. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14282. * - msg_sub_type
  14283. * Bits 15:8
  14284. * Purpose: Identifies which type of rx error is reported by this message
  14285. * value: htt_rx_ofld_pkt_err_type
  14286. * - vdev_id
  14287. * Bits 23:16
  14288. * Purpose: Identifies which vdev received the erroneous rx frame
  14289. * value:
  14290. * - tid
  14291. * Bits 31:24
  14292. * Purpose: Identifies the traffic type of the rx frame
  14293. * value:
  14294. *
  14295. * - The payload fields used if the sub-type == MIC error are shown below.
  14296. * Note - MIC err is per MSDU, while PN is per MPDU.
  14297. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14298. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14299. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14300. * instead of sending separate HTT messages for each wrong MSDU within
  14301. * the MPDU.
  14302. *
  14303. * |31 24|23 16|15 8|7 0|
  14304. * |----------------+----------------+----------------+----------------|
  14305. * | Rsvd | key_id | peer_id |
  14306. * |-------------------------------------------------------------------|
  14307. * | receiver MAC addr 31:0 |
  14308. * |-------------------------------------------------------------------|
  14309. * | Rsvd | receiver MAC addr 47:32 |
  14310. * |-------------------------------------------------------------------|
  14311. * | transmitter MAC addr 31:0 |
  14312. * |-------------------------------------------------------------------|
  14313. * | Rsvd | transmitter MAC addr 47:32 |
  14314. * |-------------------------------------------------------------------|
  14315. * | PN 31:0 |
  14316. * |-------------------------------------------------------------------|
  14317. * | Rsvd | PN 47:32 |
  14318. * |-------------------------------------------------------------------|
  14319. * - peer_id
  14320. * Bits 15:0
  14321. * Purpose: identifies which peer is frame is from
  14322. * value:
  14323. * - key_id
  14324. * Bits 23:16
  14325. * Purpose: identifies key_id of rx frame
  14326. * value:
  14327. * - RA_31_0 (receiver MAC addr 31:0)
  14328. * Bits 31:0
  14329. * Purpose: identifies by MAC address which vdev received the frame
  14330. * value: MAC address lower 4 bytes
  14331. * - RA_47_32 (receiver MAC addr 47:32)
  14332. * Bits 15:0
  14333. * Purpose: identifies by MAC address which vdev received the frame
  14334. * value: MAC address upper 2 bytes
  14335. * - TA_31_0 (transmitter MAC addr 31:0)
  14336. * Bits 31:0
  14337. * Purpose: identifies by MAC address which peer transmitted the frame
  14338. * value: MAC address lower 4 bytes
  14339. * - TA_47_32 (transmitter MAC addr 47:32)
  14340. * Bits 15:0
  14341. * Purpose: identifies by MAC address which peer transmitted the frame
  14342. * value: MAC address upper 2 bytes
  14343. * - PN_31_0
  14344. * Bits 31:0
  14345. * Purpose: Identifies pn of rx frame
  14346. * value: PN lower 4 bytes
  14347. * - PN_47_32
  14348. * Bits 15:0
  14349. * Purpose: Identifies pn of rx frame
  14350. * value:
  14351. * TKIP or CCMP: PN upper 2 bytes
  14352. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14353. */
  14354. enum htt_rx_ofld_pkt_err_type {
  14355. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14356. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14357. };
  14358. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14359. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14360. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14361. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14362. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14363. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14364. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14365. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14366. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14367. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14368. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14369. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14370. do { \
  14371. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14372. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14373. } while (0)
  14374. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14375. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14376. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14377. do { \
  14378. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14379. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14380. } while (0)
  14381. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14382. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14383. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14384. do { \
  14385. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14386. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14387. } while (0)
  14388. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14389. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14390. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14391. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14392. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14393. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14394. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14395. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14396. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14397. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14398. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14399. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14400. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14401. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14402. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14403. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14404. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14405. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14406. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14407. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14408. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14409. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14410. do { \
  14411. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14412. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14413. } while (0)
  14414. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14415. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14416. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14417. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14418. do { \
  14419. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14420. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14421. } while (0)
  14422. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14423. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14424. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14425. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14426. do { \
  14427. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14428. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14429. } while (0)
  14430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14431. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14432. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14434. do { \
  14435. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14436. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14437. } while (0)
  14438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14439. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14440. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14442. do { \
  14443. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14444. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14445. } while (0)
  14446. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14447. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14448. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14449. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14450. do { \
  14451. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14452. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14453. } while (0)
  14454. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14455. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14456. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14457. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14458. do { \
  14459. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14460. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14461. } while (0)
  14462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14463. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14464. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14465. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14466. do { \
  14467. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14468. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14469. } while (0)
  14470. /**
  14471. * @brief target -> host peer rate report message
  14472. *
  14473. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14474. *
  14475. * @details
  14476. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14477. * justified rate of all the peers.
  14478. *
  14479. * |31 24|23 16|15 8|7 0|
  14480. * |----------------+----------------+----------------+----------------|
  14481. * | peer_count | | msg_type |
  14482. * |-------------------------------------------------------------------|
  14483. * : Payload (variant number of peer rate report) :
  14484. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14485. * Header fields:
  14486. * - msg_type
  14487. * Bits 7:0
  14488. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14489. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14490. * - reserved
  14491. * Bits 15:8
  14492. * Purpose:
  14493. * value:
  14494. * - peer_count
  14495. * Bits 31:16
  14496. * Purpose: Specify how many peer rate report elements are present in the payload.
  14497. * value:
  14498. *
  14499. * Payload:
  14500. * There are variant number of peer rate report follow the first 32 bits.
  14501. * The peer rate report is defined as follows.
  14502. *
  14503. * |31 20|19 16|15 0|
  14504. * |-----------------------+---------+---------------------------------|-
  14505. * | reserved | phy | peer_id | \
  14506. * |-------------------------------------------------------------------| -> report #0
  14507. * | rate | /
  14508. * |-----------------------+---------+---------------------------------|-
  14509. * | reserved | phy | peer_id | \
  14510. * |-------------------------------------------------------------------| -> report #1
  14511. * | rate | /
  14512. * |-----------------------+---------+---------------------------------|-
  14513. * | reserved | phy | peer_id | \
  14514. * |-------------------------------------------------------------------| -> report #2
  14515. * | rate | /
  14516. * |-------------------------------------------------------------------|-
  14517. * : :
  14518. * : :
  14519. * : :
  14520. * :-------------------------------------------------------------------:
  14521. *
  14522. * - peer_id
  14523. * Bits 15:0
  14524. * Purpose: identify the peer
  14525. * value:
  14526. * - phy
  14527. * Bits 19:16
  14528. * Purpose: identify which phy is in use
  14529. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14530. * Please see enum htt_peer_report_phy_type for detail.
  14531. * - reserved
  14532. * Bits 31:20
  14533. * Purpose:
  14534. * value:
  14535. * - rate
  14536. * Bits 31:0
  14537. * Purpose: represent the justified rate of the peer specified by peer_id
  14538. * value:
  14539. */
  14540. enum htt_peer_rate_report_phy_type {
  14541. HTT_PEER_RATE_REPORT_11B = 0,
  14542. HTT_PEER_RATE_REPORT_11A_G,
  14543. HTT_PEER_RATE_REPORT_11N,
  14544. HTT_PEER_RATE_REPORT_11AC,
  14545. };
  14546. #define HTT_PEER_RATE_REPORT_SIZE 8
  14547. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14548. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14549. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14550. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14551. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14552. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14553. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14554. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14555. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14556. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14557. do { \
  14558. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14559. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14560. } while (0)
  14561. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14562. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14563. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14564. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14565. do { \
  14566. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14567. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14568. } while (0)
  14569. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14570. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14571. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14572. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14573. do { \
  14574. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14575. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14576. } while (0)
  14577. /**
  14578. * @brief target -> host flow pool map message
  14579. *
  14580. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14581. *
  14582. * @details
  14583. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14584. * a flow of descriptors.
  14585. *
  14586. * This message is in TLV format and indicates the parameters to be setup a
  14587. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14588. * receive descriptors from a specified pool.
  14589. *
  14590. * The message would appear as follows:
  14591. *
  14592. * |31 24|23 16|15 8|7 0|
  14593. * |----------------+----------------+----------------+----------------|
  14594. * header | reserved | num_flows | msg_type |
  14595. * |-------------------------------------------------------------------|
  14596. * | |
  14597. * : payload :
  14598. * | |
  14599. * |-------------------------------------------------------------------|
  14600. *
  14601. * The header field is one DWORD long and is interpreted as follows:
  14602. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14603. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14604. * this message
  14605. * b'16-31 - reserved: These bits are reserved for future use
  14606. *
  14607. * Payload:
  14608. * The payload would contain multiple objects of the following structure. Each
  14609. * object represents a flow.
  14610. *
  14611. * |31 24|23 16|15 8|7 0|
  14612. * |----------------+----------------+----------------+----------------|
  14613. * header | reserved | num_flows | msg_type |
  14614. * |-------------------------------------------------------------------|
  14615. * payload0| flow_type |
  14616. * |-------------------------------------------------------------------|
  14617. * | flow_id |
  14618. * |-------------------------------------------------------------------|
  14619. * | reserved0 | flow_pool_id |
  14620. * |-------------------------------------------------------------------|
  14621. * | reserved1 | flow_pool_size |
  14622. * |-------------------------------------------------------------------|
  14623. * | reserved2 |
  14624. * |-------------------------------------------------------------------|
  14625. * payload1| flow_type |
  14626. * |-------------------------------------------------------------------|
  14627. * | flow_id |
  14628. * |-------------------------------------------------------------------|
  14629. * | reserved0 | flow_pool_id |
  14630. * |-------------------------------------------------------------------|
  14631. * | reserved1 | flow_pool_size |
  14632. * |-------------------------------------------------------------------|
  14633. * | reserved2 |
  14634. * |-------------------------------------------------------------------|
  14635. * | . |
  14636. * | . |
  14637. * | . |
  14638. * |-------------------------------------------------------------------|
  14639. *
  14640. * Each payload is 5 DWORDS long and is interpreted as follows:
  14641. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14642. * this flow is associated. It can be VDEV, peer,
  14643. * or tid (AC). Based on enum htt_flow_type.
  14644. *
  14645. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14646. * object. For flow_type vdev it is set to the
  14647. * vdevid, for peer it is peerid and for tid, it is
  14648. * tid_num.
  14649. *
  14650. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14651. * in the host for this flow
  14652. * b'16:31 - reserved0: This field in reserved for the future. In case
  14653. * we have a hierarchical implementation (HCM) of
  14654. * pools, it can be used to indicate the ID of the
  14655. * parent-pool.
  14656. *
  14657. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14658. * Descriptors for this flow will be
  14659. * allocated from this pool in the host.
  14660. * b'16:31 - reserved1: This field in reserved for the future. In case
  14661. * we have a hierarchical implementation of pools,
  14662. * it can be used to indicate the max number of
  14663. * descriptors in the pool. The b'0:15 can be used
  14664. * to indicate min number of descriptors in the
  14665. * HCM scheme.
  14666. *
  14667. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14668. * we have a hierarchical implementation of pools,
  14669. * b'0:15 can be used to indicate the
  14670. * priority-based borrowing (PBB) threshold of
  14671. * the flow's pool. The b'16:31 are still left
  14672. * reserved.
  14673. */
  14674. enum htt_flow_type {
  14675. FLOW_TYPE_VDEV = 0,
  14676. /* Insert new flow types above this line */
  14677. };
  14678. PREPACK struct htt_flow_pool_map_payload_t {
  14679. A_UINT32 flow_type;
  14680. A_UINT32 flow_id;
  14681. A_UINT32 flow_pool_id:16,
  14682. reserved0:16;
  14683. A_UINT32 flow_pool_size:16,
  14684. reserved1:16;
  14685. A_UINT32 reserved2;
  14686. } POSTPACK;
  14687. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14688. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14689. (sizeof(struct htt_flow_pool_map_payload_t))
  14690. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14691. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14692. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14693. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14694. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14695. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14696. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14697. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14698. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14699. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14700. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14701. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14702. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14703. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14704. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14705. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14706. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14707. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14708. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14709. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14710. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14711. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14712. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14713. do { \
  14714. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14715. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14716. } while (0)
  14717. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14718. do { \
  14719. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14720. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14721. } while (0)
  14722. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14723. do { \
  14724. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14725. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14726. } while (0)
  14727. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14728. do { \
  14729. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14730. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14731. } while (0)
  14732. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14733. do { \
  14734. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14735. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14736. } while (0)
  14737. /**
  14738. * @brief target -> host flow pool unmap message
  14739. *
  14740. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14741. *
  14742. * @details
  14743. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14744. * down a flow of descriptors.
  14745. * This message indicates that for the flow (whose ID is provided) is wanting
  14746. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14747. * pool of descriptors from where descriptors are being allocated for this
  14748. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14749. * be unmapped by the host.
  14750. *
  14751. * The message would appear as follows:
  14752. *
  14753. * |31 24|23 16|15 8|7 0|
  14754. * |----------------+----------------+----------------+----------------|
  14755. * | reserved0 | msg_type |
  14756. * |-------------------------------------------------------------------|
  14757. * | flow_type |
  14758. * |-------------------------------------------------------------------|
  14759. * | flow_id |
  14760. * |-------------------------------------------------------------------|
  14761. * | reserved1 | flow_pool_id |
  14762. * |-------------------------------------------------------------------|
  14763. *
  14764. * The message is interpreted as follows:
  14765. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14766. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14767. * b'8:31 - reserved0: Reserved for future use
  14768. *
  14769. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14770. * this flow is associated. It can be VDEV, peer,
  14771. * or tid (AC). Based on enum htt_flow_type.
  14772. *
  14773. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14774. * object. For flow_type vdev it is set to the
  14775. * vdevid, for peer it is peerid and for tid, it is
  14776. * tid_num.
  14777. *
  14778. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14779. * used in the host for this flow
  14780. * b'16:31 - reserved0: This field in reserved for the future.
  14781. *
  14782. */
  14783. PREPACK struct htt_flow_pool_unmap_t {
  14784. A_UINT32 msg_type:8,
  14785. reserved0:24;
  14786. A_UINT32 flow_type;
  14787. A_UINT32 flow_id;
  14788. A_UINT32 flow_pool_id:16,
  14789. reserved1:16;
  14790. } POSTPACK;
  14791. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14792. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14793. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14794. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14795. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14796. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14797. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14798. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14799. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14800. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14801. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14802. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14803. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14804. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14805. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14806. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14807. do { \
  14808. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14809. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14810. } while (0)
  14811. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14812. do { \
  14813. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14814. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14815. } while (0)
  14816. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14817. do { \
  14818. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14819. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14820. } while (0)
  14821. /**
  14822. * @brief target -> host SRING setup done message
  14823. *
  14824. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14825. *
  14826. * @details
  14827. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14828. * SRNG ring setup is done
  14829. *
  14830. * This message indicates whether the last setup operation is successful.
  14831. * It will be sent to host when host set respose_required bit in
  14832. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14833. * The message would appear as follows:
  14834. *
  14835. * |31 24|23 16|15 8|7 0|
  14836. * |--------------- +----------------+----------------+----------------|
  14837. * | setup_status | ring_id | pdev_id | msg_type |
  14838. * |-------------------------------------------------------------------|
  14839. *
  14840. * The message is interpreted as follows:
  14841. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14842. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14843. * b'8:15 - pdev_id:
  14844. * 0 (for rings at SOC/UMAC level),
  14845. * 1/2/3 mac id (for rings at LMAC level)
  14846. * b'16:23 - ring_id: Identify the ring which is set up
  14847. * More details can be got from enum htt_srng_ring_id
  14848. * b'24:31 - setup_status: Indicate status of setup operation
  14849. * Refer to htt_ring_setup_status
  14850. */
  14851. PREPACK struct htt_sring_setup_done_t {
  14852. A_UINT32 msg_type: 8,
  14853. pdev_id: 8,
  14854. ring_id: 8,
  14855. setup_status: 8;
  14856. } POSTPACK;
  14857. enum htt_ring_setup_status {
  14858. htt_ring_setup_status_ok = 0,
  14859. htt_ring_setup_status_error,
  14860. };
  14861. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14862. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14863. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14864. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14865. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14866. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14867. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14868. do { \
  14869. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14870. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14871. } while (0)
  14872. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14873. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14874. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14875. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14876. HTT_SRING_SETUP_DONE_RING_ID_S)
  14877. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14878. do { \
  14879. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14880. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14881. } while (0)
  14882. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14883. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14884. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14885. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14886. HTT_SRING_SETUP_DONE_STATUS_S)
  14887. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14888. do { \
  14889. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14890. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14891. } while (0)
  14892. /**
  14893. * @brief target -> flow map flow info
  14894. *
  14895. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14896. *
  14897. * @details
  14898. * HTT TX map flow entry with tqm flow pointer
  14899. * Sent from firmware to host to add tqm flow pointer in corresponding
  14900. * flow search entry. Flow metadata is replayed back to host as part of this
  14901. * struct to enable host to find the specific flow search entry
  14902. *
  14903. * The message would appear as follows:
  14904. *
  14905. * |31 28|27 18|17 14|13 8|7 0|
  14906. * |-------+------------------------------------------+----------------|
  14907. * | rsvd0 | fse_hsh_idx | msg_type |
  14908. * |-------------------------------------------------------------------|
  14909. * | rsvd1 | tid | peer_id |
  14910. * |-------------------------------------------------------------------|
  14911. * | tqm_flow_pntr_lo |
  14912. * |-------------------------------------------------------------------|
  14913. * | tqm_flow_pntr_hi |
  14914. * |-------------------------------------------------------------------|
  14915. * | fse_meta_data |
  14916. * |-------------------------------------------------------------------|
  14917. *
  14918. * The message is interpreted as follows:
  14919. *
  14920. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14921. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14922. *
  14923. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14924. * for this flow entry
  14925. *
  14926. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14927. *
  14928. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14929. *
  14930. * dword1 - b'14:17 - tid
  14931. *
  14932. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14933. *
  14934. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14935. *
  14936. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14937. *
  14938. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14939. * given by host
  14940. */
  14941. PREPACK struct htt_tx_map_flow_info {
  14942. A_UINT32
  14943. msg_type: 8,
  14944. fse_hsh_idx: 20,
  14945. rsvd0: 4;
  14946. A_UINT32
  14947. peer_id: 14,
  14948. tid: 4,
  14949. rsvd1: 14;
  14950. A_UINT32 tqm_flow_pntr_lo;
  14951. A_UINT32 tqm_flow_pntr_hi;
  14952. struct htt_tx_flow_metadata fse_meta_data;
  14953. } POSTPACK;
  14954. /* DWORD 0 */
  14955. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14956. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14957. /* DWORD 1 */
  14958. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14959. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14960. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14961. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14962. /* DWORD 0 */
  14963. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14964. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14965. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14966. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14967. do { \
  14968. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14969. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14970. } while (0)
  14971. /* DWORD 1 */
  14972. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14973. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14974. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14975. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14976. do { \
  14977. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14978. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14979. } while (0)
  14980. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14981. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14982. HTT_TX_MAP_FLOW_INFO_TID_S)
  14983. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14984. do { \
  14985. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14986. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14987. } while (0)
  14988. /*
  14989. * htt_dbg_ext_stats_status -
  14990. * present - The requested stats have been delivered in full.
  14991. * This indicates that either the stats information was contained
  14992. * in its entirety within this message, or else this message
  14993. * completes the delivery of the requested stats info that was
  14994. * partially delivered through earlier STATS_CONF messages.
  14995. * partial - The requested stats have been delivered in part.
  14996. * One or more subsequent STATS_CONF messages with the same
  14997. * cookie value will be sent to deliver the remainder of the
  14998. * information.
  14999. * error - The requested stats could not be delivered, for example due
  15000. * to a shortage of memory to construct a message holding the
  15001. * requested stats.
  15002. * invalid - The requested stat type is either not recognized, or the
  15003. * target is configured to not gather the stats type in question.
  15004. */
  15005. enum htt_dbg_ext_stats_status {
  15006. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15007. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15008. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15009. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15010. };
  15011. /**
  15012. * @brief target -> host ppdu stats upload
  15013. *
  15014. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15015. *
  15016. * @details
  15017. * The following field definitions describe the format of the HTT target
  15018. * to host ppdu stats indication message.
  15019. *
  15020. *
  15021. * |31 16|15 12|11 10|9 8|7 0 |
  15022. * |----------------------------------------------------------------------|
  15023. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15024. * |----------------------------------------------------------------------|
  15025. * | ppdu_id |
  15026. * |----------------------------------------------------------------------|
  15027. * | Timestamp in us |
  15028. * |----------------------------------------------------------------------|
  15029. * | reserved |
  15030. * |----------------------------------------------------------------------|
  15031. * | type-specific stats info |
  15032. * | (see htt_ppdu_stats.h) |
  15033. * |----------------------------------------------------------------------|
  15034. * Header fields:
  15035. * - MSG_TYPE
  15036. * Bits 7:0
  15037. * Purpose: Identifies this is a PPDU STATS indication
  15038. * message.
  15039. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15040. * - mac_id
  15041. * Bits 9:8
  15042. * Purpose: mac_id of this ppdu_id
  15043. * Value: 0-3
  15044. * - pdev_id
  15045. * Bits 11:10
  15046. * Purpose: pdev_id of this ppdu_id
  15047. * Value: 0-3
  15048. * 0 (for rings at SOC level),
  15049. * 1/2/3 PDEV -> 0/1/2
  15050. * - payload_size
  15051. * Bits 31:16
  15052. * Purpose: total tlv size
  15053. * Value: payload_size in bytes
  15054. */
  15055. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15056. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15057. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15058. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15059. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15060. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15061. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15062. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15063. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15064. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15065. do { \
  15066. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15067. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15068. } while (0)
  15069. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15070. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15071. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15072. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15073. do { \
  15074. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15075. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15076. } while (0)
  15077. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15078. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15079. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15080. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15081. do { \
  15082. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15083. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15084. } while (0)
  15085. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15086. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15087. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15088. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15089. do { \
  15090. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15091. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15092. } while (0)
  15093. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15094. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15095. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15096. /* htt_t2h_ppdu_stats_ind_hdr_t
  15097. * This struct contains the fields within the header of the
  15098. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15099. * stats info.
  15100. * This struct assumes little-endian layout, and thus is only
  15101. * suitable for use within processors known to be little-endian
  15102. * (such as the target).
  15103. * In contrast, the above macros provide endian-portable methods
  15104. * to get and set the bitfields within this PPDU_STATS_IND header.
  15105. */
  15106. typedef struct {
  15107. A_UINT32 msg_type: 8, /* bits 7:0 */
  15108. mac_id: 2, /* bits 9:8 */
  15109. pdev_id: 2, /* bits 11:10 */
  15110. reserved1: 4, /* bits 15:12 */
  15111. payload_size: 16; /* bits 31:16 */
  15112. A_UINT32 ppdu_id;
  15113. A_UINT32 timestamp_us;
  15114. A_UINT32 reserved2;
  15115. } htt_t2h_ppdu_stats_ind_hdr_t;
  15116. /**
  15117. * @brief target -> host extended statistics upload
  15118. *
  15119. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15120. *
  15121. * @details
  15122. * The following field definitions describe the format of the HTT target
  15123. * to host stats upload confirmation message.
  15124. * The message contains a cookie echoed from the HTT host->target stats
  15125. * upload request, which identifies which request the confirmation is
  15126. * for, and a single stats can span over multiple HTT stats indication
  15127. * due to the HTT message size limitation so every HTT ext stats indication
  15128. * will have tag-length-value stats information elements.
  15129. * The tag-length header for each HTT stats IND message also includes a
  15130. * status field, to indicate whether the request for the stat type in
  15131. * question was fully met, partially met, unable to be met, or invalid
  15132. * (if the stat type in question is disabled in the target).
  15133. * A Done bit 1's indicate the end of the of stats info elements.
  15134. *
  15135. *
  15136. * |31 16|15 12|11|10 8|7 5|4 0|
  15137. * |--------------------------------------------------------------|
  15138. * | reserved | msg type |
  15139. * |--------------------------------------------------------------|
  15140. * | cookie LSBs |
  15141. * |--------------------------------------------------------------|
  15142. * | cookie MSBs |
  15143. * |--------------------------------------------------------------|
  15144. * | stats entry length | rsvd | D| S | stat type |
  15145. * |--------------------------------------------------------------|
  15146. * | type-specific stats info |
  15147. * | (see htt_stats.h) |
  15148. * |--------------------------------------------------------------|
  15149. * Header fields:
  15150. * - MSG_TYPE
  15151. * Bits 7:0
  15152. * Purpose: Identifies this is a extended statistics upload confirmation
  15153. * message.
  15154. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15155. * - COOKIE_LSBS
  15156. * Bits 31:0
  15157. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15158. * message with its preceding host->target stats request message.
  15159. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15160. * - COOKIE_MSBS
  15161. * Bits 31:0
  15162. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15163. * message with its preceding host->target stats request message.
  15164. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15165. *
  15166. * Stats Information Element tag-length header fields:
  15167. * - STAT_TYPE
  15168. * Bits 7:0
  15169. * Purpose: identifies the type of statistics info held in the
  15170. * following information element
  15171. * Value: htt_dbg_ext_stats_type
  15172. * - STATUS
  15173. * Bits 10:8
  15174. * Purpose: indicate whether the requested stats are present
  15175. * Value: htt_dbg_ext_stats_status
  15176. * - DONE
  15177. * Bits 11
  15178. * Purpose:
  15179. * Indicates the completion of the stats entry, this will be the last
  15180. * stats conf HTT segment for the requested stats type.
  15181. * Value:
  15182. * 0 -> the stats retrieval is ongoing
  15183. * 1 -> the stats retrieval is complete
  15184. * - LENGTH
  15185. * Bits 31:16
  15186. * Purpose: indicate the stats information size
  15187. * Value: This field specifies the number of bytes of stats information
  15188. * that follows the element tag-length header.
  15189. * It is expected but not required that this length is a multiple of
  15190. * 4 bytes.
  15191. */
  15192. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15193. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15194. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15195. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15196. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15197. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15198. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15199. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15200. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15201. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15202. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15203. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15204. do { \
  15205. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15206. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15207. } while (0)
  15208. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15209. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15210. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15211. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15212. do { \
  15213. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15214. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15215. } while (0)
  15216. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15217. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15218. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15219. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15220. do { \
  15221. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15222. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15223. } while (0)
  15224. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15225. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15226. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15227. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15228. do { \
  15229. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15230. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15231. } while (0)
  15232. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15233. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15234. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15235. /**
  15236. * @brief target -> host streaming statistics upload
  15237. *
  15238. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15239. *
  15240. * @details
  15241. * The following field definitions describe the format of the HTT target
  15242. * to host streaming stats upload indication message.
  15243. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15244. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15245. * use the STREAMING_STATS_REQ message to halt the target's production of
  15246. * STREAMING_STATS_IND messages.
  15247. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15248. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15249. *
  15250. * |31 8|7 0|
  15251. * |--------------------------------------------------------------|
  15252. * | reserved | msg type |
  15253. * |--------------------------------------------------------------|
  15254. * | type-specific stats info |
  15255. * | (see htt_stats.h) |
  15256. * |--------------------------------------------------------------|
  15257. * Header fields:
  15258. * - MSG_TYPE
  15259. * Bits 7:0
  15260. * Purpose: Identifies this as a streaming statistics upload indication
  15261. * message.
  15262. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15263. */
  15264. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15265. typedef enum {
  15266. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15267. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15268. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15269. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15270. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15271. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15272. /* Reserved from 128 - 255 for target internal use.*/
  15273. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15274. } HTT_PEER_TYPE;
  15275. /** macro to convert MAC address from char array to HTT word format */
  15276. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15277. (phtt_mac_addr)->mac_addr31to0 = \
  15278. (((c_macaddr)[0] << 0) | \
  15279. ((c_macaddr)[1] << 8) | \
  15280. ((c_macaddr)[2] << 16) | \
  15281. ((c_macaddr)[3] << 24)); \
  15282. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15283. } while (0)
  15284. /**
  15285. * @brief target -> host monitor mac header indication message
  15286. *
  15287. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15288. *
  15289. * @details
  15290. * The following diagram shows the format of the monitor mac header message
  15291. * sent from the target to the host.
  15292. * This message is primarily sent when promiscuous rx mode is enabled.
  15293. * One message is sent per rx PPDU.
  15294. *
  15295. * |31 24|23 16|15 8|7 0|
  15296. * |-------------------------------------------------------------|
  15297. * | peer_id | reserved0 | msg_type |
  15298. * |-------------------------------------------------------------|
  15299. * | reserved1 | num_mpdu |
  15300. * |-------------------------------------------------------------|
  15301. * | struct hw_rx_desc |
  15302. * | (see wal_rx_desc.h) |
  15303. * |-------------------------------------------------------------|
  15304. * | struct ieee80211_frame_addr4 |
  15305. * | (see ieee80211_defs.h) |
  15306. * |-------------------------------------------------------------|
  15307. * | struct ieee80211_frame_addr4 |
  15308. * | (see ieee80211_defs.h) |
  15309. * |-------------------------------------------------------------|
  15310. * | ...... |
  15311. * |-------------------------------------------------------------|
  15312. *
  15313. * Header fields:
  15314. * - msg_type
  15315. * Bits 7:0
  15316. * Purpose: Identifies this is a monitor mac header indication message.
  15317. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15318. * - peer_id
  15319. * Bits 31:16
  15320. * Purpose: Software peer id given by host during association,
  15321. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15322. * for rx PPDUs received from unassociated peers.
  15323. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15324. * - num_mpdu
  15325. * Bits 15:0
  15326. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15327. * delivered within the message.
  15328. * Value: 1 to 32
  15329. * num_mpdu is limited to a maximum value of 32, due to buffer
  15330. * size limits. For PPDUs with more than 32 MPDUs, only the
  15331. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15332. * the PPDU will be provided.
  15333. */
  15334. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15335. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15336. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15337. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15338. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15339. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15340. do { \
  15341. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15342. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15343. } while (0)
  15344. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15345. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15346. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15347. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15348. do { \
  15349. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15350. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15351. } while (0)
  15352. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15353. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15354. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15355. /**
  15356. * @brief target -> host flow pool resize Message
  15357. *
  15358. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15359. *
  15360. * @details
  15361. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15362. * the flow pool associated with the specified ID is resized
  15363. *
  15364. * The message would appear as follows:
  15365. *
  15366. * |31 16|15 8|7 0|
  15367. * |---------------------------------+----------------+----------------|
  15368. * | reserved0 | Msg type |
  15369. * |-------------------------------------------------------------------|
  15370. * | flow pool new size | flow pool ID |
  15371. * |-------------------------------------------------------------------|
  15372. *
  15373. * The message is interpreted as follows:
  15374. * b'0:7 - msg_type: This will be set to 0x21
  15375. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15376. *
  15377. * b'0:15 - flow pool ID: Existing flow pool ID
  15378. *
  15379. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15380. *
  15381. */
  15382. PREPACK struct htt_flow_pool_resize_t {
  15383. A_UINT32 msg_type:8,
  15384. reserved0:24;
  15385. A_UINT32 flow_pool_id:16,
  15386. flow_pool_new_size:16;
  15387. } POSTPACK;
  15388. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15389. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15390. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15391. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15392. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15393. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15394. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15395. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15396. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15397. do { \
  15398. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15399. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15400. } while (0)
  15401. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15402. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15403. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15404. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15405. do { \
  15406. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15407. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15408. } while (0)
  15409. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15410. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15411. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15412. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15413. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15414. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15415. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15416. /*
  15417. * The read and write indices point to the data within the host buffer.
  15418. * Because the first 4 bytes of the host buffer is used for the read index and
  15419. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15420. * The read index and write index are the byte offsets from the base of the
  15421. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15422. * Refer the ASCII text picture below.
  15423. */
  15424. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15425. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15426. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15427. /*
  15428. ***************************************************************************
  15429. *
  15430. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15431. *
  15432. ***************************************************************************
  15433. *
  15434. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15435. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15436. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15437. * written into the Host memory region mentioned below.
  15438. *
  15439. * Read index is updated by the Host. At any point of time, the read index will
  15440. * indicate the index that will next be read by the Host. The read index is
  15441. * in units of bytes offset from the base of the meta-data buffer.
  15442. *
  15443. * Write index is updated by the FW. At any point of time, the write index will
  15444. * indicate from where the FW can start writing any new data. The write index is
  15445. * in units of bytes offset from the base of the meta-data buffer.
  15446. *
  15447. * If the Host is not fast enough in reading the CFR data, any new capture data
  15448. * would be dropped if there is no space left to write the new captures.
  15449. *
  15450. * The last 4 bytes of the memory region will have the magic pattern
  15451. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15452. * not overrun the host buffer.
  15453. *
  15454. * ,--------------------. read and write indices store the
  15455. * | | byte offset from the base of the
  15456. * | ,--------+--------. meta-data buffer to the next
  15457. * | | | | location within the data buffer
  15458. * | | v v that will be read / written
  15459. * ************************************************************************
  15460. * * Read * Write * * Magic *
  15461. * * index * index * CFR data1 ...... CFR data N * pattern *
  15462. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15463. * ************************************************************************
  15464. * |<---------- data buffer ---------->|
  15465. *
  15466. * |<----------------- meta-data buffer allocated in Host ----------------|
  15467. *
  15468. * Note:
  15469. * - Considering the 4 bytes needed to store the Read index (R) and the
  15470. * Write index (W), the initial value is as follows:
  15471. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15472. * - Buffer empty condition:
  15473. * R = W
  15474. *
  15475. * Regarding CFR data format:
  15476. * --------------------------
  15477. *
  15478. * Each CFR tone is stored in HW as 16-bits with the following format:
  15479. * {bits[15:12], bits[11:6], bits[5:0]} =
  15480. * {unsigned exponent (4 bits),
  15481. * signed mantissa_real (6 bits),
  15482. * signed mantissa_imag (6 bits)}
  15483. *
  15484. * CFR_real = mantissa_real * 2^(exponent-5)
  15485. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15486. *
  15487. *
  15488. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15489. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15490. *
  15491. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15492. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15493. * .
  15494. * .
  15495. * .
  15496. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15497. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15498. */
  15499. /* Bandwidth of peer CFR captures */
  15500. typedef enum {
  15501. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15502. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15503. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15504. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15505. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15506. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15507. } HTT_PEER_CFR_CAPTURE_BW;
  15508. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15509. * was captured
  15510. */
  15511. typedef enum {
  15512. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15513. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15514. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15515. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15516. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15517. } HTT_PEER_CFR_CAPTURE_MODE;
  15518. typedef enum {
  15519. /* This message type is currently used for the below purpose:
  15520. *
  15521. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15522. * wmi_peer_cfr_capture_cmd.
  15523. * If payload_present bit is set to 0 then the associated memory region
  15524. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15525. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15526. * message; the CFR dump will be present at the end of the message,
  15527. * after the chan_phy_mode.
  15528. */
  15529. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15530. /* Always keep this last */
  15531. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15532. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15533. /**
  15534. * @brief target -> host CFR dump completion indication message definition
  15535. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15536. *
  15537. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15538. *
  15539. * @details
  15540. * The following diagram shows the format of the Channel Frequency Response
  15541. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15542. * the channel capture of a peer is copied by Firmware into the Host memory
  15543. *
  15544. * **************************************************************************
  15545. *
  15546. * Message format when the CFR capture message type is
  15547. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15548. *
  15549. * **************************************************************************
  15550. *
  15551. * |31 16|15 |8|7 0|
  15552. * |----------------------------------------------------------------|
  15553. * header: | reserved |P| msg_type |
  15554. * word 0 | | | |
  15555. * |----------------------------------------------------------------|
  15556. * payload: | cfr_capture_msg_type |
  15557. * word 1 | |
  15558. * |----------------------------------------------------------------|
  15559. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15560. * word 2 | | | | | | | | |
  15561. * |----------------------------------------------------------------|
  15562. * | mac_addr31to0 |
  15563. * word 3 | |
  15564. * |----------------------------------------------------------------|
  15565. * | unused / reserved | mac_addr47to32 |
  15566. * word 4 | | |
  15567. * |----------------------------------------------------------------|
  15568. * | index |
  15569. * word 5 | |
  15570. * |----------------------------------------------------------------|
  15571. * | length |
  15572. * word 6 | |
  15573. * |----------------------------------------------------------------|
  15574. * | timestamp |
  15575. * word 7 | |
  15576. * |----------------------------------------------------------------|
  15577. * | counter |
  15578. * word 8 | |
  15579. * |----------------------------------------------------------------|
  15580. * | chan_mhz |
  15581. * word 9 | |
  15582. * |----------------------------------------------------------------|
  15583. * | band_center_freq1 |
  15584. * word 10 | |
  15585. * |----------------------------------------------------------------|
  15586. * | band_center_freq2 |
  15587. * word 11 | |
  15588. * |----------------------------------------------------------------|
  15589. * | chan_phy_mode |
  15590. * word 12 | |
  15591. * |----------------------------------------------------------------|
  15592. * where,
  15593. * P - payload present bit (payload_present explained below)
  15594. * req_id - memory request id (mem_req_id explained below)
  15595. * S - status field (status explained below)
  15596. * capbw - capture bandwidth (capture_bw explained below)
  15597. * mode - mode of capture (mode explained below)
  15598. * sts - space time streams (sts_count explained below)
  15599. * chbw - channel bandwidth (channel_bw explained below)
  15600. * captype - capture type (cap_type explained below)
  15601. *
  15602. * The following field definitions describe the format of the CFR dump
  15603. * completion indication sent from the target to the host
  15604. *
  15605. * Header fields:
  15606. *
  15607. * Word 0
  15608. * - msg_type
  15609. * Bits 7:0
  15610. * Purpose: Identifies this as CFR TX completion indication
  15611. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15612. * - payload_present
  15613. * Bit 8
  15614. * Purpose: Identifies how CFR data is sent to host
  15615. * Value: 0 - If CFR Payload is written to host memory
  15616. * 1 - If CFR Payload is sent as part of HTT message
  15617. * (This is the requirement for SDIO/USB where it is
  15618. * not possible to write CFR data to host memory)
  15619. * - reserved
  15620. * Bits 31:9
  15621. * Purpose: Reserved
  15622. * Value: 0
  15623. *
  15624. * Payload fields:
  15625. *
  15626. * Word 1
  15627. * - cfr_capture_msg_type
  15628. * Bits 31:0
  15629. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15630. * to specify the format used for the remainder of the message
  15631. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15632. * (currently only MSG_TYPE_1 is defined)
  15633. *
  15634. * Word 2
  15635. * - mem_req_id
  15636. * Bits 6:0
  15637. * Purpose: Contain the mem request id of the region where the CFR capture
  15638. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15639. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15640. this value is invalid)
  15641. * - status
  15642. * Bit 7
  15643. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15644. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15645. * - capture_bw
  15646. * Bits 10:8
  15647. * Purpose: Carry the bandwidth of the CFR capture
  15648. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15649. * - mode
  15650. * Bits 13:11
  15651. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15652. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15653. * - sts_count
  15654. * Bits 16:14
  15655. * Purpose: Carry the number of space time streams
  15656. * Value: Number of space time streams
  15657. * - channel_bw
  15658. * Bits 19:17
  15659. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15660. * measurement
  15661. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15662. * - cap_type
  15663. * Bits 23:20
  15664. * Purpose: Carry the type of the capture
  15665. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15666. * - vdev_id
  15667. * Bits 31:24
  15668. * Purpose: Carry the virtual device id
  15669. * Value: vdev ID
  15670. *
  15671. * Word 3
  15672. * - mac_addr31to0
  15673. * Bits 31:0
  15674. * Purpose: Contain the bits 31:0 of the peer MAC address
  15675. * Value: Bits 31:0 of the peer MAC address
  15676. *
  15677. * Word 4
  15678. * - mac_addr47to32
  15679. * Bits 15:0
  15680. * Purpose: Contain the bits 47:32 of the peer MAC address
  15681. * Value: Bits 47:32 of the peer MAC address
  15682. *
  15683. * Word 5
  15684. * - index
  15685. * Bits 31:0
  15686. * Purpose: Contain the index at which this CFR dump was written in the Host
  15687. * allocated memory. This index is the number of bytes from the base address.
  15688. * Value: Index position
  15689. *
  15690. * Word 6
  15691. * - length
  15692. * Bits 31:0
  15693. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15694. * Value: Length of the CFR capture of the peer
  15695. *
  15696. * Word 7
  15697. * - timestamp
  15698. * Bits 31:0
  15699. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15700. * clock used for this timestamp is private to the target and not visible to
  15701. * the host i.e., Host can interpret only the relative timestamp deltas from
  15702. * one message to the next, but can't interpret the absolute timestamp from a
  15703. * single message.
  15704. * Value: Timestamp in microseconds
  15705. *
  15706. * Word 8
  15707. * - counter
  15708. * Bits 31:0
  15709. * Purpose: Carry the count of the current CFR capture from FW. This is
  15710. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15711. * in host memory)
  15712. * Value: Count of the current CFR capture
  15713. *
  15714. * Word 9
  15715. * - chan_mhz
  15716. * Bits 31:0
  15717. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15718. * Value: Primary 20 channel frequency
  15719. *
  15720. * Word 10
  15721. * - band_center_freq1
  15722. * Bits 31:0
  15723. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15724. * Value: Center frequency 1 in MHz
  15725. *
  15726. * Word 11
  15727. * - band_center_freq2
  15728. * Bits 31:0
  15729. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15730. * the VDEV
  15731. * 80plus80 mode
  15732. * Value: Center frequency 2 in MHz
  15733. *
  15734. * Word 12
  15735. * - chan_phy_mode
  15736. * Bits 31:0
  15737. * Purpose: Carry the phy mode of the channel, of the VDEV
  15738. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15739. */
  15740. PREPACK struct htt_cfr_dump_ind_type_1 {
  15741. A_UINT32 mem_req_id:7,
  15742. status:1,
  15743. capture_bw:3,
  15744. mode:3,
  15745. sts_count:3,
  15746. channel_bw:3,
  15747. cap_type:4,
  15748. vdev_id:8;
  15749. htt_mac_addr addr;
  15750. A_UINT32 index;
  15751. A_UINT32 length;
  15752. A_UINT32 timestamp;
  15753. A_UINT32 counter;
  15754. struct htt_chan_change_msg chan;
  15755. } POSTPACK;
  15756. PREPACK struct htt_cfr_dump_compl_ind {
  15757. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15758. union {
  15759. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15760. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15761. /* If there is a need to change the memory layout and its associated
  15762. * HTT indication format, a new CFR capture message type can be
  15763. * introduced and added into this union.
  15764. */
  15765. };
  15766. } POSTPACK;
  15767. /*
  15768. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15769. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15770. */
  15771. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15772. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15773. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15774. do { \
  15775. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15776. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15777. } while(0)
  15778. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15779. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15780. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15781. /*
  15782. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15783. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15784. */
  15785. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15786. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15787. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15788. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15789. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15790. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15791. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15792. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15793. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15794. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15795. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15796. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15797. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15798. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15799. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15800. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15801. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15802. do { \
  15803. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15804. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15805. } while (0)
  15806. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15807. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15808. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15809. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15810. do { \
  15811. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15812. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15813. } while (0)
  15814. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15815. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15816. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15817. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15818. do { \
  15819. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15820. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15821. } while (0)
  15822. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15823. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15824. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15825. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15826. do { \
  15827. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15828. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15829. } while (0)
  15830. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15831. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15832. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15833. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15834. do { \
  15835. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15836. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15837. } while (0)
  15838. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15839. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15840. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15841. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15842. do { \
  15843. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15844. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15845. } while (0)
  15846. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15847. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15848. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15849. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15850. do { \
  15851. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15852. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15853. } while (0)
  15854. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15855. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15856. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15857. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15858. do { \
  15859. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15860. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15861. } while (0)
  15862. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15863. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15864. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15865. /**
  15866. * @brief target -> host peer (PPDU) stats message
  15867. *
  15868. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15869. *
  15870. * @details
  15871. * This message is generated by FW when FW is sending stats to host
  15872. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15873. * This message is sent autonomously by the target rather than upon request
  15874. * by the host.
  15875. * The following field definitions describe the format of the HTT target
  15876. * to host peer stats indication message.
  15877. *
  15878. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15879. * or more PPDU stats records.
  15880. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15881. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15882. * then the message would start with the
  15883. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15884. * below.
  15885. *
  15886. * |31 16|15|14|13 11|10 9|8|7 0|
  15887. * |-------------------------------------------------------------|
  15888. * | reserved |MSG_TYPE |
  15889. * |-------------------------------------------------------------|
  15890. * rec 0 | TLV header |
  15891. * rec 0 |-------------------------------------------------------------|
  15892. * rec 0 | ppdu successful bytes |
  15893. * rec 0 |-------------------------------------------------------------|
  15894. * rec 0 | ppdu retry bytes |
  15895. * rec 0 |-------------------------------------------------------------|
  15896. * rec 0 | ppdu failed bytes |
  15897. * rec 0 |-------------------------------------------------------------|
  15898. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15899. * rec 0 |-------------------------------------------------------------|
  15900. * rec 0 | retried MSDUs | successful MSDUs |
  15901. * rec 0 |-------------------------------------------------------------|
  15902. * rec 0 | TX duration | failed MSDUs |
  15903. * rec 0 |-------------------------------------------------------------|
  15904. * ...
  15905. * |-------------------------------------------------------------|
  15906. * rec N | TLV header |
  15907. * rec N |-------------------------------------------------------------|
  15908. * rec N | ppdu successful bytes |
  15909. * rec N |-------------------------------------------------------------|
  15910. * rec N | ppdu retry bytes |
  15911. * rec N |-------------------------------------------------------------|
  15912. * rec N | ppdu failed bytes |
  15913. * rec N |-------------------------------------------------------------|
  15914. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15915. * rec N |-------------------------------------------------------------|
  15916. * rec N | retried MSDUs | successful MSDUs |
  15917. * rec N |-------------------------------------------------------------|
  15918. * rec N | TX duration | failed MSDUs |
  15919. * rec N |-------------------------------------------------------------|
  15920. *
  15921. * where:
  15922. * A = is A-MPDU flag
  15923. * BA = block-ack failure flags
  15924. * BW = bandwidth spec
  15925. * SG = SGI enabled spec
  15926. * S = skipped rate ctrl
  15927. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15928. *
  15929. * Header
  15930. * ------
  15931. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15932. * dword0 - b'8:31 - reserved : Reserved for future use
  15933. *
  15934. * payload include below peer_stats information
  15935. * --------------------------------------------
  15936. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15937. * @tx_success_bytes : total successful bytes in the PPDU.
  15938. * @tx_retry_bytes : total retried bytes in the PPDU.
  15939. * @tx_failed_bytes : total failed bytes in the PPDU.
  15940. * @tx_ratecode : rate code used for the PPDU.
  15941. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15942. * @ba_ack_failed : BA/ACK failed for this PPDU
  15943. * b00 -> BA received
  15944. * b01 -> BA failed once
  15945. * b10 -> BA failed twice, when HW retry is enabled.
  15946. * @bw : BW
  15947. * b00 -> 20 MHz
  15948. * b01 -> 40 MHz
  15949. * b10 -> 80 MHz
  15950. * b11 -> 160 MHz (or 80+80)
  15951. * @sg : SGI enabled
  15952. * @s : skipped ratectrl
  15953. * @peer_id : peer id
  15954. * @tx_success_msdus : successful MSDUs
  15955. * @tx_retry_msdus : retried MSDUs
  15956. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15957. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15958. */
  15959. /**
  15960. * @brief target -> host backpressure event
  15961. *
  15962. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15963. *
  15964. * @details
  15965. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15966. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15967. * This message will only be sent if the backpressure condition has existed
  15968. * continuously for an initial period (100 ms).
  15969. * Repeat messages with updated information will be sent after each
  15970. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15971. * This message indicates the ring id along with current head and tail index
  15972. * locations (i.e. write and read indices).
  15973. * The backpressure time indicates the time in ms for which continuous
  15974. * backpressure has been observed in the ring.
  15975. *
  15976. * The message format is as follows:
  15977. *
  15978. * |31 24|23 16|15 8|7 0|
  15979. * |----------------+----------------+----------------+----------------|
  15980. * | ring_id | ring_type | pdev_id | msg_type |
  15981. * |-------------------------------------------------------------------|
  15982. * | tail_idx | head_idx |
  15983. * |-------------------------------------------------------------------|
  15984. * | backpressure_time_ms |
  15985. * |-------------------------------------------------------------------|
  15986. *
  15987. * The message is interpreted as follows:
  15988. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15989. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15990. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15991. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15992. * the msg is for LMAC ring.
  15993. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15994. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15995. * htt_backpressure_lmac_ring_id. This represents
  15996. * the ring id for which continuous backpressure
  15997. * is seen
  15998. *
  15999. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16000. * the ring indicated by the ring_id
  16001. *
  16002. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16003. * the ring indicated by the ring id
  16004. *
  16005. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16006. * backpressure has been seen in the ring
  16007. * indicated by the ring_id.
  16008. * Units = milliseconds
  16009. */
  16010. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16011. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16012. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16013. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16014. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16015. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16016. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16017. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16018. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16019. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16020. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16021. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16022. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16023. do { \
  16024. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16025. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16026. } while (0)
  16027. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16028. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16029. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16030. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16031. do { \
  16032. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16033. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16034. } while (0)
  16035. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16036. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16037. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16038. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16039. do { \
  16040. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16041. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16042. } while (0)
  16043. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16044. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16045. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16046. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16047. do { \
  16048. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16049. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16050. } while (0)
  16051. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16052. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16053. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16054. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16055. do { \
  16056. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16057. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16058. } while (0)
  16059. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16060. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16061. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16062. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16063. do { \
  16064. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16065. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16066. } while (0)
  16067. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16068. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16069. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16070. enum htt_backpressure_ring_type {
  16071. HTT_SW_RING_TYPE_UMAC,
  16072. HTT_SW_RING_TYPE_LMAC,
  16073. HTT_SW_RING_TYPE_MAX,
  16074. };
  16075. /* Ring id for which the message is sent to host */
  16076. enum htt_backpressure_umac_ringid {
  16077. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16078. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16079. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16080. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16081. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16082. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16083. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16084. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16085. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16086. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16087. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16088. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16089. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16090. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16091. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16092. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16093. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16094. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16095. HTT_SW_UMAC_RING_IDX_MAX,
  16096. };
  16097. enum htt_backpressure_lmac_ringid {
  16098. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16099. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16100. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16101. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16102. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16103. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16104. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16105. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16106. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16107. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16108. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16109. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16110. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16111. HTT_SW_LMAC_RING_IDX_MAX,
  16112. };
  16113. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16114. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16115. pdev_id: 8,
  16116. ring_type: 8, /* htt_backpressure_ring_type */
  16117. /*
  16118. * ring_id holds an enum value from either
  16119. * htt_backpressure_umac_ringid or
  16120. * htt_backpressure_lmac_ringid, based on
  16121. * the ring_type setting.
  16122. */
  16123. ring_id: 8;
  16124. A_UINT16 head_idx;
  16125. A_UINT16 tail_idx;
  16126. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16127. } POSTPACK;
  16128. /*
  16129. * Defines two 32 bit words that can be used by the target to indicate a per
  16130. * user RU allocation and rate information.
  16131. *
  16132. * This information is currently provided in the "sw_response_reference_ptr"
  16133. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16134. * "rx_ppdu_end_user_stats" TLV.
  16135. *
  16136. * VALID:
  16137. * The consumer of these words must explicitly check the valid bit,
  16138. * and only attempt interpretation of any of the remaining fields if
  16139. * the valid bit is set to 1.
  16140. *
  16141. * VERSION:
  16142. * The consumer of these words must also explicitly check the version bit,
  16143. * and only use the V0 definition if the VERSION field is set to 0.
  16144. *
  16145. * Version 1 is currently undefined, with the exception of the VALID and
  16146. * VERSION fields.
  16147. *
  16148. * Version 0:
  16149. *
  16150. * The fields below are duplicated per BW.
  16151. *
  16152. * The consumer must determine which BW field to use, based on the UL OFDMA
  16153. * PPDU BW indicated by HW.
  16154. *
  16155. * RU_START: RU26 start index for the user.
  16156. * Note that this is always using the RU26 index, regardless
  16157. * of the actual RU assigned to the user
  16158. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16159. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16160. *
  16161. * For example, 20MHz (the value in the top row is RU_START)
  16162. *
  16163. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16164. * RU Size 1 (52): | | | | | |
  16165. * RU Size 2 (106): | | | |
  16166. * RU Size 3 (242): | |
  16167. *
  16168. * RU_SIZE: Indicates the RU size, as defined by enum
  16169. * htt_ul_ofdma_user_info_ru_size.
  16170. *
  16171. * LDPC: LDPC enabled (if 0, BCC is used)
  16172. *
  16173. * DCM: DCM enabled
  16174. *
  16175. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16176. * |---------------------------------+--------------------------------|
  16177. * |Ver|Valid| FW internal |
  16178. * |---------------------------------+--------------------------------|
  16179. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16180. * |---------------------------------+--------------------------------|
  16181. */
  16182. enum htt_ul_ofdma_user_info_ru_size {
  16183. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16184. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16185. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16186. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16187. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16188. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16189. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16190. };
  16191. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16192. struct htt_ul_ofdma_user_info_v0 {
  16193. A_UINT32 word0;
  16194. A_UINT32 word1;
  16195. };
  16196. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16197. A_UINT32 w0_fw_rsvd:30; \
  16198. A_UINT32 w0_valid:1; \
  16199. A_UINT32 w0_version:1;
  16200. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16201. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16202. };
  16203. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16204. A_UINT32 w1_nss:3; \
  16205. A_UINT32 w1_mcs:4; \
  16206. A_UINT32 w1_ldpc:1; \
  16207. A_UINT32 w1_dcm:1; \
  16208. A_UINT32 w1_ru_start:7; \
  16209. A_UINT32 w1_ru_size:3; \
  16210. A_UINT32 w1_trig_type:4; \
  16211. A_UINT32 w1_unused:9;
  16212. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16213. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16214. };
  16215. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16216. A_UINT32 w0_fw_rsvd:27; \
  16217. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16218. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16219. 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) */
  16220. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16221. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16222. };
  16223. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16224. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16225. A_UINT32 w1_trig_type:4; \
  16226. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16227. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16228. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16229. };
  16230. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16231. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16232. union {
  16233. A_UINT32 word0;
  16234. struct {
  16235. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16236. };
  16237. };
  16238. union {
  16239. A_UINT32 word1;
  16240. struct {
  16241. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16242. };
  16243. };
  16244. } POSTPACK;
  16245. /*
  16246. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16247. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16248. * this should be picked.
  16249. */
  16250. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16251. union {
  16252. A_UINT32 word0;
  16253. struct {
  16254. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16255. };
  16256. };
  16257. union {
  16258. A_UINT32 word1;
  16259. struct {
  16260. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16261. };
  16262. };
  16263. } POSTPACK;
  16264. enum HTT_UL_OFDMA_TRIG_TYPE {
  16265. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16266. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16267. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16268. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16269. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16270. };
  16271. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16272. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16273. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16274. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16277. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16278. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16279. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16280. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16281. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16282. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16283. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16284. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16285. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16286. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16287. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16288. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16289. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16291. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16292. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16293. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16294. /*--- word 0 ---*/
  16295. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16296. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16297. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16298. do { \
  16299. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16300. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16301. } while (0)
  16302. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16303. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16304. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16305. do { \
  16306. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16307. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16308. } while (0)
  16309. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16310. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16311. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16312. do { \
  16313. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16314. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16315. } while (0)
  16316. /*--- word 1 ---*/
  16317. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16318. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16320. do { \
  16321. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16322. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16323. } while (0)
  16324. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16325. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16327. do { \
  16328. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16329. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16330. } while (0)
  16331. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16332. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16333. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16334. do { \
  16335. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16336. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16337. } while (0)
  16338. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16339. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16340. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16341. do { \
  16342. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16343. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16344. } while (0)
  16345. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16346. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16347. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16348. do { \
  16349. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16350. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16351. } while (0)
  16352. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16353. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16354. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16355. do { \
  16356. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16357. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16358. } while (0)
  16359. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16360. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16362. do { \
  16363. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16364. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16365. } while (0)
  16366. /**
  16367. * @brief target -> host channel calibration data message
  16368. *
  16369. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16370. *
  16371. * @brief host -> target channel calibration data message
  16372. *
  16373. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16374. *
  16375. * @details
  16376. * The following field definitions describe the format of the channel
  16377. * calibration data message sent from the target to the host when
  16378. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16379. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16380. * The message is defined as htt_chan_caldata_msg followed by a variable
  16381. * number of 32-bit character values.
  16382. *
  16383. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16384. * |------------------------------------------------------------------|
  16385. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16386. * |------------------------------------------------------------------|
  16387. * | payload size | mhz |
  16388. * |------------------------------------------------------------------|
  16389. * | center frequency 2 | center frequency 1 |
  16390. * |------------------------------------------------------------------|
  16391. * | check sum |
  16392. * |------------------------------------------------------------------|
  16393. * | payload |
  16394. * |------------------------------------------------------------------|
  16395. * message info field:
  16396. * - MSG_TYPE
  16397. * Bits 7:0
  16398. * Purpose: identifies this as a channel calibration data message
  16399. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16400. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16401. * - SUB_TYPE
  16402. * Bits 11:8
  16403. * Purpose: T2H: indicates whether target is providing chan cal data
  16404. * to the host to store, or requesting that the host
  16405. * download previously-stored data.
  16406. * H2T: indicates whether the host is providing the requested
  16407. * channel cal data, or if it is rejecting the data
  16408. * request because it does not have the requested data.
  16409. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16410. * - CHKSUM_VALID
  16411. * Bit 12
  16412. * Purpose: indicates if the checksum field is valid
  16413. * value:
  16414. * - FRAG
  16415. * Bit 19:16
  16416. * Purpose: indicates the fragment index for message
  16417. * value: 0 for first fragment, 1 for second fragment, ...
  16418. * - APPEND
  16419. * Bit 20
  16420. * Purpose: indicates if this is the last fragment
  16421. * value: 0 = final fragment, 1 = more fragments will be appended
  16422. *
  16423. * channel and payload size field
  16424. * - MHZ
  16425. * Bits 15:0
  16426. * Purpose: indicates the channel primary frequency
  16427. * Value:
  16428. * - PAYLOAD_SIZE
  16429. * Bits 31:16
  16430. * Purpose: indicates the bytes of calibration data in payload
  16431. * Value:
  16432. *
  16433. * center frequency field
  16434. * - CENTER FREQUENCY 1
  16435. * Bits 15:0
  16436. * Purpose: indicates the channel center frequency
  16437. * Value: channel center frequency, in MHz units
  16438. * - CENTER FREQUENCY 2
  16439. * Bits 31:16
  16440. * Purpose: indicates the secondary channel center frequency,
  16441. * only for 11acvht 80plus80 mode
  16442. * Value: secondary channel center frequency, in MHz units, if applicable
  16443. *
  16444. * checksum field
  16445. * - CHECK_SUM
  16446. * Bits 31:0
  16447. * Purpose: check the payload data, it is just for this fragment.
  16448. * This is intended for the target to check that the channel
  16449. * calibration data returned by the host is the unmodified data
  16450. * that was previously provided to the host by the target.
  16451. * value: checksum of fragment payload
  16452. */
  16453. PREPACK struct htt_chan_caldata_msg {
  16454. /* DWORD 0: message info */
  16455. A_UINT32
  16456. msg_type: 8,
  16457. sub_type: 4 ,
  16458. chksum_valid: 1, /** 1:valid, 0:invalid */
  16459. reserved1: 3,
  16460. frag_idx: 4, /** fragment index for calibration data */
  16461. appending: 1, /** 0: no fragment appending,
  16462. * 1: extra fragment appending */
  16463. reserved2: 11;
  16464. /* DWORD 1: channel and payload size */
  16465. A_UINT32
  16466. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16467. payload_size: 16; /** unit: bytes */
  16468. /* DWORD 2: center frequency */
  16469. A_UINT32
  16470. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16471. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16472. * valid only for 11acvht 80plus80 mode */
  16473. /* DWORD 3: check sum */
  16474. A_UINT32 chksum;
  16475. /* variable length for calibration data */
  16476. A_UINT32 payload[1/* or more */];
  16477. } POSTPACK;
  16478. /* T2H SUBTYPE */
  16479. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16480. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16481. /* H2T SUBTYPE */
  16482. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16483. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16484. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16485. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16486. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16487. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16488. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16489. do { \
  16490. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16491. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16492. } while (0)
  16493. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16494. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16495. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16496. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16497. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16498. do { \
  16499. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16500. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16501. } while (0)
  16502. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16503. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16504. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16505. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16506. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16507. do { \
  16508. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16509. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16510. } while (0)
  16511. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16512. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16513. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16514. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16515. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16516. do { \
  16517. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16518. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16519. } while (0)
  16520. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16521. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16522. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16523. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16524. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16525. do { \
  16526. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16527. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16528. } while (0)
  16529. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16530. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16531. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16532. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16533. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16534. do { \
  16535. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16536. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16537. } while (0)
  16538. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16539. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16540. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16541. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16542. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16543. do { \
  16544. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16545. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16546. } while (0)
  16547. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16548. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16549. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16550. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16551. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16552. do { \
  16553. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16554. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16555. } while (0)
  16556. /**
  16557. * @brief target -> host FSE CMEM based send
  16558. *
  16559. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16560. *
  16561. * @details
  16562. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16563. * FSE placement in CMEM is enabled.
  16564. *
  16565. * This message sends the non-secure CMEM base address.
  16566. * It will be sent to host in response to message
  16567. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16568. * The message would appear as follows:
  16569. *
  16570. * |31 24|23 16|15 8|7 0|
  16571. * |----------------+----------------+----------------+----------------|
  16572. * | reserved | num_entries | msg_type |
  16573. * |----------------+----------------+----------------+----------------|
  16574. * | base_address_lo |
  16575. * |----------------+----------------+----------------+----------------|
  16576. * | base_address_hi |
  16577. * |-------------------------------------------------------------------|
  16578. *
  16579. * The message is interpreted as follows:
  16580. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16581. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16582. * b'8:15 - number_entries: Indicated the number of entries
  16583. * programmed.
  16584. * b'16:31 - reserved.
  16585. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16586. * CMEM base address
  16587. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16588. * CMEM base address
  16589. */
  16590. PREPACK struct htt_cmem_base_send_t {
  16591. A_UINT32 msg_type: 8,
  16592. num_entries: 8,
  16593. reserved: 16;
  16594. A_UINT32 base_address_lo;
  16595. A_UINT32 base_address_hi;
  16596. } POSTPACK;
  16597. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16598. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16599. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16600. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16601. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16602. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16603. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16604. do { \
  16605. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16606. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16607. } while (0)
  16608. /**
  16609. * @brief - HTT PPDU ID format
  16610. *
  16611. * @details
  16612. * The following field definitions describe the format of the PPDU ID.
  16613. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16614. *
  16615. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16616. * +--------------------------------------------------------------------------
  16617. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16618. * +--------------------------------------------------------------------------
  16619. *
  16620. * sch id :Schedule command id
  16621. * Bits [11 : 0] : monotonically increasing counter to track the
  16622. * PPDU posted to a specific transmit queue.
  16623. *
  16624. * hwq_id: Hardware Queue ID.
  16625. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16626. *
  16627. * mac_id: MAC ID
  16628. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16629. *
  16630. * seq_idx: Sequence index.
  16631. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16632. * a particular TXOP.
  16633. *
  16634. * tqm_cmd: HWSCH/TQM flag.
  16635. * Bit [23] : Always set to 0.
  16636. *
  16637. * seq_cmd_type: Sequence command type.
  16638. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16639. * Refer to enum HTT_STATS_FTYPE for values.
  16640. */
  16641. PREPACK struct htt_ppdu_id {
  16642. A_UINT32
  16643. sch_id: 12,
  16644. hwq_id: 5,
  16645. mac_id: 2,
  16646. seq_idx: 2,
  16647. reserved1: 2,
  16648. tqm_cmd: 1,
  16649. seq_cmd_type: 6,
  16650. reserved2: 2;
  16651. } POSTPACK;
  16652. #define HTT_PPDU_ID_SCH_ID_S 0
  16653. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16654. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16655. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16656. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16657. do { \
  16658. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16659. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16660. } while (0)
  16661. #define HTT_PPDU_ID_HWQ_ID_S 12
  16662. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16663. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16664. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16665. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16666. do { \
  16667. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16668. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16669. } while (0)
  16670. #define HTT_PPDU_ID_MAC_ID_S 17
  16671. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16672. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16673. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16674. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16675. do { \
  16676. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16677. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16678. } while (0)
  16679. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16680. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16681. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16682. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16683. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16684. do { \
  16685. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16686. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16687. } while (0)
  16688. #define HTT_PPDU_ID_TQM_CMD_S 23
  16689. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16690. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16691. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16692. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16693. do { \
  16694. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16695. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16696. } while (0)
  16697. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16698. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16699. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16700. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16701. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16702. do { \
  16703. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16704. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16705. } while (0)
  16706. /**
  16707. * @brief target -> RX PEER METADATA V0 format
  16708. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16709. * message from target, and will confirm to the target which peer metadata
  16710. * version to use in the wmi_init message.
  16711. *
  16712. * The following diagram shows the format of the RX PEER METADATA.
  16713. *
  16714. * |31 24|23 16|15 8|7 0|
  16715. * |-----------------------------------------------------------------------|
  16716. * | Reserved | VDEV ID | PEER ID |
  16717. * |-----------------------------------------------------------------------|
  16718. */
  16719. PREPACK struct htt_rx_peer_metadata_v0 {
  16720. A_UINT32
  16721. peer_id: 16,
  16722. vdev_id: 8,
  16723. reserved1: 8;
  16724. } POSTPACK;
  16725. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16726. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16727. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16728. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16729. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16730. do { \
  16731. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16732. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16733. } while (0)
  16734. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16735. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16736. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16737. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16738. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16739. do { \
  16740. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16741. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16742. } while (0)
  16743. /**
  16744. * @brief target -> RX PEER METADATA V1 format
  16745. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16746. * message from target, and will confirm to the target which peer metadata
  16747. * version to use in the wmi_init message.
  16748. *
  16749. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16750. *
  16751. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16752. * |---------------------------------------------------------------------------|
  16753. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  16754. * |---------------------------------------------------------------------------|
  16755. */
  16756. PREPACK struct htt_rx_peer_metadata_v1 {
  16757. A_UINT32
  16758. peer_id: 13,
  16759. ml_peer_valid: 1,
  16760. logical_link_id: 2,
  16761. vdev_id: 8,
  16762. lmac_id: 2,
  16763. chip_id: 3,
  16764. reserved2: 3;
  16765. } POSTPACK;
  16766. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16767. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16768. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16769. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16770. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16771. do { \
  16772. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16773. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16774. } while (0)
  16775. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16776. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16777. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16778. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16779. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16780. do { \
  16781. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16782. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16783. } while (0)
  16784. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16785. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16786. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16787. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16788. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  16789. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  16790. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  16791. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  16792. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  16793. do { \
  16794. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  16795. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  16796. } while (0)
  16797. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16798. do { \
  16799. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16800. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16801. } while (0)
  16802. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16803. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16804. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16805. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16806. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16807. do { \
  16808. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16809. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16810. } while (0)
  16811. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16812. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16813. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16814. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16815. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16816. do { \
  16817. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16818. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16819. } while (0)
  16820. /*
  16821. * In some systems, the host SW wants to specify priorities between
  16822. * different MSDU / flow queues within the same peer-TID.
  16823. * The below enums are used for the host to identify to the target
  16824. * which MSDU queue's priority it wants to adjust.
  16825. */
  16826. /*
  16827. * The MSDUQ index describe index of TCL HW, where each index is
  16828. * used for queuing particular types of MSDUs.
  16829. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16830. */
  16831. enum HTT_MSDUQ_INDEX {
  16832. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16833. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16834. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16835. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16836. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16837. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16838. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16839. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16840. HTT_MSDUQ_MAX_INDEX,
  16841. };
  16842. /* MSDU qtype definition */
  16843. enum HTT_MSDU_QTYPE {
  16844. /*
  16845. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16846. * relative priority. Instead, the relative priority of CRIT_0 versus
  16847. * CRIT_1 is controlled by the FW, through the configuration parameters
  16848. * it applies to the queues.
  16849. */
  16850. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16851. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16852. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16853. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16854. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16855. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16856. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16857. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16858. /* New MSDU_QTYPE should be added above this line */
  16859. /*
  16860. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16861. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16862. * any host/target message definitions. The QTYPE_MAX value can
  16863. * only be used internally within the host or within the target.
  16864. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16865. * it must regard the unexpected value as a default qtype value,
  16866. * or ignore it.
  16867. */
  16868. HTT_MSDU_QTYPE_MAX,
  16869. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16870. };
  16871. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16872. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16873. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16874. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16875. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16876. };
  16877. /**
  16878. * @brief target -> host mlo timestamp offset indication
  16879. *
  16880. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16881. *
  16882. * @details
  16883. * The following field definitions describe the format of the HTT target
  16884. * to host mlo timestamp offset indication message.
  16885. *
  16886. *
  16887. * |31 16|15 12|11 10|9 8|7 0 |
  16888. * |----------------------------------------------------------------------|
  16889. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16890. * |----------------------------------------------------------------------|
  16891. * | Sync time stamp lo in us |
  16892. * |----------------------------------------------------------------------|
  16893. * | Sync time stamp hi in us |
  16894. * |----------------------------------------------------------------------|
  16895. * | mlo time stamp offset lo in us |
  16896. * |----------------------------------------------------------------------|
  16897. * | mlo time stamp offset hi in us |
  16898. * |----------------------------------------------------------------------|
  16899. * | mlo time stamp offset clocks in clock ticks |
  16900. * |----------------------------------------------------------------------|
  16901. * |31 26|25 16|15 0 |
  16902. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16903. * | | compensation in clks | |
  16904. * |----------------------------------------------------------------------|
  16905. * |31 22|21 0 |
  16906. * | rsvd 3 | mlo time stamp comp timer period |
  16907. * |----------------------------------------------------------------------|
  16908. * The message is interpreted as follows:
  16909. *
  16910. * dword0 - b'0:7 - msg_type: This will be set to
  16911. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16912. * value: 0x28
  16913. *
  16914. * dword0 - b'9:8 - pdev_id
  16915. *
  16916. * dword0 - b'11:10 - chip_id
  16917. *
  16918. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16919. *
  16920. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16921. *
  16922. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16923. * which last sync interrupt was received
  16924. *
  16925. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16926. * which last sync interrupt was received
  16927. *
  16928. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16929. *
  16930. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16931. *
  16932. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16933. *
  16934. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16935. *
  16936. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16937. * for sub us resolution
  16938. *
  16939. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16940. *
  16941. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16942. * is applied, in us
  16943. *
  16944. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16945. */
  16946. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16947. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16949. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16950. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16952. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16953. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16954. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16955. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16957. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16958. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16960. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16961. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16962. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16963. do { \
  16964. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16965. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16966. } while (0)
  16967. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16968. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16969. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16970. do { \
  16971. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16972. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16973. } while (0)
  16974. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16975. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16976. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16977. do { \
  16978. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16979. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16980. } while (0)
  16981. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16982. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16983. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16984. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16985. do { \
  16986. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16987. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16988. } while (0)
  16989. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16990. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16991. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16992. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16993. do { \
  16994. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16995. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16996. } while (0)
  16997. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16998. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16999. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17000. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17001. do { \
  17002. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17003. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17004. } while (0)
  17005. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17006. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17007. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17008. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17009. do { \
  17010. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17011. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17012. } while (0)
  17013. typedef struct {
  17014. A_UINT32 msg_type: 8, /* bits 7:0 */
  17015. pdev_id: 2, /* bits 9:8 */
  17016. chip_id: 2, /* bits 11:10 */
  17017. reserved1: 4, /* bits 15:12 */
  17018. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17019. A_UINT32 sync_timestamp_lo_us;
  17020. A_UINT32 sync_timestamp_hi_us;
  17021. A_UINT32 mlo_timestamp_offset_lo_us;
  17022. A_UINT32 mlo_timestamp_offset_hi_us;
  17023. A_UINT32 mlo_timestamp_offset_clks;
  17024. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17025. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17026. reserved2: 6; /* bits 31:26 */
  17027. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17028. reserved3: 10; /* bits 31:22 */
  17029. } htt_t2h_mlo_offset_ind_t;
  17030. /*
  17031. * @brief target -> host VDEV TX RX STATS
  17032. *
  17033. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17034. *
  17035. * @details
  17036. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17037. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17038. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17039. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17040. * periodically by target even in the absence of any further HTT request
  17041. * messages from host.
  17042. *
  17043. * The message is formatted as follows:
  17044. *
  17045. * |31 16|15 8|7 0|
  17046. * |---------------------------------+----------------+----------------|
  17047. * | payload_size | pdev_id | msg_type |
  17048. * |---------------------------------+----------------+----------------|
  17049. * | reserved0 |
  17050. * |-------------------------------------------------------------------|
  17051. * | reserved1 |
  17052. * |-------------------------------------------------------------------|
  17053. * | reserved2 |
  17054. * |-------------------------------------------------------------------|
  17055. * | |
  17056. * | VDEV specific Tx Rx stats info |
  17057. * | |
  17058. * |-------------------------------------------------------------------|
  17059. *
  17060. * The message is interpreted as follows:
  17061. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17062. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17063. * b'8:15 - pdev_id
  17064. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17065. * message header fields (msg_type through reserved2)
  17066. * dword1 - b'0:31 - reserved0.
  17067. * dword2 - b'0:31 - reserved1.
  17068. * dword3 - b'0:31 - reserved2.
  17069. */
  17070. typedef struct {
  17071. A_UINT32 msg_type: 8,
  17072. pdev_id: 8,
  17073. payload_size: 16;
  17074. A_UINT32 reserved0;
  17075. A_UINT32 reserved1;
  17076. A_UINT32 reserved2;
  17077. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17078. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17079. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17080. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17081. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17082. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17083. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17084. do { \
  17085. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17086. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17087. } while (0)
  17088. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17089. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17090. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17091. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17092. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17093. do { \
  17094. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17095. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17096. } while (0)
  17097. /* SOC related stats */
  17098. typedef struct {
  17099. htt_tlv_hdr_t tlv_hdr;
  17100. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17101. * This can be due to either the peer is deleted or deletion is ongoing
  17102. * */
  17103. A_UINT32 inv_peers_msdu_drop_count_lo;
  17104. A_UINT32 inv_peers_msdu_drop_count_hi;
  17105. } htt_t2h_soc_txrx_stats_common_tlv;
  17106. /* VDEV HW Tx/Rx stats */
  17107. typedef struct {
  17108. htt_tlv_hdr_t tlv_hdr;
  17109. A_UINT32 vdev_id;
  17110. /* Rx msdu byte cnt */
  17111. A_UINT32 rx_msdu_byte_cnt_lo;
  17112. A_UINT32 rx_msdu_byte_cnt_hi;
  17113. /* Rx msdu cnt */
  17114. A_UINT32 rx_msdu_cnt_lo;
  17115. A_UINT32 rx_msdu_cnt_hi;
  17116. /* tx msdu byte cnt */
  17117. A_UINT32 tx_msdu_byte_cnt_lo;
  17118. A_UINT32 tx_msdu_byte_cnt_hi;
  17119. /* tx msdu cnt */
  17120. A_UINT32 tx_msdu_cnt_lo;
  17121. A_UINT32 tx_msdu_cnt_hi;
  17122. /* tx excessive retry discarded msdu cnt */
  17123. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17124. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17125. /* TX congestion ctrl msdu drop cnt */
  17126. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17127. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17128. /* discarded tx msdus cnt coz of time to live expiry */
  17129. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17130. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17131. /* tx excessive retry discarded msdu byte cnt */
  17132. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17133. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17134. /* TX congestion ctrl msdu drop byte cnt */
  17135. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17136. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17137. /* discarded tx msdus byte cnt coz of time to live expiry */
  17138. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17139. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17140. /* TQM bypass frame cnt */
  17141. A_UINT32 tqm_bypass_frame_cnt_lo;
  17142. A_UINT32 tqm_bypass_frame_cnt_hi;
  17143. /* TQM bypass byte cnt */
  17144. A_UINT32 tqm_bypass_byte_cnt_lo;
  17145. A_UINT32 tqm_bypass_byte_cnt_hi;
  17146. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17147. /*
  17148. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17149. *
  17150. * @details
  17151. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17152. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17153. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17154. * the default MSDU queues of each of the specified TIDs for the peer
  17155. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17156. * If the default MSDU queues of a given TID within the peer are not linked
  17157. * to a service class, the svc_class_id field for that TID will have a
  17158. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17159. * queues for that TID are not mapped to any service class.
  17160. *
  17161. * |31 16|15 8|7 0|
  17162. * |------------------------------+--------------+--------------|
  17163. * | peer ID | reserved | msg type |
  17164. * |------------------------------+--------------+------+-------|
  17165. * | reserved | svc class ID | TID |
  17166. * |------------------------------------------------------------|
  17167. * ...
  17168. * |------------------------------------------------------------|
  17169. * | reserved | svc class ID | TID |
  17170. * |------------------------------------------------------------|
  17171. * Header fields:
  17172. * dword0 - b'7:0 - msg_type: This will be set to
  17173. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17174. * b'31:16 - peer ID
  17175. * dword1 - b'7:0 - TID
  17176. * b'15:8 - svc class ID
  17177. * (dword2, etc. same format as dword1)
  17178. */
  17179. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17180. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17181. A_UINT32 msg_type :8,
  17182. reserved0 :8,
  17183. peer_id :16;
  17184. struct {
  17185. A_UINT32 tid :8,
  17186. svc_class_id :8,
  17187. reserved1 :16;
  17188. } tid_reports[1/*or more*/];
  17189. } POSTPACK;
  17190. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17191. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17192. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17193. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17194. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17195. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17196. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17197. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17198. do { \
  17199. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17200. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17201. } while (0)
  17202. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17203. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17204. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17205. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17206. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17207. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17208. do { \
  17209. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17210. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17211. } while (0)
  17212. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17213. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17214. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17215. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17216. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17217. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17218. do { \
  17219. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17220. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17221. } while (0)
  17222. /*
  17223. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17224. *
  17225. * @details
  17226. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17227. * flow if the flow is seen the associated service class is conveyed to the
  17228. * target via TCL Data Command. Target on the other hand internally creates the
  17229. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17230. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17231. * the newly created MSDUQ
  17232. *
  17233. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17234. * |------------------------------+------------------------+--------------|
  17235. * | peer ID | HTT qtype | msg type |
  17236. * |---------------------------------+--------------+--+---+-------+------|
  17237. * | reserved |AST list index|FO|WC | HLOS | remap|
  17238. * | | | | | TID | TID |
  17239. * |---------------------+------------------------------------------------|
  17240. * | reserved1 | tgt_opaque_id |
  17241. * |---------------------+------------------------------------------------|
  17242. *
  17243. * Header fields:
  17244. *
  17245. * dword0 - b'7:0 - msg_type: This will be set to
  17246. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17247. * b'15:8 - HTT qtype
  17248. * b'31:16 - peer ID
  17249. *
  17250. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17251. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17252. * hlos_tid : Common to Lithium and Beryllium
  17253. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17254. * TCL Data Command : Beryllium
  17255. * b10 - flow_override (FO), as sent by host in
  17256. * TCL Data Command: Beryllium
  17257. * b11:14 - ast_list_idx
  17258. * Array index into the list of extension AST entries
  17259. * (not the actual AST 16-bit index).
  17260. * The ast_list_idx is one-based, with the following
  17261. * range of values:
  17262. * - legacy targets supporting 16 user-defined
  17263. * MSDU queues: 1-2
  17264. * - legacy targets supporting 48 user-defined
  17265. * MSDU queues: 1-6
  17266. * - new targets: 0 (peer_id is used instead)
  17267. * Note that since ast_list_idx is one-based,
  17268. * the host will need to subtract 1 to use it as an
  17269. * index into a list of extension AST entries.
  17270. * b15:31 - reserved
  17271. *
  17272. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17273. * unique MSDUQ id in firmware
  17274. * b'24:31 - reserved1
  17275. */
  17276. PREPACK struct htt_t2h_sawf_msduq_event {
  17277. A_UINT32 msg_type : 8,
  17278. htt_qtype : 8,
  17279. peer_id :16;
  17280. A_UINT32 remap_tid : 4,
  17281. hlos_tid : 4,
  17282. who_classify_info_sel : 2,
  17283. flow_override : 1,
  17284. ast_list_idx : 4,
  17285. reserved :17;
  17286. A_UINT32 tgt_opaque_id :24,
  17287. reserved1 : 8;
  17288. } POSTPACK;
  17289. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17290. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17291. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17292. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17293. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17294. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17295. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17296. do { \
  17297. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17298. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17299. } while (0)
  17300. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17301. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17302. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17303. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17304. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17305. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17306. do { \
  17307. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17308. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17309. } while (0)
  17310. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17311. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17312. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17313. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17314. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17315. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17316. do { \
  17317. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17318. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17319. } while (0)
  17320. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17321. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17322. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17323. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17324. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17325. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17326. do { \
  17327. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17328. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17329. } while (0)
  17330. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17331. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17332. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17333. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17334. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17335. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17336. do { \
  17337. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17338. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17339. } while (0)
  17340. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17341. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17342. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17343. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17344. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17345. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17346. do { \
  17347. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17348. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17349. } while (0)
  17350. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17351. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17352. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17353. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17354. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17355. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17356. do { \
  17357. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17358. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17359. } while (0)
  17360. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17361. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17362. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17363. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17364. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17365. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17366. do { \
  17367. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17368. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17369. } while (0)
  17370. /**
  17371. * @brief target -> PPDU id format indication
  17372. *
  17373. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17374. *
  17375. * @details
  17376. * The following field definitions describe the format of the HTT target
  17377. * to host PPDU ID format indication message.
  17378. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17379. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17380. * seq_idx :- Sequence control index of this PPDU.
  17381. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17382. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17383. * tqm_cmd:-
  17384. *
  17385. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17386. * |--------------------------------------------------+------------------------|
  17387. * | rsvd0 | msg type |
  17388. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17389. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17390. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17391. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17392. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17393. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17394. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17395. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17396. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17397. * Where: OF = bit offset, NB = number of bits, V = valid
  17398. * The message is interpreted as follows:
  17399. *
  17400. * dword0 - b'7:0 - msg_type: This will be set to
  17401. * HTT_T2H_PPDU_ID_FMT_IND
  17402. * value: 0x30
  17403. *
  17404. * dword0 - b'31:8 - reserved
  17405. *
  17406. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17407. *
  17408. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17409. *
  17410. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17411. *
  17412. * dword1 - b'15:11 - reserved for future use
  17413. *
  17414. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17415. *
  17416. * dword1 - b'21:17 - number of bits in ring_id
  17417. *
  17418. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17419. *
  17420. * dword1 - b'31:27 - reserved for future use
  17421. *
  17422. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17423. *
  17424. * dword2 - b'5:1 - number of bits in sequence index
  17425. *
  17426. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17427. *
  17428. * dword2 - b'15:11 - reserved for future use
  17429. *
  17430. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17431. *
  17432. * dword2 - b'21:17 - number of bits in link_id
  17433. *
  17434. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17435. *
  17436. * dword2 - b'31:27 - reserved for future use
  17437. *
  17438. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17439. *
  17440. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17441. *
  17442. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17443. *
  17444. * dword3 - b'15:11 - reserved for future use
  17445. *
  17446. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17447. *
  17448. * dword3 - b'21:17 - number of bits in tqm_cmd
  17449. *
  17450. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17451. *
  17452. * dword3 - b'31:27 - reserved for future use
  17453. *
  17454. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17455. *
  17456. * dword4 - b'5:1 - number of bits in mac_id
  17457. *
  17458. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17459. *
  17460. * dword4 - b'15:11 - reserved for future use
  17461. *
  17462. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17463. *
  17464. * dword4 - b'21:17 - number of bits in crc
  17465. *
  17466. * dword4 - b'26:22 - offset of crc (in number of bits)
  17467. *
  17468. * dword4 - b'31:27 - reserved for future use
  17469. *
  17470. */
  17471. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17472. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17473. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17474. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17475. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17476. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17477. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17478. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17479. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17480. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17481. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17482. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17483. /* macros for accessing lower 16 bits in dword */
  17484. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17485. do { \
  17486. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17487. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17488. } while (0)
  17489. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17490. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17491. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17492. do { \
  17493. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17494. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17495. } while (0)
  17496. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17497. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17498. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17499. do { \
  17500. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17501. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17502. } while (0)
  17503. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17504. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17505. /* macros for accessing upper 16 bits in dword */
  17506. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17507. do { \
  17508. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17509. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17510. } while (0)
  17511. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17512. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17513. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17514. do { \
  17515. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17516. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17517. } while (0)
  17518. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17519. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17520. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17521. do { \
  17522. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17523. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17524. } while (0)
  17525. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17526. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17527. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17528. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17529. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17530. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17531. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17532. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17533. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17534. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17535. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17536. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17537. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17538. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17539. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17540. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17541. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17542. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17543. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17544. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17545. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17546. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17547. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17548. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17549. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17550. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17551. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17552. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17553. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17554. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17555. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17556. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17557. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17558. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17559. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17560. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17561. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17562. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17563. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17564. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17565. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17566. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17567. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17568. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17569. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17570. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17571. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17572. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17573. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17574. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17575. /* offsets in number dwords */
  17576. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17577. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17578. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17579. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17580. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17581. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17582. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17583. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17584. typedef struct {
  17585. A_UINT32 msg_type: 8, /* bits 7:0 */
  17586. rsvd0: 24;/* bits 31:8 */
  17587. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17588. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17589. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17590. rsvd1: 5, /* bits 15:11 */
  17591. ring_id_valid: 1, /* bits 16:16 */
  17592. ring_id_bits: 5, /* bits 21:17 */
  17593. ring_id_offset: 5, /* bits 26:22 */
  17594. rsvd2: 5; /* bits 31:27 */
  17595. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17596. seq_idx_bits: 5, /* bits 5:1 */
  17597. seq_idx_offset: 5, /* bits 10:6 */
  17598. rsvd3: 5, /* bits 15:11 */
  17599. link_id_valid: 1, /* bits 16:16 */
  17600. link_id_bits: 5, /* bits 21:17 */
  17601. link_id_offset: 5, /* bits 26:22 */
  17602. rsvd4: 5; /* bits 31:27 */
  17603. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17604. seq_cmd_type_bits: 5, /* bits 5:1 */
  17605. seq_cmd_type_offset: 5, /* bits 10:6 */
  17606. rsvd5: 5, /* bits 15:11 */
  17607. tqm_cmd_valid: 1, /* bits 16:16 */
  17608. tqm_cmd_bits: 5, /* bits 21:17 */
  17609. tqm_cmd_offset: 5, /* bits 26:12 */
  17610. rsvd6: 5; /* bits 31:27 */
  17611. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17612. mac_id_bits: 5, /* bits 5:1 */
  17613. mac_id_offset: 5, /* bits 10:6 */
  17614. rsvd8: 5, /* bits 15:11 */
  17615. crc_valid: 1, /* bits 16:16 */
  17616. crc_bits: 5, /* bits 21:17 */
  17617. crc_offset: 5, /* bits 26:12 */
  17618. rsvd9: 5; /* bits 31:27 */
  17619. } htt_t2h_ppdu_id_fmt_ind_t;
  17620. #endif